Skip to content

Commit

Permalink
PHPOffice#123 : Support for Video (Fix PHPUnit tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Mar 31, 2016
1 parent 0a4c6c1 commit 8381601
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/PhpPresentation/Writer/ODPresentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,26 @@ public function save($pFilename)
$oPresentation = $this->getPhpPresentation();
$arrayChart = array();

$arrayFiles = array();
$oDir = new DirectoryIterator(dirname(__FILE__).DIRECTORY_SEPARATOR.'ODPresentation');
foreach ($oDir as $oFile) {
if (!$oFile->isFile()) {
continue;
}
$class = __NAMESPACE__.'\\ODPresentation\\'.$oFile->getBasename('.php');

$class = __NAMESPACE__ . '\\ODPresentation\\' . $oFile->getBasename('.php');
$o = new \ReflectionClass($class);

if ($o->isAbstract() || !$o->isSubclassOf('PhpOffice\PhpPresentation\Writer\ODPresentation\AbstractDecoratorWriter')) {
continue;
}
echo "\n".dirname(__FILE__).DIRECTORY_SEPARATOR.'ODPresentation'."/".$oFile->getBasename('.php')."\n";
$arrayFiles[$oFile->getBasename('.php')] = $o;
}

ksort($arrayFiles);

foreach ($arrayFiles as $basename => $o) {
echo "\n".dirname(__FILE__).DIRECTORY_SEPARATOR.'ODPresentation'."/".$basename."\n";
$oService = $o->newInstance();
$oService->setZip($oZip);
$oService->setPresentation($oPresentation);
Expand Down

0 comments on commit 8381601

Please sign in to comment.