当前位置: 首页>>代码示例>>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;未经允许,请勿转载。