Skip to content

Commit a5c3920

Browse files
pal-softwareProgi1984
authored andcommitted
Samples : Allow to run without composer
1 parent 3b1ab43 commit a5c3920

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/changes/1.1.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- PowerPoint2007 & ODPresentation Writer : Use of the disk caching directory for temporary files - [@nhalle](https://github.com/nhalle) in [#781](https://github.com/PHPOffice/PHPPresentation/pull/781)
3333
- PowerPoint2007 Reader : Fixed reading of RichText shape in Note - [@aelliott1485](https://github.com/aelliott1485) in [#782](https://github.com/PHPOffice/PHPPresentation/pull/782)
3434
- PowerPoint2007 Writer : Fixed broken animation for first shape - [@shannan1989](https://github.com/shannan1989) in [#783](https://github.com/PHPOffice/PHPPresentation/pull/783)
35+
- Samples : Allow to run without composer - [@pal-software](https://github.com/pal-software) in [#784](https://github.com/PHPOffice/PHPPresentation/pull/784)
3536

3637
## Miscellaneous
3738

samples/Sample_Header.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
if (is_file(dirname(__DIR__) . '/vendor/autoload.php')) {
3030
require_once dirname(__DIR__) . '/vendor/autoload.php';
3131
} else {
32-
throw new Exception('Can not find the vendor folder!');
32+
if (is_file(__DIR__ . '/../../Common/src/Common/Autoloader.php')) {
33+
include_once __DIR__ . '/../../Common/src/Common/Autoloader.php';
34+
\PhpOffice\Common\Autoloader::register();
35+
} else {
36+
throw new Exception('Can not find the vendor or the common folder!');
37+
}
3338
}
3439
// do some checks to make sure the outputs are set correctly.
3540
if (false === is_dir(__DIR__ . DIRECTORY_SEPARATOR . 'results')) {

0 commit comments

Comments
 (0)