当前位置: 首页>>代码示例>>PHP>>正文


PHP Files::getData方法代码示例

本文整理汇总了PHP中Files::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::getData方法的具体用法?PHP Files::getData怎么用?PHP Files::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Files的用法示例。


在下文中一共展示了Files::getData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: startTheApplicationVariables

 public static function startTheApplicationVariables()
 {
     $branch = trim($_SERVER['REQUEST_URI'], '/');
     $countScriptName = String::countExplode('/', $_SERVER['SCRIPT_NAME']);
     $ServerName = "{$_SERVER['SERVER_NAME']}/";
     if ($countScriptName > 2) {
         $scriptFileName = substr($_SERVER['SCRIPT_NAME'], 1, strlen($_SERVER['SCRIPT_NAME']) - 10);
         $ServerName .= $scriptFileName;
         $branch = trim(str_replace($scriptFileName, '', $_SERVER['REQUEST_URI']), '/');
     }
     $branch = String::getFirstExplodeString('.', $branch);
     $branch = String::getFirstExplodeString('?', $branch);
     self::setBranch($branch);
     ##
     self::setBase(Url::addHttpIntoUrl($ServerName));
     self::setUrl(self::getBase(self::getBranch()));
     self::setMethod(strtolower($_SERVER['REQUEST_METHOD']));
     self::setUri(str_replace('index.php', '', $_SERVER['SCRIPT_FILENAME']));
     ##
     Dir::setVendor(self::getUri('vendor/'));
     Dir::setCore(self::getUri('vendor/tadeubarbosa/teed-php-frame/core/'));
     foreach (Files::getData('src/data/globals.php', true)['paths'] as $type => $path) {
         $pathname = $type == 'src' ? self::getUri() : self::getBase();
         Dir::$data[$type] = "{$pathname}{$type}/";
         foreach ($path as $name => $value) {
             if (!preg_match('/(\\/$)/', $value)) {
                 $value .= '/';
             }
             Dir::$data[$name] = "{$pathname}{$value}";
         }
     }
 }
开发者ID:tadeubarbosa,项目名称:teed-php-frame,代码行数:32,代码来源:App.php

示例2: getFileRobots

 public function getFileRobots()
 {
     $file = DIR . '/' . PATH . 'robots.txt';
     if (!file_exists($file)) {
         file_put_contents($file);
     }
     return Files::getData($file);
 }
开发者ID:vasinsky,项目名称:test,代码行数:8,代码来源:robots_txt.php

示例3: 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;
 }
开发者ID:tadeubarbosa,项目名称:teed-php-frame,代码行数:13,代码来源:Engine.php

示例4: getFileCSS

 public function getFileCSS($fileCss)
 {
     $path = DIR . '/' . PATH . 'app/css/';
     return Files::getData($path . $fileCss);
 }
开发者ID:vasinsky,项目名称:fw-test,代码行数:5,代码来源:css.php

示例5: setlocale

# Configura as datas
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();
开发者ID:tadeubarbosa,项目名称:teed-php-frame,代码行数:31,代码来源:Start.php


注:本文中的Files::getData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。