Implementation for #371.

This commit is contained in:
Roman Syroeshko 2015-04-14 23:41:11 +03:00
parent b7387be3fd
commit fef4a367fe
2 changed files with 10 additions and 4 deletions

View File

@ -9,6 +9,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
Place announcement text here.
### Changes
- Improved error message for the case when ``autoload.php`` is not found. - @RomanSyroeshko #371
- Changed visibility of all private properties and methods of ``TemplateProcessor`` to ``protected``. - RomanSyroeshko #498
- Improved performance of ``TemplateProcessor::setValue()``. - @RomanSyroeshko #513
- Renamed ``align`` option of ``Paragraph`` style into ``alignment``. Note: accessor and mutator methods are renamed too. - @RomanSyroeshko

View File

@ -22,11 +22,16 @@ if (!defined('PHPWORD_TESTS_BASE_DIR')) {
define('PHPWORD_TESTS_BASE_DIR', realpath(__DIR__));
}
$vendor = realpath(__DIR__ . '/../vendor');
if (file_exists($vendor . '/autoload.php')) {
require $vendor . '/autoload.php';
$vendorDirPath = realpath(__DIR__ . '/../vendor');
if (file_exists($vendorDirPath . '/autoload.php')) {
require $vendorDirPath . '/autoload.php';
} else {
throw new Exception('Unable to load dependencies');
throw new Exception(
sprintf(
'Could not find file \'%s\'. It is generated by Composer. Use \'install\' or \'update\' Composer commands to move forward.',
$vendorDirPath . '/autoload.php'
)
);
}
spl_autoload_register(function ($class) {