mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
commit
e045ffeb29
@ -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')
|
||||||
|
@ -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()));
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
class Ignore extends ClassC { }
|
Loading…
x
Reference in New Issue
Block a user