Merge pull request #205 from AngryPHPNerd/sapphire

---

In SS-2.4 you can prefix files with an underscore to exclude them from manifest this can be useful for backups of old classes or huge data files.

I think this behaviour should be readded.

(I will add a unit test for this ...)
This commit is contained in:
Ingo Schommer 2012-04-11 17:32:34 +02:00
commit e045ffeb29
3 changed files with 23 additions and 15 deletions

View File

@ -276,7 +276,7 @@ class SS_ClassManifest {
$finder = new ManifestFileFinder(); $finder = new ManifestFileFinder();
$finder->setOptions(array( $finder->setOptions(array(
'name_regex' => '/\.php$/', 'name_regex' => '/^(_config.php|[^_].*\.php)$/',
'ignore_files' => array('index.php', 'main.php', 'cli-script.php'), 'ignore_files' => array('index.php', 'main.php', 'cli-script.php'),
'ignore_tests' => !$this->tests, 'ignore_tests' => !$this->tests,
'file_callback' => array($this, 'handleFile') 'file_callback' => array($this, 'handleFile')

View File

@ -117,4 +117,7 @@ class ClassManifestTest extends SapphireTest {
$this->assertContains('testclassa', array_keys($this->manifestTests->getClasses())); $this->assertContains('testclassa', array_keys($this->manifestTests->getClasses()));
} }
public function testManifestExcludeFilesPrefixedWithUnderscore() {
$this->assertNotContains('ignore', array_keys($this->manifest->getClasses()));
}
} }

View File

@ -0,0 +1,5 @@
<?php
/**
* @ignore
*/
class Ignore extends ClassC { }