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


PHP Director::getConfigPath方法代码示例

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


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

示例1: initialize

 public function initialize()
 {
     // check if user is logged in
     $authentication = Authentication::getInstance();
     $request = Request::getInstance();
     if ($authentication->isLogin() && !$authentication->isRole(SystemUser::ROLE_BACKEND)) {
         $this->log->info("Failed access for " . $authentication->getUserName() . " (not enough privileges for admin section) from " . $request->getValue('REMOTE_ADDR', Request::SERVER));
         throw new Exception('Access denied');
     }
     // check if admin section is restricted by ip-addresses
     $ip_allow = $this->director->getConfig()->admin_section_ip_allow;
     if ($ip_allow) {
         $ips = explode(",", $ip_allow);
         if (!in_array($request->getValue('REMOTE_ADDR', Request::SERVER), $ips)) {
             $this->log->info("Failed access for " . $authentication->getUserName() . " (ip not in list for admin access) from " . $request->getValue('REMOTE_ADDR', Request::SERVER));
             throw new Exception('Access denied');
         }
     }
     // create tree object
     $treefile = Director::getConfigPath() . $this->director->getConfig()->admin_menu;
     $useLogin = $this->director->getConfig()->dsn;
     $this->tree = new AdminTree($treefile, $useLogin);
     $this->tree->setPrefix($this->urlPrefix);
     // check if path is set. is not, get the startpage path
     $path = $request->getPath();
     $currentId = $this->tree->isSiteRoot() ? $this->tree->getStartNodeId() : $this->tree->getIdFromPath($path);
     // current id does not exist. try to search login pages
     if (!$currentId && $this->tree->pathExists($path)) {
         $this->tree->setCurrentIdExists($this->tree->getIdFromPath($path, Tree::TREE_ORIGINAL));
     }
     $this->tree->setCurrentId($currentId);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:32,代码来源:AdminManager.php

示例2: handlePostDelete

 /**
  * handle post delete functions
  * this function removes the extension files
  *
  * @param array filtered values for insertion
  * @return void
  * @see DbConnector::handlePostDelete
  */
 protected function handlePostDelete($id, $values)
 {
     $className = $values['classname'];
     $configFile = Director::getConfigPath() . strtolower($className) . ".ini";
     if (file_exists($configFile)) {
         unlink($configFile);
     }
     $extensionPath = $this->getExtensionPath($className);
     Utils::removeRecursive($extensionPath);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:18,代码来源:ExtensionManager.php


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