本文整理汇总了PHP中CMbArray::countLeafs方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbArray::countLeafs方法的具体用法?PHP CMbArray::countLeafs怎么用?PHP CMbArray::countLeafs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbArray
的用法示例。
在下文中一共展示了CMbArray::countLeafs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage developpement
* @author SARL OpenXtrem <dev@openxtrem.com>
* @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");
示例2: testCountLeafs
public function testCountLeafs()
{
$this->assertEquals(1, $this->stub->countLeafs(null));
$this->assertEquals(3, $this->stub->countLeafs(array("val", array("val2", array("val3")))));
}
示例3: CMbCodeSniffer
*
* @package Mediboard
* @subpackage developpement
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkRead();
if (!class_exists("CMbCodeSniffer")) {
CAppUI::stepMessage(UI_MSG_WARNING, "CMbCodeSniffer-error-PEAR_needed");
return;
}
$sniffer = new CMbCodeSniffer();
$files = $sniffer->getFilesTree();
//unset($files["modules"]);
$count = CMbArray::countLeafs($files);
$reports = $sniffer->checkReports($files);
$stats = $sniffer->buildStats($files);
$types = $stats["-root-"];
$existing_reports = $reports;
CMbArray::removeValue("none", $existing_reports);
$existing_count = count($existing_reports);
// Cuz sniffer changes work dir but restores it at destruction
// Be aware that unset() won't call __destruct() anyhow
$sniffer->__destruct();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("files", $files);
$smarty->assign("count", $count);
$smarty->assign("types", $types);
$smarty->assign("reports", $reports);