当前位置: 首页>>代码示例>>PHP>>正文


PHP XmlParser::getPluginDirs方法代码示例

本文整理汇总了PHP中XmlParser::getPluginDirs方法的典型用法代码示例。如果您正苦于以下问题:PHP XmlParser::getPluginDirs方法的具体用法?PHP XmlParser::getPluginDirs怎么用?PHP XmlParser::getPluginDirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlParser的用法示例。


在下文中一共展示了XmlParser::getPluginDirs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Displays the list of existing job queues.
  * 
  * @param   array   $arguments    (optional)
  * @param   array   $options      (optional)
  */
 public function execute($arguments = array(), $options = array())
 {
     if ($arguments["src"] === "none") {
         $arguments["src"] = null;
     }
     if ($arguments["reporting"] != "full" && $arguments["reporting"] != "incremental" && $arguments["reporting"] != "cache" && $arguments["reporting"] != "file") {
         throw new Exception("Invalid value for argument: reporting. The value 'incremental', 'cache', 'file' or 'full' are expected, but '" . $arguments["reporting"] . "' is given!");
     } else {
         if ($arguments["rebuild"] != "yes" && $arguments["rebuild"] != "no") {
             throw new Exception("Invalid value for argument: rebuild. The value 'yes' or 'no' are expected, but '" . $arguments["rebuild"] . "' is given!");
         } else {
             if ($arguments["src"] != null && (!file_exists($arguments["src"]) || !is_readable($arguments["src"]))) {
                 throw new Exception("Invalid value for argument: src. The file '" . $arguments["src"] . "' doesn't exist or is not readable!");
             }
         }
     }
     $project = ProjectConfiguration::getActive();
     $this->basedir = $project->getRootDir();
     // Add plugin dirs..
     $this->dirs = XmlParser::getPluginDirs($this->basedir . "/plugins");
     // DB
     $this->dbmanager = new sfDatabaseManager($this->configuration);
     // XML Validator
     $this->validator = new XmlValidator(null, false, true, $arguments["reporting"] == "cache");
     // Truncating cache
     if ($arguments["rebuild"] == "yes") {
         afValidatorCachePeer::clearCache();
     }
     if ($arguments["log"] !== null) {
         $this->log = $arguments["log"];
     }
     $this->args = $arguments;
     $this->logSection("\nXML Config validation is starting.. (this may take a while)\n" . "Validation type: " . $arguments["reporting"] . "                                      \n" . "Will flush cache: " . $arguments["rebuild"] . "                                       ", null, null, "ERROR");
     if ($arguments["reporting"] != "file" && $arguments["src"] == null) {
         foreach ($this->dirs as $dir) {
             $scan = substr($dir, 0, 1) == "/" ? $dir : $this->basedir . "/apps/" . $arguments['application'] . "/" . $dir;
             $this->readConfigs($scan);
         }
     } else {
         $this->validator->readXmlDocument($arguments["src"], true);
         $result = $this->validator->validateXmlDocument(true);
         $this->logSection($result[1] === null ? "valid: " : "error: ", $arguments["src"], null, $result[0]);
         if ($result[1]) {
             echo Util::arrayToString(array("file" => $tmp, "message" => $result[1]->getMessage()));
             return true;
         }
     }
     if ($arguments["reporting"] == "full") {
         $this->printTotal();
     }
     return 0;
 }
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:58,代码来源:afValidatorCacheTask.class.php


注:本文中的XmlParser::getPluginDirs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。