Skip to content

Commit fef4a36

Browse files
author
Roman Syroeshko
committed
Implementation for #371.
1 parent b7387be commit fef4a36

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
99
Place announcement text here.
1010

1111
### Changes
12+
- Improved error message for the case when ``autoload.php`` is not found. - @RomanSyroeshko #371
1213
- Changed visibility of all private properties and methods of ``TemplateProcessor`` to ``protected``. - RomanSyroeshko #498
1314
- Improved performance of ``TemplateProcessor::setValue()``. - @RomanSyroeshko #513
1415
- Renamed ``align`` option of ``Paragraph`` style into ``alignment``. Note: accessor and mutator methods are renamed too. - @RomanSyroeshko

tests/bootstrap.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222
define('PHPWORD_TESTS_BASE_DIR', realpath(__DIR__));
2323
}
2424

25-
$vendor = realpath(__DIR__ . '/../vendor');
26-
if (file_exists($vendor . '/autoload.php')) {
27-
require $vendor . '/autoload.php';
25+
$vendorDirPath = realpath(__DIR__ . '/../vendor');
26+
if (file_exists($vendorDirPath . '/autoload.php')) {
27+
require $vendorDirPath . '/autoload.php';
2828
} else {
29-
throw new Exception('Unable to load dependencies');
29+
throw new Exception(
30+
sprintf(
31+
'Could not find file \'%s\'. It is generated by Composer. Use \'install\' or \'update\' Composer commands to move forward.',
32+
$vendorDirPath . '/autoload.php'
33+
)
34+
);
3035
}
3136

3237
spl_autoload_register(function ($class) {

0 commit comments

Comments
 (0)