本文整理汇总了PHP中Fox::getExtensionDirectoryPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Fox::getExtensionDirectoryPath方法的具体用法?PHP Fox::getExtensionDirectoryPath怎么用?PHP Fox::getExtensionDirectoryPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fox
的用法示例。
在下文中一共展示了Fox::getExtensionDirectoryPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: traverseDirFiles
/**
* Traverses Files and Directories inside given path Recursively
* @param $path to traverse
*/
public function traverseDirFiles($path)
{
$dir = opendir($path);
$files = array();
$f = array();
$skip = array(Fox::getDirectoryPath() . DS . "var", Fox::getDirectoryPath() . DS . "library" . DS . "Zend", Fox::getExtensionDirectoryPath(), Fox::getDirectoryPath() . DS . "theme" . DS . "installer", APPLICATION_PATH . DS . "views" . DS . "installer");
while ($ft = readdir($dir)) {
if (in_array($ft, array(".", "..")) || in_array($path . DS . $ft, $skip)) {
continue;
}
$f[] = $ft;
}
sort($f);
foreach ($f as $file) {
if (filetype($path . DS . $file) != "dir") {
$files[] = $file;
} else {
$this->traverseDirFiles($path . DS . $file);
}
}
foreach ($files as $f) {
$this->processFiles($path, $f);
}
closedir($dir);
}
示例2: getInstalledPkgPath
/**
* Get Installed package directory path
*
* @return string
*/
public function getInstalledPkgPath()
{
return Fox::getExtensionDirectoryPath() . DS . $this->getDownloaderDir() . DS . $this->config->downloader->installed_dir;
}
示例3: getSiteXml
/**
* Get Xml of site directories/files
*
* @param bool $cache if true gets xml from cache otherwise regenerates
* @return string xml string
*/
public function getSiteXml($cache = true)
{
$xml = '';
$conf = $this->getConfig()->getConfiguration();
$cachePath = Fox::getExtensionDirectoryPath() . DS . $conf->extensionmanager->dir_name . DS . $conf->extensionmanager->cache;
if (!file_exists($cachePath)) {
@mkdir($cachePath, 0777, true);
}
$fileName = $cachePath . DS . $conf->extensionmanager->cache_file;
if ($cache && file_exists($fileName)) {
$xml = file_get_contents($fileName);
} else {
$path = Fox::getDirectoryPath();
$Obj = new Fox_Extensionmanager_Model_Generate_DirectoryToXml($path);
$Obj->traverseDirFiles($path);
$Obj->setArray($Obj->arr);
if (!($xml = $Obj->saveArrayToXml())) {
throw new Exception("Unable to load content tree data.");
}
$dom = $Obj->getXMLDom();
$dom->save($fileName);
@chmod($fileName, 0777);
}
return trim(preg_replace('/<\\?xml.*\\?>/', '', $xml, 1));
}