本文整理汇总了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;
}