當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Setting::getApplicationPath方法代碼示例

本文整理匯總了PHP中Setting::getApplicationPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Setting::getApplicationPath方法的具體用法?PHP Setting::getApplicationPath怎麽用?PHP Setting::getApplicationPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Setting的用法示例。


在下文中一共展示了Setting::getApplicationPath方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: load

 public function load($module)
 {
     $m = explode(".", $module);
     if (count($m) == 2 && $m[1] != '') {
         $name = lcfirst($m[1]);
         $class = ucfirst($name) . "Module";
         $basePath = $m[0] == "app" ? Setting::getAppPath() : Setting::getApplicationPath();
         $alias = ($m[0] == "app" ? 'app' : 'application') . ".modules.{$name}.{$class}";
         $path = $basePath . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $name;
         $classPath = $path . DIRECTORY_SEPARATOR . $class . ".php";
         $this->name = $name;
         $this->alias = $alias;
         $this->path = $path;
         $this->classPath = $classPath;
         if (is_file($this->classPath)) {
             $this->module = ModuleGenerator::init($alias, 'load');
             $this->accessType = $this->module->checkAccessType();
             $this->defaultRule = $this->module->defaultRule;
             $this->rolesRule = $this->module->rolesRule;
             $this->usersRule = $this->module->usersRule;
             $this->acSource = $this->module->acSource;
             $this->imports = $this->module->loadImport();
         } else {
             $this->module = null;
         }
     }
 }
開發者ID:reggi49,項目名稱:plansys,代碼行數:27,代碼來源:DevGenModule.php

示例2: getConfigPath

 public static function getConfigPath()
 {
     return Setting::getApplicationPath() . DIRECTORY_SEPARATOR . "config";
 }
開發者ID:balitax,項目名稱:plansys,代碼行數:4,代碼來源:Setting.php

示例3: parseModule

 public static function parseModule($module)
 {
     $m = explode(".", $module);
     if (count($m) == 2 && $m[1] != '') {
         $name = lcfirst($m[1]);
         $class = ucfirst($name) . "Module";
         $basePath = $m[0] == "app" ? Setting::getAppPath() : Setting::getApplicationPath();
         $alias = ($m[0] == "app" ? 'app' : 'application') . ".modules.{$name}.{$class}";
         $path = $basePath . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $name;
         $classPath = $path . DIRECTORY_SEPARATOR . $class . ".php";
         if (!Helper::isValidVar($class)) {
             return [];
         }
         return ['name' => $name, 'class' => $class, 'alias' => $alias, 'path' => $path, 'classPath' => $classPath];
     }
     return [];
 }
開發者ID:reggi49,項目名稱:plansys,代碼行數:17,代碼來源:ModuleGenerator.php

示例4: createIndexFile

 public static function createIndexFile($mode = "install")
 {
     $path = Setting::getApplicationPath() . DIRECTORY_SEPARATOR . "index.php";
     $file = file_get_contents($path);
     $file = str_replace(['$mode = "init"', '$mode = "install"', '$mode = "running"'], '$mode = "' . $mode . '"', $file);
     Setting::$mode = $mode;
     if (!is_file($path)) {
         return @file_put_contents(Setting::getRootPath() . DIRECTORY_SEPARATOR . "index.php", $file);
     } else {
         $oldpath = Setting::getRootPath() . DIRECTORY_SEPARATOR . "index.php";
         $oldfile = @file_get_contents($oldpath);
         if ($oldfile != $file) {
             return @file_put_contents($oldpath, $file);
         } else {
             return true;
         }
     }
 }
開發者ID:reggi49,項目名稱:plansys,代碼行數:18,代碼來源:Installer.php

示例5: InstallModule

<?php

if (Setting::$mode == "init" || Setting::$mode == "install") {
    Yii::import("application.modules.install.*");
    Yii::import("application.modules.install.controllers.*");
    $module = new InstallModule("install", null);
    $controller = new DefaultController("default", $module);
    $controller->action = $controller->createAction("index");
    $msg = @$data['message'];
    if (strpos(@$data['message'], 'Application Runtime Path') === 0) {
        $msg = null;
    }
    $controller->action->runWithParams(['msg' => $msg]);
} else {
    Yii::import("application.controllers.*");
    $controller = new SiteController("site");
    $controller->action = $controller->createAction("error");
    $controller->action->run();
    if (!@$_GET['rendered']) {
        include Setting::getApplicationPath() . DIRECTORY_SEPARATOR . "framework" . DIRECTORY_SEPARATOR . "views" . DIRECTORY_SEPARATOR . "exception.php";
    }
}
開發者ID:reggi49,項目名稱:plansys,代碼行數:22,代碼來源:exception.php


注:本文中的Setting::getApplicationPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。