本文整理汇总了PHP中Dir::getSrc方法的典型用法代码示例。如果您正苦于以下问题:PHP Dir::getSrc方法的具体用法?PHP Dir::getSrc怎么用?PHP Dir::getSrc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir::getSrc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: includePartial
public static function includePartial($file)
{
$file = preg_replace('/(\\.)/', '/', $file);
$file = Dir::getSrc("templates/{$file}.php");
if (!isset(Engine::$data['partials'])) {
Engine::$data['partials'] = [];
}
Engine::$data['partials'][$file] = true;
return Engine::cacheFile($file);
}
示例2: cacheFile
public static function cacheFile($file_name)
{
if (App::getEnv()->name == 'local') {
$cached_file = Dir::getCache(str_replace([Dir::getSrc(), '/'], ['', '-'], $file_name));
} else {
$cached_file = Dir::getCache(sha1($file_name));
}
$cached_file = preg_replace('/((?:(\\.teed))?(\\.php))/', '.cache-teed', $cached_file);
if (self::verifyDifference($file_name, $cached_file)) {
$file = self::renderFile($file_name);
Files::putFile($cached_file, $file, 'w+');
return $file;
} else {
return implode(' ', Files::getFile($cached_file));
}
}
示例3: 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();