本文整理汇总了PHP中source\LuLu::getAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP LuLu::getAlias方法的具体用法?PHP LuLu::getAlias怎么用?PHP LuLu::getAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source\LuLu
的用法示例。
在下文中一共展示了LuLu::getAlias方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadActiveModules
public function loadActiveModules($isAdmin)
{
$moduleManager = LuLu::getService('modularityService');
$this->activeModules = $moduleManager->getActiveModules($isAdmin);
$module = $isAdmin ? 'AdminModule' : 'HomeModule';
foreach ($this->activeModules as $m)
{
$moduleId = $m['id'];
$moduleDir = $m['dir'];
$ModuleClassName = $m['dir_class'];
$this->setModule($moduleId, [
'class' => 'source\modules\\' . $moduleDir . '\\' . $module
]);
$serviceFile= LuLu::getAlias('@source').'\modules\\' .$moduleDir.'\\'.$ModuleClassName.'Service.php';
if(FileHelper::exist($serviceFile))
{
$serviceClass = 'source\modules\\' .$moduleDir.'\\'.$ModuleClassName.'Service.php';
$serviceInstance = new $serviceClass();
$this->set($serviceInstance->getServiceId(), $serviceInstance);
}
}
}
示例2: getThemeUrl
public static function getThemeUrl($url = null)
{
$currentTheme = LuLu::getAppParam('homeTheme');
$ret = LuLu::getAlias('@web/static/themes/' . $currentTheme);
if ($url != null) {
return $ret . $url;
}
return $ret;
}
示例3: loadAllModules
private function loadAllModules()
{
if ($this->allModules !== null) {
return $this->allModules;
}
$this->allModules = [];
$moduleRootPath = LuLu::getAlias('@source') . '/modules';
if ($moduleRootDir = @dir($moduleRootPath)) {
while (($moduleFolder = $moduleRootDir->read()) !== false) {
$modulePath = $moduleRootPath . '/' . $moduleFolder;
if (preg_match('|^\\.+$|', $moduleFolder) || !is_dir($modulePath)) {
continue;
}
if ($moduleDir = @dir($modulePath)) {
$moduleClassName = ucwords($moduleFolder);
$class = null;
$instance = null;
$has_admin = false;
$has_home = false;
while (($item = $moduleDir->read()) !== false) {
$itemPath = $moduleRootPath . '/' . $moduleFolder . '/' . $item;
if (preg_match('|^\\.+$|', $item) || is_dir($itemPath)) {
continue;
}
if ($item === $moduleClassName . 'Info.php') {
$class = 'source\\modules\\' . $moduleFolder . '\\' . $moduleClassName . 'Info';
}
if ($item === 'AdminModule.php') {
$has_admin = true;
}
if ($item === 'HomeModule.php') {
$has_home = true;
}
}
if ($class !== null) {
try {
// $moduleObj = LuLu::createObject($class);
$instance = new $class();
if (empty($instance->id)) {
$instance->id = $moduleFolder;
}
if (empty($instance->name)) {
$instance->name = $moduleFolder;
}
} catch (Exception $e) {
// $instance=$e;
}
}
if ($instance !== null) {
$this->allModules[$instance->id] = ['id' => $instance->id, 'dir' => $moduleFolder, 'dir_class' => $moduleClassName, 'class' => $class, 'instance' => $instance, 'can_install' => true, 'can_uninstall' => true, 'has_admin' => $has_admin, 'has_home' => $has_home, 'can_active_admin' => false, 'can_active_home' => false];
}
}
}
}
return $this->allModules;
}
示例4: actionIndex
public function actionIndex()
{
$model = new CacheForm();
if (LuLu::$app->request->isPost && $model->load(LuLu::$app->request->post())) {
if ($model->cache) {
LuLu::flushCache();
LuLu::$app->schemaCache->flush();
}
if ($model->asset) {
$assetDir = LuLu::getAlias('@statics/assets');
FileHelper::removeDirectoryContent($assetDir);
}
return $this->redirect(['index']);
}
return $this->render('index', ['model' => $model]);
}
示例5: loadAllModules
private function loadAllModules()
{
$ret = [];
$moduleRootPath = LuLu::getAlias('@source') . '/modules';
if ($moduleRootDir = @dir($moduleRootPath)) {
while (($moduleFile = $moduleRootDir->read()) !== false) {
$modulePath = $moduleRootPath . '/' . $moduleFile;
if (preg_match('|^\\.+$|', $moduleFile) || !is_dir($modulePath)) {
continue;
}
if ($moduleDir = @dir($modulePath)) {
$moduleInfo = str_replace(' ', '', ucwords(implode(' ', explode('-', $moduleFile))));
$class = null;
$instance = null;
$can_active_admin = null;
$can_active_home = null;
while (($item = $moduleDir->read()) !== false) {
$itemPath = $moduleRootPath . '/' . $moduleFile . '/' . $item;
if (preg_match('|^\\.+$|', $item) || is_dir($itemPath)) {
continue;
}
if ($item === $moduleInfo . 'Module.php') {
$class = 'source\\modules\\' . $moduleFile . '\\' . $moduleInfo . 'Module';
}
}
if ($class !== null) {
try {
// $moduleObj = LuLu::createObject($class);
$instance = new $class();
if (empty($instance->name)) {
$instance->name = $moduleFile;
}
} catch (Exception $e) {
// $instance=$e;
}
}
$ret[$moduleFile] = ['id' => $moduleFile, 'class' => $class, 'instance' => $instance, 'can_install' => true, 'can_uninstall' => true, 'can_active_admin' => false, 'can_active_home' => false];
}
}
}
return $ret;
}
示例6: checkHomeThemeFile
public static function checkHomeThemeFile($fileName, $checkDefault = true)
{
$currentTheme = Resource::getHomeTheme();
$path = LuLu::getAlias('statics') . '/themes/' . $currentTheme . $fileName . '.php';
if (!FileHelper::exist($path) && $checkDefault) {
$currentTheme = 'd';
$path = LuLu::getAlias('statics') . '/themes/' . $currentTheme . $fileName . '.php';
} else {
return $currentTheme;
}
if (!FileHelper::exist($path)) {
return false;
}
return $currentTheme;
}
示例7:
?>
/images/pp.jpg" alt="" />
</div>
<div id="da-user-info">
<?php
echo LuLu::$app->user->identity->username;
?>
</div>
<ul class="da-header-dropdown">
<li class="da-dropdown-caret">
<span class="caret-outer"></span>
<span class="caret-inner"></span>
</li>
<li class="da-dropdown-divider"></li>
<li><a href="<?php
echo LuLu::getAlias('@web') . '/index.php';
?>
" target="_blank">站点首页</a></li>
</ul>
</div>
<div id="da-header-button-container">
<ul>
<li class="da-header-button logout">
<?php
echo Html::a('退出', ['/site/logout']);
?>
</li>
</ul>
</div>
</div>
示例8: reloadAdmin
public function reloadAdmin()
{
$url = LuLu::getAlias('@web') . '/admin.php';
exit('<script>top.location.href="' . $url . '"</script>');
}
示例9:
<?php $this->beginPage() ?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="blank" />
<meta name="format-detection" content="telephone=no" />
<title>登录——LuLu CMS 管理中心</title>
<base href="<?php echo LuLu::getAlias('@web');?>" />
<?php Resource::registerAdmin('/css/bootstrap.css?v=20150409');?>
<?php Resource::registerAdmin('/css/icon.css?v=20150409');?>
<?php Resource::registerAdmin('/css/login.css?v=20150409');?>
<script type="text/javascript">
var G_INDEX_SCRIPT = "?/";
var G_BASE_URL = "";
var G_USER_ID = "1";
var G_POST_HASH = "";
</script>
<?php Resource::registerAdmin('/css/common.css?v=20150409');?>
<?php Resource::registerAdmin('/js/jquery.2.js?v=20150409');?>
<?php Resource::registerAdmin('/js/aws_admin.js?v=20150409');?>
示例10:
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="blank" />
<meta name="format-detection" content="telephone=no" />
<title>登录——LuLu CMS 管理中心</title>
<base href="<?php
echo LuLu::getAlias('@web');
?>
" />
<?php
Resource::registerAdmin('/css/bootstrap.css?v=20150409');
?>
<?php
Resource::registerAdmin('/css/icon.css?v=20150409');
?>
<?php
Resource::registerAdmin('/css/login.css?v=20150409');
?>
<script type="text/javascript">
var G_INDEX_SCRIPT = "?/";
示例11: getThemeUrl
public static function getThemeUrl($url = null)
{
$currentTheme = self::getHomeTheme();
$ret = LuLu::getAlias('@web/statics/themes/' . $currentTheme);
if ($url != null) {
return $ret . $url;
}
return $ret;
}
示例12:
</li>
-->
</ul>
</div>
<div id="info">
<ul>
<li>您好,<?php echo LuLu::$app->user->identity->username?>
</li>
<li>
<?php echo Html::a('退出',['/site/logout'])?>
</li>
<li>
<a href="<?php echo LuLu::getAlias('@web').'/index.php';?>" target="_blank">站点首页</a>
</li>
</ul>
</div>
</td>
</tr>
<tr>
<td valign="top" id="leftContent">
<div id="leftMenu">
<ul class="mod-bar" id="home">
<li>
<?php echo Html::a('<span>欢迎中心</span>',['/site/welcome'],['class'=>'active','target'=>'mainFrame'])?>
</li>
</ul>
示例13:
<li style="float:right;">
<div class="toggle-search"><i class="fa fa-search"></i></div>
<div class="search-expand" style="display: none;"><div class="search-expand-inner"><form method="get" class="searchform themeform" action="/"><div> <input type="ext" class="search" name="s" onblur="if(this.value=='')this.value='search...';" onfocus="if(this.value=='search...')this.value='';" value="search..."></div></form></div></div>
</li>
</ul>
</div>
</header>
<section class="container" style="padding-top: 10px;height:100%;">
<?php echo $content;?>
</section>
<footer class="footer">
<div class="footer-inner">
<div class="copyright pull-left">
<a href="<?php echo LuLu::getAlias('@web')?>" >LuLu CMS</a> 保留一切权利 · © 2011-2015
</div>
<div class="trackcode pull-right">
</div>
</div>
</footer>
统计代码 <?php echo $this->getConfigValue('sys_stat');?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
示例14: getInstallUrl
public static function getInstallUrl($url = null)
{
$ret = LuLu::getAlias('@web/statics/install');
if ($url != null) {
return $ret . $url;
}
return $ret;
}
示例15: getEnvData
private function getEnvData()
{
$isWritable = [['系统临时文件(data/runtime)', true, FileHelper::canWrite(LuLu::getAlias('@data/runtime')), '系统核心', '必须可读写'], ['附件上传目录(data/attachment)', false, FileHelper::canWrite(LuLu::getAlias('@data/attachment')), '附件上传', '若无附件上传可不用写权限'], ['数据备份目录(data/backup)', false, FileHelper::canWrite(LuLu::getAlias('@data/backup')), '数据库备份', '若不备份数据库可不用写权限'], ['配置文件目录(data/config)', false, FileHelper::canWrite(LuLu::getAlias('@data/attachment')), '安装程序', '若手动安装系统写可不用写权限'], ['公共资源文件(statics/assets)', true, FileHelper::canWrite(LuLu::getAlias('@statics/assets')), '系统核心', '必须可读写']];
$requirements = array(['PHP版本', true, version_compare(PHP_VERSION, "5.4.0", ">="), '系统核心', 'PHP 5.4.0 或更高版本是必须的.'], ['$_SERVER 服务器变量', true, 'ok' === ($message = Utility::checkServerVar()), '系统核心', $message], ['Reflection 扩展模块', true, class_exists('Reflection', false), '系统核心', ''], ['PCRE 扩展模块', true, extension_loaded("pcre"), '系统核心', ''], ['SPL 扩展模块', true, extension_loaded("SPL"), '系统核心', ''], ['PDO 扩展模块', true, extension_loaded('pdo'), '所有和使用PDO数据库连接相关的类', ''], ['PDO MySQL 扩展模块', true, extension_loaded('pdo_mysql'), 'MySql数据库', '使用MySql数据库必须支持'], ['OpenSSL 扩展模块', true, extension_loaded('openssl'), 'Security', '加密和解密方法'], ['GD 扩展模块', false, 'ok' === ($message = Utility::checkCaptchaSupport()), 'CaptchaAction', $message]);
$requireResult = 1;
foreach ($requirements as $i => $requirement) {
if ($requirement[1] && !$requirement[2]) {
$requireResult = 0;
} else {
if ($requireResult > 0 && !$requirement[1] && !$requirement[2]) {
$requireResult = -1;
}
}
if ($requirement[4] === '') {
$requirements[$i][4] = ' ';
}
}
$writeableResult = 1;
foreach ($isWritable as $k => $val) {
if ($val[1] && !$val[2]) {
$writeableResult = 0;
} else {
if ($requireResult > 0 && !$val[1] && !$val[2]) {
$writeableResult = -1;
}
}
if ($val[4] === '') {
$isWritable[$i][4] = ' ';
}
}
$data = ['isWritable' => $isWritable, 'writeableResult' => $writeableResult, 'requireResult' => $requireResult, 'requirements' => $requirements];
return $data;
}