當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dir::getSrc方法代碼示例

本文整理匯總了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);
 }
開發者ID:tadeubarbosa,項目名稱:teed-php-frame,代碼行數:10,代碼來源:Teed.php

示例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));
     }
 }
開發者ID:tadeubarbosa,項目名稱:teed-php-frame,代碼行數:16,代碼來源:Engine.php

示例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();
開發者ID:tadeubarbosa,項目名稱:teed-php-frame,代碼行數:31,代碼來源:Start.php


注:本文中的Dir::getSrc方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。