本文整理汇总了PHP中Dir::getCore方法的典型用法代码示例。如果您正苦于以下问题:PHP Dir::getCore方法的具体用法?PHP Dir::getCore怎么用?PHP Dir::getCore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir::getCore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFile
public static function renderFile($file)
{
$string = Files::getFile($file);
$variables = Files::getData(Dir::getCore('Engine/Variables.php'), true);
foreach ($variables as $value) {
$value = (array) $value;
$value[0] = str_replace(['(', ')'], ['\\(', '\\)'], $value[0]);
$value[0] = str_replace(['*'], ['(.*)'], $value[0]);
$value[0] = "/({$value[0]})/" . (isset($value[2]) ? '' : 'U');
$string = preg_replace($value[0], $value[1], $string);
}
return $string;
}
示例2: setlocale
setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
date_default_timezone_set('America/Sao_Paulo');
Carbon\CarbonInterval::setLocale('pt_BR');
##
# Configura os dados do Input
Input::configureInputData();
##
# Inicia as variaveis da aplicação
App::startTheApplicationVariables();
##
# Adiciona as informações do arquivo a class `site`
Site::all(Files::getData('website.php'));
##
# Busca pelo enviromet e seta-o
foreach (Files::getData('enviroment.php') as $name => $value) {
$match = str_replace('*', '(.*)', $value->match);
# Busca pelo host atual
if (preg_match("/{$match}/", $_SERVER['HTTP_HOST'])) {
$value->name = $name;
App::setEnv($value);
break;
}
}
##
# Busca pelas configuraçoes das Rotas: id, name etc
require_once Dir::getCore('Routers/configurations.php');
# Busca pelas rotas setadas pelo programador
require_once Dir::getSrc('routes.php');
# Inicializa o TeedCss
TeedCss\Initialize::start();
App::confTemplateRoutes();