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


PHP get_file函数代码示例

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


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

示例1: convert

function convert($dbFileName, $sqlFileName)
{
    $db = get_pdo($dbFileName);
    $f = get_file($sqlFileName);
    convert_data($db, $f, convert_schema($db, $f));
    fclose($f);
}
开发者ID:umonkey,项目名称:molinos-cms,代码行数:7,代码来源:sqlite2mysql.php

示例2: get_file

function get_file($date)
{
    global $bzipped, $url, $RIR, $old_format;
    if ($old_format == "apnic") {
        $file = "{$RIR}-" . $date->format("Y-m-d");
    } elseif (isset($old_format)) {
        $file = "{$RIR}." . $date->format("Ymd");
    } else {
        $file = "delegated-{$RIR}-" . $date->format("Ymd");
    }
    print $file . "\n";
    if ($bzipped == "" || $bzipped == "none") {
        system("wget {$url}/{$file} 2>/dev/null");
    } else {
        if ($bzipped == "gunzip") {
            system("wget {$url}/{$file}.gz 2>/dev/null");
            system("{$bzipped} {$file}.gz");
        } else {
            system("wget {$url}/{$file}.bz2 2>/dev/null");
            system("{$bzipped} {$file}.bz2");
        }
    }
    if (!file_exists($file)) {
        $newdate = new DateTime($date->format("Y-m-d"));
        $newdate->modify("1 day");
        return get_file($newdate);
    }
    return $file;
}
开发者ID:blongstaff,项目名称:cs217b,代码行数:29,代码来源:get-opt.php

示例3: __construct

 public function __construct($name)
 {
     parent::__construct();
     $path = PATH . "/themes/" . $name . "/theme.xml";
     // load the theme settings file if it exists
     if ($xml = get_file($path)) {
         // load xml object, and convert it to an array
         $settings = object2array(simplexml_load_string($xml));
     } else {
         $settings = array();
     }
     $path = PATH . "/themes/" . $name . "/macros.xml";
     // load the theme settings file if it exists
     if ($xml = get_file($path)) {
         // load xml object, and convert it to an array
         $settings['macros'] = object2array(simplexml_load_string($xml));
     } else {
         $settings['macros'] = array();
     }
     $settings['path'] = $name;
     $settings['name'] = $name;
     foreach ($settings as $key => $value) {
         if ($value !== "" && $value !== " ") {
             $this->Settings[$key] = $value;
         }
     }
 }
开发者ID:ericmuyser,项目名称:web2f,代码行数:27,代码来源:Theme.class.php

示例4: get_report_cache_html

/**
 * 访问 测评报告静态文件
 */
function get_report_cache_html($params)
{
    $code = isset($params['code']) ? trim($params['code']) : '';
    if ($code == '') {
        die('404 not found');
    }
    $code = urldecode(base64_decode($code));
    list($rule_id, $uid, $subject_id) = explode('-', $code);
    $rule_id = !is_null($rule_id) ? intval($rule_id) : 0;
    if (!is_null($subject_id)) {
        $subject_id = intval($subject_id);
    } else {
        $subject_id = 0;
    }
    $uid = !is_null($uid) ? intval($uid) : 0;
    if (!$rule_id || !$uid) {
        die('404 not found');
    }
    $cache_path = realpath('../../') . '/cache/html/interview_report';
    $file_name = "{$cache_path}/{$rule_id}/{$uid}/{$subject_id}.html";
    if (!file_exists($file_name)) {
        die('404 not found');
    }
    echo get_file($file_name);
}
开发者ID:Vincent-Shen,项目名称:origin,代码行数:28,代码来源:interview_report.php

示例5: get_version

 static function get_version()
 {
     if (file::get_folder_path('framework') === false) {
         return;
     }
     return @file_get_contents(get_file('framework', 'VERSION')->get_path());
 }
开发者ID:laiello,项目名称:phpbf,代码行数:7,代码来源:class.common.php

示例6: get_attachment_image_src

/**
 * Emulate get_attachment_image_src for HTML context
 * 
 * @param string $size_or_img_name
 * @param string $image_size
 * @return string
 */
function get_attachment_image_src($size_or_img_name = 'thumbnail', $image_size = '')
{
    $is_img = is_size_or_img($size_or_img_name);
    if ($is_img === true) {
        return get_file(BEA_IMG_SAMPLE_DIR . $size_or_img_name, $image_size);
    }
    $img_url = get_random_sample_img_url($size_or_img_name);
    return get_timthumb_url($img_url, $image_size);
}
开发者ID:rainevincent,项目名称:beapi-frontend-framework,代码行数:16,代码来源:post-thumbnail.php

示例7: get_module_description

function get_module_description($module_name)
{
    if (description_exists($module_name)) {
        return get_file(get_module_path($module_name) . '/' . get_constant('platform\\config\\interfac3::_valid_description_file'));
    } else {
        $error_msg = get_constant('\\platform\\config\\interfac3::_no_module_description_msg');
        return $error_msg;
    }
}
开发者ID:guillaum3f,项目名称:codie,代码行数:9,代码来源:modules.php

示例8: plug_utmsrc

function plug_utmsrc($f = '', $o = '')
{
    $d = get_file($f);
    $d = utmsrc_utf($d);
    //eco($d,1);
    $u = embed_detect($d, '<meta property="og:url" content="', '"', '');
    //echo $u;
    return $u;
}
开发者ID:philum,项目名称:cms,代码行数:9,代码来源:utmsrc.php

示例9: sendmail

 function sendmail($addr, $subject, $body)
 {
     global $DOCUMENT_ROOT;
     $css = get_file($DOCUMENT_ROOT . '/styles/mail.css');
     if ($css != '') {
         $css = '<style type="text/css">' . $css . '</style>';
     }
     $src = '<html><head>' . $css . '</head><body>' . $body . '</body></html>';
     mail($addr, $subject, $src, 'From: ' . config_get('bot-email') . "\n" . 'Content-Type: text/html; charset="UTF-8" ');
 }
开发者ID:Nazg-Gul,项目名称:gate,代码行数:10,代码来源:mail.php

示例10: wiki_get_page_src

 function wiki_get_page_src($url, $action = '')
 {
     $file = wiki_get_indexfile($action);
     $url .= $file;
     $root = config_get('site-root');
     $fn = "{$root}{$url}";
     if (($src = get_file($fn)) == false) {
         return false;
     }
     return $src;
 }
开发者ID:Nazg-Gul,项目名称:gate,代码行数:11,代码来源:wiki.php

示例11: upurlsav

function upurlsav($dr, $o, $u)
{
    $u = ajxg($u);
    if (!is_image($u)) {
        return 'no';
    }
    $ret = get_file($u);
    $nm = strrchr($u, '/');
    $f = 'users/' . $dr . '/' . $nm;
    write_file($f, $ret);
    return 'ok';
}
开发者ID:philum,项目名称:cms,代码行数:12,代码来源:upload.php

示例12: access

 protected final function access($d)
 {
     if ($d === false) {
         if (!($a = get_file(XFS . '.htda'))) {
             exit;
         }
         if ($b = get_file(XFS . '.htda_local')) {
             $a = $b;
         }
         $d = explode(',', decode($a[0]));
     }
     foreach (w('server login secret database') as $i => $k) {
         $this->_access[$k] = decode($d[$i]);
     }
     unset($d);
     return;
 }
开发者ID:nopticon,项目名称:mag,代码行数:17,代码来源:db.dcom.php

示例13: stack_folder

function stack_folder($path, $namespace, $mask = null)
{
    //record the folder path containing libs
    try {
        $directory = new \DirectoryIterator($path);
    } catch (Exception $e) {
        warning('filesystem', 'e001', $path);
        return;
    }
    //format eventual namespace
    //if namespace exist push namespace in stack as new javascript object
    if ($namespace != '') {
        $namespace = trim($namespace, '.');
        get_transmission()->stack('if(!' . $namespace . '){' . $namespace . ' = {};}');
        $namespace = $namespace . '.';
    }
    //scan the folder
    //exit if there is NO item, item is NOT (a folder or a file), item IS "dot" folder
    foreach ($directory as $object) {
        //get path of item
        $pathname = $object->getPathname();
        if ($object->isDir() && !$object->isDot()) {
            //get foldername
            $foldername = $object->getBasename();
            //build new namespace
            $newnamespace = $namespace . $foldername;
            //send new path and new namespace back to the function
            stack_folder($pathname, $newnamespace);
        } else {
            if ($object->isFile()) {
                //apply mask rule
                if ($mask) {
                    if (!preg_match('#' . $mask . '#', $pathname)) {
                        continue;
                    }
                }
                //get file content
                $filecontent = get_file($pathname);
                //add $namespace to the beginning of file content
                $filecontent = $namespace . $filecontent;
                //push javascript object with new namespace in stack
                get_transmission()->stack($filecontent);
            }
        }
    }
}
开发者ID:guillaum3f,项目名称:codie,代码行数:46,代码来源:scan.php

示例14: updatenow

    public function updatenow(){
        include('Update.class.php');
        $version = './WQLData/version.php';
        $ver = include($version);
        $ver = $ver['ver'];
		
		
       
		
        $hosturl = urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
        $updatehost = 'http://demo.weiqianlong.com/update.php';
        $updatehosturl = $updatehost . '?a=update&v=' . $ver . '&u=' . $hosturl;
		
		
		
        $updatenowinfo = file_get_contents($updatehosturl);
		
		
        if (strstr($updatenowinfo, 'zip')){
            $pathurl = $updatehost . '?a=down&f=' . $updatenowinfo;
            $updatedir = './WQLData/logs/Temp/update';
            delDirAndFile($updatedir);
            get_file($pathurl, $updatenowinfo, $updatedir);
            $updatezip = $updatedir . '/' . $updatenowinfo;
            $archive = new PclZip($updatezip);
            if ($archive -> extract(PCLZIP_OPT_PATH, './', PCLZIP_OPT_REPLACE_NEWER) == 0){
                $updatenowinfo = "远程升级文件不存在.升级失败</font>";
            }else{
                $sqlfile = $updatedir . '/update.sql';
                $sql = file_get_contents($sqlfile);
                if($sql){
                    $sql = str_replace("tp_", C('DB_PREFIX'), $sql);
                    $Model = new Model();
                    error_reporting(0);
                    foreach(split(";[\r\n]+", $sql) as $v){
                        @mysql_query($v);
                    }
                }
                $updatenowinfo = "<font color=red>升级完成 {$sqlinfo}</font><span><a href=./index.php?g=System&m=Update>点击这里 查看是否还有升级包</a></span>";
            }
        }
        delDirAndFile($updatedir);
        $this -> assign('updatenowinfo', $updatenowinfo);
        $this -> display();
    }
开发者ID:royalwang,项目名称:saivi,代码行数:45,代码来源:UpdateAction.class.php

示例15: load

 public function load($v, $force = false)
 {
     if (!$this->allow && !$force) {
         return;
     }
     $filepath = $this->folder . $this->encrypt($v);
     $this->last = $v;
     if (!@file_exists($filepath)) {
         return false;
     }
     // Cache expiration time
     if (time() - @filemtime($filepath) < 3600) {
         if ($plain = get_file($filepath)) {
             return json_decode($plain[0], true);
         }
     }
     return $this->unload($v);
 }
开发者ID:nopticon,项目名称:mag,代码行数:18,代码来源:cache.php


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