/** * Build analysed file tree according to standard rules * * @return array Recursive file array (tree) */ function getFilesTree() { $extensions = array("php"); $root_dir = CAppUI::conf("root_dir"); $standard = $this->getStandardDir(); $this->populateCustomRules($standard); return CMbPath::getPathTreeUnder($root_dir, array_keys($this->ignorePatterns), $extensions); }
public function testGetPathThreeUnderHasRightReturn() { $this->assertNull($this->stub->getPathTreeUnder("php", array(), array())); $this->assertTrue($this->stub->getPathTreeUnder("test")); $extensions = array("php"); $ignored = array("classes/", "/preferences.php"); mkdir(__DIR__ . "/test"); mkdir(__DIR__ . "/test/test1"); touch(__DIR__ . "/test/file1"); touch(__DIR__ . "/test/test1/file2"); $arr1 = array("test1" => array("file2" => true), "file1" => true); $arr2 = $this->stub->getPathTreeUnder(__DIR__ . "/test"); $this->assertEquals($arr1, $arr2); $arr2 = $this->stub->getPathTreeUnder(__DIR__ . "/test", $ignored, $extensions); @unlink(__DIR__ . "/test/test1/file2"); @unlink(__DIR__ . "/test/file1"); @rmdir(__DIR__ . "/test/test1"); @rmdir(__DIR__ . "/test"); }
<?php /** * $Id$ * * @package Mediboard * @subpackage developpement * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); $root_dir = CAppUI::conf("root_dir"); $extensions = array("php"); $ignored = array("classes/", "locales/", "controllers/", "shell/", "/index.php", "/setup.php", "/config.php", "/configuration.php", "/preferences.php"); $views = CMbPath::getPathTreeUnder("{$root_dir}/modules", $ignored, $extensions); $count = CMbArray::countLeafs($views); // Création du template $smarty = new CSmartyDP(); $smarty->assign("views", $views); $smarty->assign("count", $count); $smarty->display("regression_checker.tpl");