ENHANCEMENT Excluding _images folders automatically

This commit is contained in:
Ingo Schommer 2010-08-01 04:46:26 +00:00
parent 8f2a9375b9
commit c61635be80
2 changed files with 17 additions and 5 deletions

View File

@ -31,7 +31,7 @@ class DocumentationService {
*
* @var Array
*/
private static $ignored_files = array('.', '..', '.DS_Store', '.svn', '.git', 'assets', 'themes');
private static $ignored_files = array('.', '..', '.DS_Store', '.svn', '.git', 'assets', 'themes', '_images');
/**
* Set the ignored files list
@ -227,12 +227,9 @@ class DocumentationService {
* @return DocumentationEntity $module the registered module
*/
public static function is_registered_module($module, $version = false, $lang = false) {
if(isset(self::$registered_modules[$module])) {
$module = self::$registered_modules[$module];
if($lang && !$module->hasLanguage($lang)) return false;
if($version && !$module->hasVersion($version)) return false;
return $module;
@ -257,7 +254,7 @@ class DocumentationService {
if(!isset(self::$registered_modules[$module])) {
// module is completely new
$entity = new DocumentationEntity($module, $version, $path, $title);
self::$registered_modules[$module] = $entity;
}
else {

View File

@ -0,0 +1,15 @@
<?php
/**
* @package sapphiredocs
*/
class DocumentationParserTest extends SapphireTest {
function testGetPagesFromFolder() {
$pages = DocumentationParser::get_pages_from_folder(BASE_PATH . '/sapphiredocs/tests/docs/en/');
$this->assertContains('index', $pages->column('Filename'), 'Index');
$this->assertContains('subfolder', $pages->column('Filename'), 'Foldername');
$this->assertContains('test', $pages->column('Filename'), 'Filename');
$this->assertNotContains('_images', $pages->column('Filename'), 'Ignored files');
}
}