本文整理汇总了PHP中Setting::getRootPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getRootPath方法的具体用法?PHP Setting::getRootPath怎么用?PHP Setting::getRootPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::getRootPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerCSS
public static function registerCSS($includeCSS)
{
if (is_string($includeCSS)) {
$includeCSS = [$includeCSS];
}
if (!empty($includeCSS)) {
foreach ($includeCSS as $css) {
$path = Asset::resolveAlias($css);
if (is_file($path . ".css")) {
$file = $path . ".css";
if (strpos($file, Setting::getRootPath()) === 0) {
$file = substr($file, strlen(Setting::getRootPath()));
$file = Yii::app()->baseUrl . $file;
}
Yii::app()->clientScript->registerCssFile($file);
continue;
}
$csspath = realpath($path);
if (is_dir($csspath)) {
$path = Asset::publish($csspath);
$files = glob($csspath . "/*");
foreach ($files as $p) {
if (pathinfo($p, PATHINFO_EXTENSION) != "css") {
continue;
}
$p = str_replace($csspath, '', realpath($p));
Yii::app()->clientScript->registerCssFile($path . str_replace("\\", "/", $p));
}
} else {
if (is_file($csspath)) {
Yii::app()->clientScript->registerCssFile(Asset::publish($csspath));
}
}
}
}
}
示例2: getAssetPath
public static function getAssetPath()
{
return Setting::getRootPath() . DIRECTORY_SEPARATOR . "assets";
}
示例3:
";
$scope.modelBaseClass = "<?php
echo ActiveRecord::baseClass($this->model);
?>
";
$scope.lastModified = "<?php
echo Helper::getLastModified($modelClass);
?>
";
$scope.date = date;
$scope.strtotime = strtotime;
$scope.angular = angular;
if (window.plansys) {
window.plansys.rootPath = "<?php
echo Setting::getRootPath();
?>
";
window.plansys.baseUrl = "<?php
echo Yii::app()->baseUrl;
?>
";
}
// Process Relation Error Message
for (i in $scope.errors) {
if ($scope.errors[i].length > 0 && angular.isObject($scope.errors[i][0])) {
var err = [];
var error = $scope.errors[i][0];
if (!error.type || !error.list) continue;
示例4: init
public static function init($config)
{
## we hare to make sure the error page is shown
## so we need to strip yii unneeded config to make sure it is running
$config['defaultController'] = "install";
$config['components']['errorHandler'] = ['errorAction' => 'install/default/index'];
Installer::checkInstall();
if (Setting::$mode == "init") {
$url = preg_replace('/\\/?plansys\\/?$/', '', Setting::fullPath());
if (is_file(Setting::getRootPath() . DIRECTORY_SEPARATOR . "index.php")) {
header("Location: " . $url . "/index.php");
die;
}
if (!Installer::createIndexFile()) {
Setting::redirError("Failed to write in \"{path}\" <br/> Permission denied", ['{path}' => Setting::getRootPath() . DIRECTORY_SEPARATOR . "index.php"]);
return $config;
} else {
header("Location: " . $url . "/index.php?r=install/default/index");
die;
}
}
return $config;
}
示例5:
";
$scope.lastModified = "<?php
echo Helper::getLastModified($modelClass);
?>
";
$scope.date = date;
$scope.strtotime = strtotime;
$scope.angular = angular;
if (window.plansys) {
window.plansys.rootPath = "<?php
echo Setting::getRootPath();
?>
";
window.plansys.repoPath = "<?php
echo Setting::getRootPath() . DIRECTORY_SEPARATOR . Setting::get('repo.path');
?>
";
window.plansys.baseUrl = "<?php
echo Yii::app()->baseUrl;
?>
";
}
// Process Relation Error Message
for (i in $scope.errors) {
if ($scope.errors[i].length > 0 && angular.isObject($scope.errors[i][0])) {
var err = [];
var error = $scope.errors[i][0];
if (!error.type || !error.list) continue;
示例6: str_replace
";
$scope.lastModified = "<?php
echo Helper::getLastModified($modelClass);
?>
";
$scope.date = date;
$scope.strtotime = strtotime;
$scope.angular = angular;
if (window.plansys) {
window.plansys.rootPath = '<?php
echo str_replace("\\", "/", Setting::getRootPath());
?>
';
window.plansys.repoPath = '<?php
echo str_replace("\\", "/", Setting::getRootPath() . DIRECTORY_SEPARATOR . Setting::get("repo.path"));
?>
';
window.plansys.baseUrl = "<?php
echo Yii::app()->baseUrl;
?>
";
}
// Process Relation Error Message
for (i in $scope.errors) {
if ($scope.errors[i].length > 0 && angular.isObject($scope.errors[i][0])) {
var err = [];
var error = $scope.errors[i][0];
if (!error.type || !error.list) continue;
示例7: __construct
public function __construct()
{
if (Setting::get("repo.path") == '') {
$path = Setting::getRootPath() . DIRECTORY_SEPARATOR . 'repo';
Setting::set("repo.path", $path);
$this->repoPath = Setting::get("repo.path");
} else {
$this->repoPath = Setting::get("repo.path");
}
}