本文整理汇总了PHP中Mage_Core_Model_Config::getModuleDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Config::getModuleDir方法的具体用法?PHP Mage_Core_Model_Config::getModuleDir怎么用?PHP Mage_Core_Model_Config::getModuleDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Config
的用法示例。
在下文中一共展示了Mage_Core_Model_Config::getModuleDir方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addModuleFolders
/**
* @param array $folders
*
* @return array
*/
private function _addModuleFolders($folders)
{
foreach ($this->_config->getNode('modules')->children() as $name => $module) {
if ($module->active) {
$folders[] = $this->_config->getModuleDir('etc', $name);
}
}
return $folders;
}
示例2: getModuleDir
public function getModuleDir($type, $moduleName)
{
if (strtolower(substr($moduleName, 0, 5)) == 'test_') {
$dir = BP . DS . 'tests' . DS . 'integration' . DS . 'modules' . DS . uc_words($moduleName, DS);
switch ($type) {
case 'etc':
$dir .= DS . 'etc';
break;
case 'controllers':
$dir .= DS . 'controllers';
break;
case 'sql':
$dir .= DS . 'sql';
break;
case 'data':
$dir .= DS . 'data';
break;
case 'locale':
$dir .= DS . 'locale';
break;
}
$dir = str_replace('/', DS, $dir);
return $dir;
} else {
return parent::getModuleDir($type, $moduleName);
}
}
示例3: getViewFile
/**
* Get theme file name, using fallback mechanism
*
* @param string $file
* @param string|null $module
* @return string
*/
public function getViewFile($file, $module = null)
{
$dir = $this->_appConfig->getOptions()->getDesignDir();
$moduleDir = $module ? $this->_appConfig->getModuleDir('view', $module) : '';
$dirs = array();
$themeModel = $this->_theme;
while ($themeModel) {
list($package, $theme) = $this->_getInheritedTheme($themeModel);
$dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/locale/{$this->_locale}";
$dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}";
$themeModel = $themeModel->getParentTheme();
}
$extraDirs = array($this->_appConfig->getOptions()->getJsDir(), Mage::getDesign()->getCustomizationDir());
return $this->_fallback($file, $dirs, $module, array("{$moduleDir}/{$this->_area}/locale/{$this->_locale}", "{$moduleDir}/{$this->_area}"), $extraDirs);
}
示例4: getDirectoryScanner
/**
* Get current directory scanner. Initialize if it was not initialized previously.
*
* @return Zend\Code\Scanner\DirectoryScanner
*/
public function getDirectoryScanner()
{
if (!$this->_directoryScanner) {
$this->_directoryScanner = new Zend\Code\Scanner\DirectoryScanner();
/** @var Mage_Core_Model_Config_Element $module */
foreach ($this->_applicationConfig->getNode('modules')->children() as $moduleName => $module) {
if ($module->is('active')) {
/** Invalid type is specified to retrieve path to module directory. */
$moduleDir = $this->_applicationConfig->getModuleDir('invalid_type', $moduleName);
$directory = $moduleDir . DS . 'Controller' . DS . 'Webapi';
if (is_dir($directory)) {
$this->_directoryScanner->addDirectory($directory);
}
}
}
}
return $this->_directoryScanner;
}
示例5: getSkinFile
/**
* Get skin file name, using fallback mechanism
*
* @param string $file
* @param string|null $module
* @return string
*/
public function getSkinFile($file, $module = null)
{
$dir = $this->_appConfig->getOptions()->getDesignDir();
$moduleDir = $module ? $this->_appConfig->getModuleDir('view', $module) : '';
$defaultSkin = Mage_Core_Model_Design_Package::DEFAULT_SKIN_NAME;
$dirs = array();
$theme = $this->_theme;
$package = $this->_package;
while ($theme) {
$dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$this->_skin}/locale/{$this->_locale}";
$dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$this->_skin}";
if ($this->_skin != $defaultSkin) {
$dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$defaultSkin}/locale/{$this->_locale}";
$dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$defaultSkin}";
}
list($package, $theme) = $this->_getInheritedTheme($package, $theme);
}
return $this->_fallback($file, $dirs, $module, array("{$moduleDir}/{$this->_area}/locale/{$this->_locale}", "{$moduleDir}/{$this->_area}"), array($this->_appConfig->getOptions()->getJsDir()));
}
示例6: getSchemaFile
/**
* Path to menu.xsd
*
* @return string
*/
public function getSchemaFile()
{
return $this->_config->getModuleDir('etc', 'Mage_Backend') . DIRECTORY_SEPARATOR . 'menu.xsd';
}
示例7: getPerFileSchemaFile
/**
* Get absolute path to the XML-schema file
*
* @return string
*/
public function getPerFileSchemaFile()
{
return $this->_config->getModuleDir('etc', 'Mage_Backend') . DIRECTORY_SEPARATOR . 'system_file.xsd';
}