• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP load_file函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中load_file函数的典型用法代码示例。如果您正苦于以下问题:PHP load_file函数的具体用法?PHP load_file怎么用?PHP load_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: load_file

function load_file($url, $frequency = 3600, $cachefn = '')
{
    $fcont = false;
    if (!preg_match('|^http://([\\w]+)\\.deviantart\\.com[\\w/._]*|', $url)) {
        die("Error: couldn't open {$url}!");
    }
    if ($cachefn !== '') {
        $cache = '.cache/' . $cachefn;
    } else {
        $cache = '.cache/' . preg_replace('/[^a-z0-9\\.]/i', '', $url) . '.cache';
    }
    if (file_exists($cache) && time() - filemtime($cache) <= $frequency) {
        $fcont = file_get_contents($cache);
    } else {
        if (($fcont = get_page($url)) === false) {
            if (file_exists($cache)) {
                touch($cache);
                return load_file($url);
            } else {
                die("Error: couldn't open {$url}!");
            }
        }
        file_put_contents($cache, $fcont, LOCK_EX);
    }
    return $fcont;
}
开发者ID:raisanen,项目名称:jce,代码行数:26,代码来源:load_file.php


示例2: Main

function Main()
{
    $src_file = fopen("../GMS_LANG_SRC_" . date("Ymdhis") . ".txt", "w");
    load_file($src_file, "../chinese_simple/sys_config.php");
    load_file($src_file, "../chinese_simple/page_localized.php");
    fclose($src_file);
}
开发者ID:svn2github,项目名称:ybtx,代码行数:7,代码来源:Encoding.php


示例3: init

 /**
  * Inisialisasi controller
  * @param String $access = 'site' atau 'admin'
  * @param Boolean $debug, $cache = smarty config
  * @param Integer $cache_lifetime = smarty config
  * @access protected  
  */
 protected function init($access, $link = '', $debug = false, $cache = false, $cache_lifetime = 120)
 {
     self::$instance = $this;
     $this->load = new Z_Loader();
     $this->base_link = base_link_format($link);
     load_file(ENGINE_PATH . 'smarty' . DS . 'libs' . DS, 'Smarty.class.php');
     if (!class_exists('Smarty')) {
         die('Smarty class not found !');
     }
     $this->view = new Smarty();
     if ($access == 'site') {
         $name = $this->theme_dir('site_theme_name', 'site');
         $this->view->template_dir = $this->theme_dir('site_theme_path', 'site');
     } else {
         if ($access == 'admin') {
             $name = $this->theme_dir('site_theme_name', 'admin');
             $this->view->template_dir = $this->theme_dir('site_theme_path', 'admin');
         } else {
             die('Wrong access !');
         }
     }
     $this->view->compile_dir = TEMP_PATH . 'smarty' . DS . 'templates_c' . DS;
     $this->view->config_dir = TEMP_PATH . 'smarty' . DS . 'configs' . DS;
     $this->view->cache_dir = TEMP_PATH . 'smarty' . DS . 'cache' . DS;
     $this->view->plugins_dir = ENGINE_PATH . 'plugin' . DS . 'smarty' . DS . 'plugins' . DS;
     $this->view->debugging = $debug;
     $this->view->caching = $cache;
     $this->view->cache_lifetime = $cache_lifetime;
     $this->require_files($access);
     $this->view->assign('THEME_DIR', $name);
 }
开发者ID:asmari,项目名称:zcosp,代码行数:38,代码来源:controller.php


示例4: create

 /**
  * 生成静态页面
  * @param type $arg     生成静态数据
  * array(控制器名,方法名,表态数据,保存表态文件路径)
  * array(news,show,1,'h/b/hd.html');表示生成news控制器中的show方法生成ID为1的文章
  */
 public function create($control, $method, $data)
 {
     $control = rtrim($control, C("CONTROL_FIX"));
     $file = get_control_file($control . C('CONTROL_FIX'));
     load_file($file[0]);
     $className = $file[1] . C("CONTROL_FIX");
     $obj = new $className();
     // $obj->$method();
     //        $GLOBALS['html_control'] = $control;
     //        $GLOBALS['html_method'] = $method;
     foreach ($data as $v) {
         //设置GET参数
         ob_start();
         foreach ($v as $m => $n) {
             $_GET[$m] = $n;
         }
         if (!isset($v['html_file'])) {
             //验证是否含有html_file内容,即生成文件的名子
             error(L("html_create_error1"), false);
             return false;
         }
         $dirname = dirname($v['html_file']);
         if (!$this->createDir($dirname)) {
             //创建一下生成静态的目录
             error(L("html_create_error2"));
             return false;
         }
         $obj->{$method}();
         //执行控制器方法
         $content = ob_get_clean();
         file_put_contents($v['html_file'], $content);
     }
     return true;
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:40,代码来源:html.class.php


示例5: load_mimefile

function load_mimefile($filename)
{
    $file = load_file($filename);
    if ($file === NULL) {
        return NULL;
    }
    return mime_parse($file);
}
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:8,代码来源:mimefile.php


示例6: Main

function Main()
{
    $lang = "english";
    $src_file = fopen("../GMS_LANG_SRC_" . $lang . "_" . date("Ymdhis") . ".txt", "w");
    load_file($src_file, $lang, "sys_config.php");
    load_file($src_file, $lang, "page_localized.php");
    fclose($src_file);
}
开发者ID:svn2github,项目名称:ybtx,代码行数:8,代码来源:Merge.php


示例7: _getStructureFromBaseRepoFile

 private function _getStructureFromBaseRepoFile($fileName)
 {
     $objBaseRepositoryName = str_replace('.php', '', $fileName);
     $objBaseRepositoryName = NamingConvention::snakeCaseToCamelCaseFirstUpper($objBaseRepositoryName) . 'sitory';
     load_file($this->_baseRepoDir . $fileName);
     $objRepository = new $objBaseRepositoryName();
     return $objRepository->getStructure();
 }
开发者ID:RobinTheHood,项目名称:php-framework,代码行数:8,代码来源:dependency.php


示例8: getDriver

 /**
  * 获得数据库驱动接口
  * @param string $driver
  */
 private function getDriver($driver)
 {
     $class = $driver . 'SessionDriver';
     //数据库驱动
     $classFile = PATH_HD . '/libs/usr/session/driver/' . $class . '.class.php';
     //加载驱动类库文件
     load_file($classFile);
     $this->driver[$driver] = new $class();
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:13,代码来源:sessionFactory.class.php


示例9: importar_data

 protected function importar_data()
 {
     $ruta = "//199.69.69.93\\interfaces_cedentes\\Cargas Procesos\\APLICACIONES\\UVM_CARSIT\\ENTRADA";
     $listado = get_dir_file_info($ruta);
     foreach ($listado as $key => $value) {
         $r = $listado[$key];
         $this->data[$r["name"]] = load_file($r["server_path"], null, "dia");
     }
 }
开发者ID:bsanchezdev,项目名称:p_solvencia,代码行数:9,代码来源:uvm_c_robot_panel.php


示例10: getDriver

 /**
  * 获得数据库驱动接口
  * @param string $driver
  */
 private function getDriver($driver)
 {
     $class = $driver . 'Cache';
     //缓存驱动
     $classFile = PATH_HD . '/libs/usr/cache/driver/' . $class . '.class.php';
     //加载驱动类库文件
     load_file($classFile);
     $this->driver_list[$driver] = new $class();
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:13,代码来源:cacheFactory.class.php


示例11: load_dir_files

 function load_dir_files($dir_path)
 {
     $files = scandir($dir_path);
     $dir_path = preg_match("/\\/\\z/", $dir_path) ? $dir_path : $dir_path . DS;
     foreach ($files as $file_name) {
         if (is_file($dir_path . $file_name)) {
             load_file($dir_path . $file_name);
         }
     }
 }
开发者ID:jameshwartlopez,项目名称:Elixir-System,代码行数:10,代码来源:Functions.php


示例12: getDriver

 /**
  * 获得数据库驱动接口
  * @param string $driver
  */
 private function getDriver($driver, $tableName)
 {
     $class = $driver . 'Driver';
     //数据库驱动
     $classFile = PATH_HD . '/libs/usr/db/driver/' . $class . '.class.php';
     //加载驱动类库文件
     load_file($classFile);
     $this->driver_list[$tableName] = new $class();
     $table = $tableName == 'empty' ? null : $tableName;
     $this->driver_list[$tableName]->connect($table);
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:15,代码来源:dbFactory.class.php


示例13: load

 public static function load($name, $section = 'default')
 {
     static $caches = [];
     if (isset($caches[$key = "{$name}--{$section}"])) {
         return $caches[$key];
     }
     $conf = yaml_parse(load_file(ROOT . "/conf/default/{$name}.yml"))[$section];
     if (is_file($file = ROOT . "/conf/{$name}.yml")) {
         $conf = array_replace_recursive($conf, yaml_parse(load_file($file))[$section]);
     }
     return $caches[$key] = $conf;
 }
开发者ID:tany,项目名称:php-note,代码行数:12,代码来源:Config.php


示例14: __construct

 /**
  * Constructor
  *
  * @args[0] $filename represents name and location
  */
 function __construct()
 {
     $this->elementObjects = array();
     $this->lineStore = array();
     $args = func_get_args();
     if (!empty($args)) {
         $this->filename = $args[0];
         $this->load(load_file($this->filename));
     } else {
         $this->filemodtime = time();
     }
 }
开发者ID:bwssytems,项目名称:domuslink,代码行数:17,代码来源:elementfile.class.php


示例15: safe_load

/**
 *  Load data from safe by hash
 */
function safe_load($hash)
{
    $file_content = load_file(make_file_name($hash));
    if ($file_content === false) {
        return false;
    }
    $data = json_decode($file_content);
    if ($data === false) {
        return false;
    }
    return safe_normalize_data($data);
}
开发者ID:ah01,项目名称:jq-probe,代码行数:15,代码来源:safe.inc.php


示例16: Main

function Main()
{
    $lang = "english";
    $filename = "GMS_LANG_SRC_english_20110816075748.txt";
    $src_file = fopen($filename, "r");
    $src = array();
    while (!feof($src_file)) {
        $str = fgets($src_file);
        $src[substr($str, 0, 32)] = substr($str, 33);
    }
    load_file($lang, $src, "sys_config.php");
    load_file($lang, $src, "page_localized.php");
}
开发者ID:svn2github,项目名称:ybtx,代码行数:13,代码来源:Decoding.php


示例17: getDriver

 /**
  * 获得数据库驱动接口
  * @param string $driver
  */
 public function getDriver($driver)
 {
     if (isset($this->driver_list[$driver])) {
         return $this->driver_list[$driver];
     }
     $class = $driver . "View";
     $classFile = PATH_HD . '/libs/usr/view/hd/' . $class . '.class.php';
     //类文件
     load_file($classFile);
     //加载类文件
     $this->driver_list[$driver] = new $class();
     //视图操作引擎对象
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:17,代码来源:viewFactory.class.php


示例18: model

 /**
  * Fungsi untuk menyertakan model
  * dan otomatis menginstansiasi model yang di sertakan
  * @access public
  **/
 public function model($model_name, $object = '')
 {
     $z =& get_instance();
     if ($object == '') {
         $object = $model_name;
     }
     load_file(MODULE_PATH . $model_name . DS, 'model.php');
     $model = ucfirst(strtolower($model_name));
     $class = $model . '_model';
     if (!class_exists($class)) {
         die('Model : "' . $class . '" not found !');
     }
     $z->{$object} = new $class();
 }
开发者ID:asmari,项目名称:zcosp,代码行数:19,代码来源:loader.php


示例19: load_class

 function load_class($path, $filename, $class_name = '', $method = 'view', $params = '')
 {
     load_file($path . DS, $filename . '.php');
     if ($class_name != '') {
         $filename = $class_name;
     }
     $class = ucfirst(strtolower($filename));
     if (!class_exists($class)) {
         die('<b>Error :</b> Class "' . $class . '" is not exists !');
     }
     $class = new $class();
     if (!method_exists($class, 'view')) {
         die('<b>Error :</b> Method "' . $method . '" on class "' . $class_name . '" is not exists');
     }
     $class->{$method}($params);
 }
开发者ID:asmari,项目名称:zcosp,代码行数:16,代码来源:function.php


示例20: load

 protected static function load()
 {
     $time = filemtime(__FILE__);
     foreach ($files = glob(self::$conf) as $f) {
         $time = max($time, filemtime($f));
     }
     if (($cache = apcu_fetch('app.routes'))[0] >= $time) {
         self::$routes = $cache[1];
     } else {
         $conf = '';
         foreach ($files as $f) {
             $conf .= load_file($f) . "\n";
         }
         apcu_store('app.routes', [$time, self::$routes = self::parse($conf)]);
     }
 }
开发者ID:tany,项目名称:php-note,代码行数:16,代码来源:Router.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP load_filters函数代码示例发布时间:2022-05-15
下一篇:
PHP load_fiche_titre函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap