Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems accessing files #429

Merged
merged 7 commits into from
Dec 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions samples/Sample_Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@
require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php';
Autoloader::register();

require_once __DIR__ . '/../vendor/autoload.php';
if (is_file(__DIR__. '/../../../../vendor/autoload.php')) {
require_once __DIR__ . '/../../../../vendor/autoload.php';
} else {
throw new Exception ('Can not find the vendor folder!');
}
// do some checks to make sure the outputs are set correctly.
if (is_dir(__DIR__.DIRECTORY_SEPARATOR.'results') === FALSE) {
throw new Exception ('The results folder is not present!');
}
if (is_writable(__DIR__.DIRECTORY_SEPARATOR.'results'.DIRECTORY_SEPARATOR) === FALSE) {
throw new Exception ('The results folder is not writable!');
}
if (is_writable(__DIR__.DIRECTORY_SEPARATOR) === FALSE) {
throw new Exception ('The samples folder is not writable!');
}

// Set writers
$writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp');
Expand Down Expand Up @@ -490,4 +504,4 @@ protected function getConstantName($class, $search, $startWith = '') {
</div>
</div>
</div>
<?php echo $pageHeading; ?>
<?php echo $pageHeading;