Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added 'trusting' mode to skip mime type test as workaround for libmag…

…ic/file info bug
  • Loading branch information...
commit 09e2bbf72ca6617b29ba8fd835edd5a1899115e1 1 parent f39fa5b
@theseer authored
View
14 package.xml
@@ -17,10 +17,10 @@
<email>arne@blankerts.de</email>
<active>yes</active>
</lead>
- <date>2012-03-18</date>
+ <date>2012-06-12</date>
<version>
- <release>1.8.0</release>
- <api>1.8.0</api>
+ <release>1.9.0</release>
+ <api>1.9.0</api>
</version>
<stability>
<release>stable</release>
@@ -46,18 +46,18 @@
<file baseinstalldir="/" name="staticphar.php.tpl" role="php" />
<file baseinstalldir="/" name="static.php.tpl" role="php" />
</dir>
- <file baseinstalldir="/" name="cli.php" role="php">
- <tasks:replace from="%version%" to="version" type="package-info" />
- </file>
+ <file baseinstalldir="/" name="cli.php" role="php" />
<file baseinstalldir="/" name="autoloadbuilder.php" role="php" />
<file baseinstalldir="/" name="classfinder.php" role="php" />
<file baseinstalldir="/" name="dependencysorter.php" role="php" />
<file baseinstalldir="/" name="staticbuilder.php" role="php" />
+ <file baseinstalldir="/" name="autoload.php" role="php" />
</dir>
</dir>
<file baseinstalldir="/" name="phpab.php" role="script">
<tasks:replace from="/usr/bin/env php" to="php_bin" type="pear-config"/>
<tasks:replace from="@php_bin@" to="php_bin" type="pear-config" />
+ <tasks:replace from="%development%" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="phpab.bat" role="script">
<tasks:replace from="@php_bin@" to="php_bin" type="pear-config" />
@@ -71,7 +71,7 @@
<min>5.3.0</min>
</php>
<pearinstaller>
- <min>1.8.1</min>
+ <min>1.8.0</min>
</pearinstaller>
<package>
<name>DirectoryScanner</name>
View
7 src/classfinder.php
@@ -478,13 +478,14 @@ protected function canTolerateRedeclaration($redeclaredClassName, $redeclaredInF
/**
* Process multiple files and parse them for classes and interfaces
*
- * @param Iterator $sources Iterator based list of files (SplFileObject) to parse
+ * @param \TheSeer\Autoload\Iterator $sources Iterator based list of files (SplFileObject) to parse
+ * @param bool $mimeCheck Enable or disable mimetype check on files
*
* @return integer
*/
- public function parseMulti(\Iterator $sources) {
+ public function parseMulti(\Iterator $sources, $mimeCheck = true) {
$count = 0;
- $worker = new PHPFilterIterator($sources);
+ $worker = $mimeCheck ? new PHPFilterIterator($sources) : $sources;
foreach($worker as $file) {
$this->parseFile($file->getPathname());
}
View
9 src/cli.php
@@ -144,6 +144,11 @@ public function run() {
'Ignore Class Redeclarations in the same file'
));
+ $input->registerOption( new \ezcConsoleOption(
+ '', 'trusting', \ezcConsoleInput::TYPE_NONE, null, false,
+ 'Do not check mimetype of files prior to parsing'
+ ));
+
$onceOption = $input->registerOption( new \ezcConsoleOption(
'', 'once', \ezcConsoleInput::TYPE_NONE, null, false,
'Use require_once in static require mode',
@@ -207,7 +212,7 @@ public function run() {
$input->getOption('tolerant')->value,
$input->getOption('nolower')->value
);
- $found = $finder->parseMulti($scanner);
+ $found = $finder->parseMulti($scanner, !$input->getOption('trusting')->value);
// this unset is needed to "fix" a segfault on shutdown
unset($scanner);
if ($found==0) {
@@ -502,6 +507,8 @@ protected function showUsage() {
--all Include all files in given directory when creating a phar
+ --trusting Do not check mimetype of files prior to parsing
+
--var name=foo Assign value 'foo' to variable 'name' to be used in (custom) templates
--lint Run lint on generated code and exit
View
2  tests/classfinder.test.php
@@ -327,7 +327,7 @@ public function testParseMultipleFiles() {
new \SplFileObject(__DIR__.'/_data/classfinder/namespace1.php')
);
$finder = new \TheSeer\Autoload\ClassFinder;
- $rc = $finder->parseMulti(new \ArrayIterator($list));
+ $rc = $finder->parseMulti(new \ArrayIterator($list), false);
$this->assertEquals(3,$rc);
$classes = $finder->getMerged();
$this->assertArrayHasKey('demo1', $classes);
Please sign in to comment.
Something went wrong with that request. Please try again.