本文整理汇总了PHP中FileSet::setIncludes方法的典型用法代码示例。如果您正苦于以下问题:PHP FileSet::setIncludes方法的具体用法?PHP FileSet::setIncludes怎么用?PHP FileSet::setIncludes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSet
的用法示例。
在下文中一共展示了FileSet::setIncludes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: schemaConfiguration
protected function schemaConfiguration(Task $task)
{
// Adds schema(s) to task
foreach ($this->schemas as $pair) {
$fileSet = new FileSet();
$fileSet->setDir($pair[0]);
$fileSet->setIncludes($pair[1]);
$task->addSchemaFileset($fileSet);
}
// Sets up output dir, for class, SQL or conf output
$task->setOutputDirectory(new PhingFile($this->outputDir));
}
示例2: main
/**
* Reads the corresponding actions and templates of the cronk (if any) from cronk.xml
* and creates two references "cronkTemplate" and "cronkAction" which can be used to access these files
*/
public function main()
{
$templates = array();
$actionPath = "";
$action = null;
$module = null;
$cronkName = $this->project->getUserProperty("cronkName");
// Setup and load the DOM of the cronk
$DOM = new DOMDocument("1.0", "UTF-8");
$DOM->load($this->getFile());
$DOMSearcher = new DOMXPath($DOM);
$DOMSearcher->registerNamespace("default", "http://agavi.org/agavi/1.0/config");
$DOMSearcher->registerNamespace("ae", "http://agavi.org/agavi/config/global/envelope/1.0");
$cronkTemplates = $DOMSearcher->query("//ae:parameter[@name='" . $cronkName . "']//ae:parameter[@name='template']");
if ($cronkTemplates->length > 0) {
foreach ($cronkTemplates as $template) {
$templates[] = $template->nodeValue;
}
}
// fetch action and module
$action = $DOMSearcher->query("//ae:parameter[@name='" . $cronkName . "']//ae:parameter[@name='action']")->item(0);
$module = $DOMSearcher->query("//ae:parameter[@name='" . $cronkName . "']//ae:parameter[@name='module']")->item(0);
$actionName = str_replace(".", "/", $action->nodeValue);
// add agavi action,validation, view and templates
$cronkFS = new FileSet();
$cronkFS->setDir($this->project->getUserProperty("PATH_Icinga") . "/app/modules/" . $module->nodeValue);
$cronkIncludes = "actions/" . $actionName . "Action.class.php";
$cronkIncludes .= ",templates/" . $actionName . "*.class.php";
$cronkIncludes .= ",validate/" . $actionName . ".xml";
$cronkIncludes .= ",views/" . $actionName . "*.class.php";
$cronkFS->setIncludes($cronkIncludes);
// add templates
$templateFs = new FileSet();
$templateFs->setDir($this->project->getUserProperty("PATH_Icinga") . "/app/modules/Cronks/data/xml/");
$includes = "";
$first = true;
foreach ($templates as $template) {
$includes .= ($first ? '' : ',') . $template . ".xml";
}
// export to phing
$templateFs->setIncludes($includes);
$this->project->addReference("cronkTemplates", $templateFs);
$this->project->addReference("cronkAction", $cronkFS);
}
示例3: setIncludes
/**
* Sets the set of include patterns. Patterns may be separated by a comma
* or a space.
*
* @param string $includes the string containing the include patterns
* @return void
*/
public function setIncludes($includes)
{
$this->fileset->setIncludes($includes);
}
示例4: getSQLDescriptors
/**
* Returns a file descriptior with the sql files
* @return FileSet
*/
protected function getSQLDescriptors()
{
$xml = $this->getManifest()->getManifestAsSimpleXML();
$db = $xml->Database;
$sqlList = new FileSet();
$sqlList->setDir($this->project->getUserProperty("PATH_Icinga"));
$includes = null;
if (!$db->SQLRoutines) {
$sqlList->setExcludes("**");
}
return $sqlList;
foreach ($db->SQLRoutines->children() as $type => $content) {
$type = (string) $type;
$content = $this->getPath((string) $content);
switch ($type) {
case 'File':
if ($includes != "") {
$includes .= ",";
}
$includes .= $content;
break;
case 'Folder':
if ($includes != "") {
$includes .= ",";
}
$includes .= $content . "/**";
break;
}
}
$sqlList->setIncludes($includes);
return $sqlList;
}