本文整理汇总了PHP中get_file函数的典型用法代码示例。如果您正苦于以下问题:PHP get_file函数的具体用法?PHP get_file怎么用?PHP get_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_file函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: __construct
public function __construct()
{
$sql = 'SELECT *
FROM _config';
$this->config = sql_rowset($sql, 'config_name', 'config_value');
if ($this->v('site_disable')) {
exit('not_running');
}
$address = $this->v('site_address');
$host_addr = array_key(explode('/', array_key(explode('//', $address), 1)), 0);
if ($host_addr != get_host()) {
$allow_hosts = get_file(XFS . XCOR . 'store/domain_alias');
foreach ($allow_hosts as $row) {
if (substr($row, 0, 1) == '#') {
continue;
}
$remote = strpos($row, '*') === false;
$row = !$remote ? str_replace('*', '', $row) : $row;
$row = str_replace('www.', '', $row);
if ($row == get_host()) {
$sub = str_replace($row, '', get_host());
$sub = f($sub) ? $sub . '.' : ($remote ? 'www.' : '');
$address = str_replace($host_addr, $sub . $row, $address);
$this->v('site_address', $address, true);
break;
}
}
}
if (strpos($address, 'www.') !== false && strpos(get_host(), 'www.') === false && strpos($address, get_host())) {
$page_protocol = array_key(explode('//', _page()), 0);
$a = $this->v('site_address') . str_replace(str_replace('www.', '', $page_protocol . $address), '', _page());
redirect($a, false);
}
$this->cache_dir = XFS . XCOR . 'cache/';
if (is_remote() && @file_exists($this->cache_dir) && @is_writable($this->cache_dir) && @is_readable($this->cache_dir)) {
$this->cache_f = true;
}
//
// Load additional objects.
//
$this->email = _import('emailer');
$this->cache = _import('cache');
return;
}
开发者ID:nopticon,项目名称:npt,代码行数:44,代码来源:core.php
示例17: create_faculty_file
function create_faculty_file()
{
$fac_file = get_file();
// Get the html file
if (empty($fac_file)) {
return false;
}
preg_match('/<tbody(.+)tbody>/sm', $fac_file, $table);
// Get the table
$rows = preg_split('/<tr/', $table[0]);
// Get each row
array_shift($rows);
// Get rid of the first element
$fp = fopen(FACULTY_FILE, 'w');
// Open the file for writing
if (empty($fp)) {
return false;
}
if (@flock($fp, LOCK_EX)) {
// Prevent multiple creations
foreach ($rows as $row) {
// Iterate through the rows
$cols = preg_split('/<td/', $row);
// Split up the columns
$name = filter_name($cols[1]);
// Get the name
$area = filter_area($cols[2]);
// Get the area of research
$mail = filter_email($cols[3]);
// Get the email
fwrite($fp, "{$mail},{$name},{$area}\n");
// Write the output to the file
}
flock($fp, LOCK_UN);
} else {
fclose($fp);
// Couldn't get lock
return false;
}
fclose($fp);
// Close the file
return true;
}
开发者ID:nirwandogra,项目名称:school-work,代码行数:43,代码来源:functions.inc.php
示例18: test_xml
function test_xml($f)
{
$d = get_file($f);
echo $enc = embed_detect(strtolower($d), 'encoding="', '"');
if (strtolower($enc) == 'utf-8') {
$d = utf8_decode_b($d);
}
//echo substr_count($d,'<').'-'.substr_count($d,'>');
eco($d, 1);
$r = simplexml_load_string($d);
$xml = explode("\n", $f);
if (!$r) {
$rr = libxml_get_errors();
foreach ($rr as $er) {
$ret .= display_xml_error($er, $xml);
}
libxml_clear_errors();
return $ret;
}
}
开发者ID:philum,项目名称:cms,代码行数:20,代码来源:test.php
示例19: 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));
$arr = explode('-', $code);
$id = '';
if (count($arr) == 4 && end($arr) == 1) {
list($rule_id, $id, $subject_id) = $arr;
$id = 'class_' . $id;
} else {
if (count($arr) == 4 && end($arr) == 2) {
list($rule_id, $id, $subject_id) = $arr;
$id = 'teacher_' . $id;
} else {
if (count($arr) == 4 && end($arr) == 3) {
list($rule_id, $id, $subject_id) = $arr;
$id = 'transcript_' . $id;
} else {
list($rule_id, $id, $subject_id) = $arr;
}
}
}
$rule_id = !is_null($rule_id) ? intval($rule_id) : 0;
if (!is_null($subject_id)) {
$subject_id = intval($subject_id);
} else {
$subject_id = 0;
}
if (!$rule_id || !$id) {
die('404 not found');
}
$cache_path = realpath('../../') . '/cache/html/report';
$file_name = "{$cache_path}/{$rule_id}/{$id}/{$subject_id}.html";
if (!file_exists($file_name)) {
die('404 not found');
}
echo get_file($file_name);
}
开发者ID:Vincent-Shen,项目名称:origin,代码行数:44,代码来源:report.php
示例20: Editor_CreateDirContent
function Editor_CreateDirContent($d)
{
$tplDir = $this->TemplatesDir();
$index = get_file($tplDir . '/index');
$up = content_get_up_to_root($d);
$index = preg_replace('/\\$\\{up_to_root\\}/', $up, $index);
create_file($d . '/index.php', $index);
for ($i = 0; $i < count($this->scripts); $i++) {
$s = $this->scripts[$i];
$mk = dirname($s['file']);
if ($mk != '' && $mk != '.' && !file_exists($d . '/' . $mk)) {
mkdir($d . '/' . $mk);
chmod($d . '/' . $mk, 0775);
}
$src = get_file($tplDir . '/' . $s['script']);
if (preg_match('/index\\.php$/', $s['file'])) {
$src = preg_replace('/\\$\\{up_to_root\\}/', $up, $src);
}
create_file($d . '/' . $s['file'], $src);
}
}
开发者ID:Nazg-Gul,项目名称:gate,代码行数:21,代码来源:00CCVirtual.php
注:本文中的get_file函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论