本文整理汇总了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);
}
示例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;
}
示例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;
}
}
}
示例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);
}
示例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());
}
示例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);
}
示例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;
}
}
示例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;
}
示例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" ');
}
示例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;
}
示例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';
}
示例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;
}
示例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);
}
}
}
}
示例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();
}
示例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);
}