本文整理汇总了PHP中APP::getGlobal方法的典型用法代码示例。如果您正苦于以下问题:PHP APP::getGlobal方法的具体用法?PHP APP::getGlobal怎么用?PHP APP::getGlobal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APP
的用法示例。
在下文中一共展示了APP::getGlobal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLogedUser
/**
* Retorna o usuário logado no nível informado
* @param string $Nivel
* @return null|UserVO
*/
function getLogedUser($Nivel = null)
{
$key = "UsersModelLoged_{$Nivel}";
if (!APP::getGlobal($key)) {
$session = new Session($key);
if ($user = $this->getById($session->get('id', null)) and $user->getStatus() == 1) {
$_SESSION['access-ckeditor'] = true;
return APP::setGlobal($key, $user);
} else {
$_SESSION['access-ckeditor'] = null;
return null;
}
} else {
$_SESSION['access-ckeditor'] = true;
return APP::getGlobal($key);
}
}
示例2: getPublicPath
/**
*
* @param string $Path Completa o direitorio a partir de public
* @return string
*/
public static function getPublicPath($Path = null)
{
return APP::getGlobal('public_path') . ($Path ? "/{$Path}" : null);
}
示例3: get_all_paths
/**
* Retorna todas as pasta para o include
* @return array
*/
function get_all_paths()
{
# Pega o valor já gravado
if (APP::getGlobal('get_all_paths')) {
return APP::getGlobal('get_all_paths');
}
# Pastas do sistema
$Paths = ['', 'system', 'system/core', 'system/crud', 'system/helpers', 'system/helpers/Bootstrap', 'system/models', 'system/libraries', 'system/models', 'system/valueobject'];
# Não possuí cache listando pastas
if (!APP::getCurrentModule()) {
return $Paths;
} else {
$Paths = array_merge([APP::getCurrentModule(true)], list_paths(APP::getCurrentModule(true)), $Paths);
$module = APP::getModules()[APP::getCurrentModule()];
$general = is_array(get_config('library')) ? get_config('library') : [];
if (is_array($module)) {
foreach (['library'] as $key => $value) {
if (is_array($value)) {
$general = array_merge($general, $value);
} else {
$general[] = $value;
}
}
}
foreach ($general as $key => $path) {
$Paths = array_merge([$path], list_paths($path), $Paths);
}
APP::setGlobal('get_all_paths', $Paths);
return $Paths;
}
}