Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8796be3

Browse files
committed
phpDocumentor#530: target was not correctly converted to an absolute path in transform command
The transform command was not refactored yet to deal with the phar packaging. This has been adapted and now it works like a charm. Also the file selection process has changed and only 50% of the previously selected files are now included and the size has dropped to 7mb instead of 15
1 parent c4412e6 commit 8796be3

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

src/phpDocumentor/Command/Project/TransformCommand.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
112112
$transformer->setTemplatesPath(
113113
__DIR__.'/../../../../data/templates'
114114
);
115-
$transformer->setTarget(
116-
$this->getOption($input, 'target', 'transformer/target')
117-
);
115+
116+
$target = $this->getOption($input, 'target', 'transformer/target');
117+
if (!$this->isAbsolute($target)) {
118+
$target = getcwd().DIRECTORY_SEPARATOR.$target;
119+
}
120+
$transformer->setTarget($target);
118121

119122
$source = $this->getOption($input, 'source', 'parser/target');
120123
if (file_exists($source) and is_dir($source)) {
121124
$source .= DIRECTORY_SEPARATOR . 'structure.xml';
122125
}
123-
$transformer->setSource($source);
126+
$transformer->setSource(realpath($source));
124127

125128
$transformer->setTemplates(
126129
(array)$this->getOption(

src/phpDocumentor/PharCompiler.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function compile($pharFile = 'phpDocumentor.phar')
5353

5454
echo '>> Finished creating phar archive' . PHP_EOL;
5555

56-
// $phar->compressFiles(\Phar::GZ);
56+
// $phar->compressFiles(\Phar::GZ);
5757

5858
unset($phar);
5959
}
@@ -114,7 +114,25 @@ protected function getFiles()
114114
$finder = new Finder();
115115
$iterator = $finder->files()
116116
->in(array('bin', 'data', 'src', 'vendor'))
117-
->exclude(array('data/output'));
117+
->notName('*.rst')
118+
->notName('*.md')
119+
->exclude(
120+
array(
121+
'output',
122+
'behat',
123+
'cilex/cilex/tests',
124+
'dflydev/markdown/tests',
125+
'nikic/php-parser/doc',
126+
'nikic/php-parser/test',
127+
'nikic/php-parser/test_old',
128+
'phpdocumentor/fileset/tests',
129+
'phpdocumentor/graphviz/tests',
130+
'phpdocumentor/plugin-twig/tests',
131+
'phpdocumentor/reflection-docblock/tests',
132+
'pimple/pimple/tests',
133+
'twig/twig/test',
134+
)
135+
);
118136

119137
return array_merge($files, iterator_to_array($iterator));
120138
}

0 commit comments

Comments
 (0)