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

PHP file_put函数代码示例

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

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



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

示例1: data_save_mash

 function data_save_mash($data = array(), $userid = '', $config = array())
 {
     $err = '';
     $id = empty($data['id']) ? '' : $data['id'];
     if (!$id) {
         $err = 'Parameter id required';
     }
     if (!$err) {
         $path_data = path_concat($config['user_data_directory'], $userid);
         $file_json_path = path_concat(path_concat($config['web_root_directory'], $path_data), $id . '.json');
         $json_str = json_encode($data);
         // write file
         if (!file_put($file_json_path, $json_str, $config)) {
             $err = 'Problem writing ' . $file_json_path;
         }
     }
     if (!$err) {
         // add media data to existing media json file
         $new_media = array();
         $new_media['id'] = $id;
         $new_media['label'] = empty($data['label']) ? 'Untitled Mash' : $data['label'];
         $err = data_save('mash', $new_media, $userid, $config);
     }
     return $err;
 }
开发者ID:joshuacox,项目名称:angular-moviemasher,代码行数:25,代码来源:datautils.php


示例2: cache_set

function cache_set($file,$data,$dir='')
{
	if(!is_string($data))
		$data="<?php \r\ndefined('CURRENT_VERSION') or exit('Access Denied');\r\nreturn ".var_export($data, true).';';
	$file=$dir?"{$GLOBALS['config']['cache']['dir']}/{$dir}/{$file}":"{$GLOBALS['config']['cache']['dir']}/{$file}";
	return file_put($file,$data);
}
开发者ID:royalwang,项目名称:saivi,代码行数:7,代码来源:cache.file.func.php


示例3: extract_zip

 function extract_zip($zipfile, $dir)
 {
     if (function_exists('zip_open')) {
         $zip = zip_open($zipfile);
         if ($zip) {
             while ($zip_entry = zip_read($zip)) {
                 if (zip_entry_filesize($zip_entry) > 0) {
                     if (zip_entry_open($zip, $zip_entry, "r")) {
                         $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
                         zip_entry_close($zip_entry);
                         file_put($dir . '/' . zip_entry_name($zip_entry), $buf);
                     }
                 } else {
                     dir_create($dir . '/' . zip_entry_name($zip_entry));
                 }
             }
             zip_close($zip);
         }
     } else {
         $array = $this->list_zip($zipfile);
         $count = count($array);
         $f = 0;
         $d = 0;
         for ($i = 0; $i < $count; $i++) {
             if ($array[$i]['folder'] == 0) {
                 if ($this->extract_file($zipfile, $dir, $i) > 0) {
                     $f++;
                 }
             } else {
                 $d++;
             }
         }
     }
     return true;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:35,代码来源:unzip.class.php


示例4: set

 function set($key, $val, $ttl = 600)
 {
     global $db, $CFG;
     is_md5($key) or $key = md5($this->pre . $key);
     $ttl = $this->time + $ttl;
     $sql = "REPLACE INTO {$db->pre}cache (`cacheid`,`totime`) VALUES ('{$key}','{$ttl}')";
     strpos($CFG['database'], 'mysqli') !== false ? mysqli_query($db->connid, $sql) : mysql_query($sql, $db->connid);
     $val = '<?php exit;?>' . $ttl . (is_array($val) ? serialize($val) : '@' . $val);
     return file_put(DT_CACHE . '/php/' . substr($key, 0, 2) . '/' . $key . '.php', $val);
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:10,代码来源:cache_file.class.php


示例5: file_del_line

function file_del_line($filename, $line_number)
{
    #Opposite of file_ins_line
    if ($line_number < 1) {
        return FALSE;
    }
    $file_contents = file($filename);
    $file_contents[$line_number - 1] = "";
    file_put($filename, $file_contents);
}
开发者ID:madhavpanda,项目名称:iou-centerms,代码行数:10,代码来源:file.php


示例6: setUp

 public function setUp()
 {
     $this->isProject = getenv('IS_PROJECT');
     parent::setUp();
     // setup manifest
     $codexArr = json_decode(file_get($this->fixturesPath('codex.json')), true);
     $codexArr = Util::recursiveArrayStringReplace($codexArr, ['{vendor_dir}' => $this->basePath('vendor')]);
     file_put(storage_path('codex.json'), json_encode($codexArr));
     // setup misc
     file_touch(storage_path('codex.log'));
     $this->registerServiceProvider();
     $a = 'a';
 }
开发者ID:codexproject,项目名称:core,代码行数:13,代码来源:TestCase.php


示例7: template_name

function template_name($fileid = '', $name = '')
{
    global $template_root, $names;
    isset($names) or $names = array();
    if ($fileid && $name) {
        $names[$fileid] = $name;
    }
    foreach ($names as $k => $v) {
        if (!is_file($template_root . '/' . $k . '.htm') && !is_dir($template_root . '/' . $k)) {
            unset($names[$k]);
        }
    }
    if ($names) {
        ksort($names);
    }
    file_put($template_root . '/these.name.php', "<?php\n\$names = " . var_export($names, true) . ";\n?>");
}
开发者ID:hcd2008,项目名称:destoon,代码行数:17,代码来源:template.inc.php


示例8: local_client_enqueue

function local_client_enqueue($data, $config = array())
{
    $result = array();
    $err = '';
    $id = empty($data['id']) ? id_unique() : $data['id'];
    $result['id'] = $data['id'] = $id;
    $job_path = path_concat($config['queue_directory'], $id . '.json');
    $json_str = @json_encode($data);
    if (!$json_str) {
        $err = 'could not encode json';
    } else {
        file_safe($job_path);
        if (!file_put($job_path, $json_str)) {
            $err = 'could not write job to ' . $job_path;
        }
    }
    if ($err) {
        $result['error'] = $err;
    }
    return $result;
}
开发者ID:joshuacox,项目名称:angular-moviemasher,代码行数:21,代码来源:local.php


示例9: tag


//.........这里部分代码省略.........
        } else {
            if ($areachild) {
                $areaids = '';
                $result = $db->query("SELECT arrchildid FROM {$db->pre}area WHERE areaid IN ({$areaid})");
                while ($r = $db->fetch_array($result)) {
                    $areaids .= ',' . $r['arrchildid'];
                }
                if ($areaids) {
                    $areaid = substr($areaids, 1);
                }
            }
            $condition .= " AND areaid IN ({$areaid})";
        }
    }
    $table = isset($table) ? $prefix . $table : get_table($moduleid);
    $offset or $offset = ($page - 1) * $pagesize;
    $percent = dround(100 / $cols) . '%';
    $num = 0;
    $order = $order ? ' ORDER BY ' . $order : '';
    $condition = stripslashes($condition);
    $condition = str_replace('##', '%', $condition);
    if ($showpage) {
        $num = $db->count($table, $condition, $tag_expires ? $tag_expires : $CFG['db_expires']);
        $pages = $catid ? listpages(get_cat($catid), $num, $page, $pagesize) : pages($num, $page, $pagesize);
    } else {
        if ($group) {
            $condition .= ' GROUP BY ' . $group;
        }
    }
    if ($page < 2 && strpos($parameter, '&page=') !== false) {
        $db_cache = 'CACHE';
        $tag_expires = $CFG['tag_expires'];
    }
    if ($template == 'null') {
        $db_cache = 'CACHE';
    }
    $query = "SELECT " . $fields . " FROM " . $table . " WHERE " . $condition . $order . " LIMIT " . $offset . "," . $pagesize;
    if ($debug) {
        echo $parameter . '<br/>' . $query . '<br/>';
    }
    $tags = $catids = $CATS = array();
    $result = $db->query($query, $db_cache, $tag_expires);
    while ($r = $db->fetch_array($result)) {
        if ($moduleid == 4 && isset($r['company'])) {
            $r['alt'] = $r['companyname'] = $r['company'];
            if ($length) {
                $r['company'] = dsubstr($r['company'], $length);
            }
        }
        if (isset($r['title'])) {
            $r['title'] = str_replace('"', '&quot;', trim($r['title']));
            $r['alt'] = $r['title'];
            if ($length) {
                $r['title'] = dsubstr($r['title'], $length);
            }
            if (isset($r['style']) && $r['style']) {
                $r['title'] = set_style($r['title'], $r['style']);
            }
        }
        if ($lazy && isset($r['thumb']) && $r['thumb']) {
            $r['thumb'] = DT_SKIN . 'image/lazy.gif" class="lazy" original="' . $r['thumb'];
        }
        if (isset($r['introduce']) && $introduce) {
            $r['introduce'] = dsubstr($r['introduce'], $introduce);
        }
        if (isset($r['linkurl']) && $r['linkurl'] && $moduleid > 4 && strpos($r['linkurl'], '://') === false) {
            $r['linkurl'] = $MODULE[$moduleid]['linkurl'] . $r['linkurl'];
        }
        if ($showcat && $moduleid > 4 && isset($r['catid'])) {
            $catids[$r['catid']] = $r['catid'];
        }
        $tags[] = $r;
    }
    $db->free_result($result);
    if ($showcat && $moduleid > 4 && $catids) {
        $result = $db->query("SELECT catid,catname,linkurl FROM {$db->pre}category WHERE catid IN (" . implode(',', $catids) . ")");
        while ($r = $db->fetch_array($result)) {
            $CATS[$r['catid']] = $r;
        }
        if ($CATS) {
            foreach ($tags as $k => $v) {
                $tags[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : '';
                $tags[$k]['caturl'] = $v['catid'] ? $MODULE[$moduleid]['linkurl'] . $CATS[$v['catid']]['linkurl'] : '';
            }
        }
    }
    if ($template == 'null') {
        return $tags;
    }
    if ($tag_cache) {
        ob_start();
        include template($template, $dir);
        $contents = ob_get_contents();
        ob_clean();
        file_put($TCF, '<!--' . ($DT_TIME + $tag_expires) . '-->' . $contents);
        echo $contents;
    } else {
        include template($template, $dir);
    }
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:101,代码来源:tag.func.php


示例10: intval

            $data .= '<lastmod>' . $today . '</lastmod>';
            $data .= '<changefreq>hourly</changefreq>';
            $data .= '<priority>0.9</priority>';
            $data .= '<data><display></display></data>';
            $data .= '</url>';
        }
        $item = '';
        $nums = intval($MOD['sitemaps_items']);
        if ($nums) {
            $fields = $mid == 4 ? 'linkurl' : 'linkurl,edittime';
            $order = $mid == 4 ? 'userid' : 'addtime';
            $condition = $mid == 4 ? "catids<>''" : "status>2";
            $result = $db->query("SELECT {$fields} FROM " . get_table($mid) . " WHERE {$condition} ORDER BY {$order} DESC LIMIT {$nums}");
            while ($r = $db->fetch_array($result)) {
                $item .= '<url>';
                $item .= '<loc>' . xml_linkurl($r['linkurl'], $url) . '</loc>';
                $item .= '<lastmod>' . ($mid == 4 ? $today : timetodate($r['edittime'], 3)) . '</lastmod>';
                $item .= '<changefreq>' . $MOD['sitemaps_changefreq'] . '</changefreq>';
                $item .= '<priority>' . $MOD['sitemaps_priority'] . '</priority>';
                $item .= '<data><display></display></data>';
                $item .= '</url>';
            }
        }
        $data .= $item;
        $data .= '</urlset>';
        $data = str_replace('><', ">\n<", $data);
        $data = convert($data, DT_CHARSET, 'UTF-8');
        file_put(DT_ROOT . '/' . $MODULE[$mid]['moduledir'] . '/sitemaps.xml', $data);
    }
}
return true;
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:sitemaps.htm.php


示例11: dheader

    dheader($MODULE[2]['linkurl'] . $DT['file_my']);
}
require DT_ROOT . '/module/' . $module . '/common.inc.php';
if ($action == 'logout' && $admin_user) {
    set_cookie('admin_user', '');
    dmsg($L['index_msg_logout'], $MODULE[2]['linkurl']);
}
require MD_ROOT . '/member.class.php';
require DT_ROOT . '/include/post.func.php';
$do = new member();
if ($submit) {
    if (word_count($note) > 1000) {
        message($L['index_msg_note_limit']);
    }
    $note = '<?php exit;?>' . htmlspecialchars(stripslashes($note));
    file_put(DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/note.php', $note);
    dmsg($L['op_update_success'], $MODULE[2]['linkurl']);
} else {
    $head_title = '';
    $do->userid = $_userid;
    $user = $do->get_one();
    extract($user);
    $logintime = timetodate($logintime, 5);
    $regtime = timetodate($regtime, 5);
    $userurl = userurl($_username, '', $domain);
    $sys = array();
    $i = 0;
    $result = $db->query("SELECT itemid,title,addtime,groupids FROM {$DT_PRE}message WHERE groupids<>'' ORDER BY itemid DESC", 'CACHE');
    while ($r = $db->fetch_array($result)) {
        $groupids = explode(',', $r['groupids']);
        if (!in_array($_groupid, $groupids)) {
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:index.inc.php


示例12: mt_rand

         $offset = ($page - 1) * $pagesize;
         if ($page == 1) {
             $random = $title ? $title : mt_rand(1000, 9999);
         }
         $mail = '';
         $query = "SELECT {$field} FROM {$tb} WHERE {$sql} LIMIT {$offset},{$pagesize}";
         $key = strpos($field, '.') === false ? $field : file_ext($field);
         $result = $db->query($query);
         while ($r = $db->fetch_array($result)) {
             if ($r[$key]) {
                 $mail .= $r[$key] . "\r\n";
             }
         }
         if ($mail) {
             $filename = timetodate($DT_TIME, 'Ymd') . '_' . $random . '_' . $page . '.txt';
             file_put(DT_ROOT . '/file/email/' . $filename, trim($mail));
             $page++;
             msg('文件' . $filename . '获取成功。<br/>请稍候,程序将自动继续...', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action . '&tb=' . urlencode($tb) . '&field=' . urlencode($field) . '&sql=' . urlencode(base64_encode($sql)) . '&num=' . $num . '&page=' . $page . '&random=' . urlencode($random) . '&make=1');
         } else {
             msg('列表获取成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=list');
         }
     } else {
         include tpl('sendmail_make', $module);
     }
     break;
 case 'download':
     $file_ext = file_ext($filename);
     $file_ext == 'txt' or msg('只能下载TxT文件');
     file_down(DT_ROOT . '/file/email/' . $filename);
     break;
 case 'upload':
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:sendmail.inc.php


示例13: sprintf

 if ($sql_dir && 'load' == $post['perform']) {
     $file = $sql_dir . '/' . $post['load_from'];
     if (array_key_exists($post['load_from'], $load_assoc) && file_exists($file)) {
         $msg .= sprintf('<div>Sql loaded: %s (%s)</div>', basename($file), timestamp(file_date($file)));
         $post['sql'] = file_get($file);
         $post['save_as'] = basename($file);
         $post['save_as'] = str_replace('.sql', '', $post['save_as']);
     } else {
         error('<div>File not found: %s</div>', $file);
     }
 }
 // after load - md5 may change
 $md5 = md5($post['sql']);
 if ($sql_dir && 'load' == $post['perform'] && !error()) {
     $md5_tmp = sprintf($sql_dir . '/zzz_%s.dat', $md5);
     file_put($md5_tmp, $post['sql']);
 }
 $is_sel = false;
 $queries = preg_split("#;(\\s*--[ \t\\S]*)?(\r\n|\n|\r)#U", $post['sql']);
 foreach ($queries as $k => $query) {
     $query = query_strip($query);
     if (str_starts_with($query, '@')) {
         $is_sel = true;
     }
     $queries[$k] = $query;
     if (!trim($query)) {
         unset($queries[$k]);
     }
 }
 $sql_assoc = array();
 $sql_selected = false;
开发者ID:rubencamargogomez,项目名称:custom_properties,代码行数:31,代码来源:dbkiss.php


示例14: defined

<?php

defined('IN_DESTOON') or exit('Access Denied');
if (!$MOD['announce_html'] || !$itemid) {
    return false;
}
$item = $db->get_one("SELECT * FROM {$DT_PRE}announce WHERE itemid={$itemid} AND islink=0");
if (!$item) {
    return false;
}
extract($item);
$TYPE = get_type('announce', 1);
$adddate = timetodate($addtime, 3);
$fromdate = $fromtime ? timetodate($fromtime, 3) : $L['timeless'];
$todate = $totime ? timetodate($totime, 3) : $L['timeless'];
$head_title = $head_keywords = $head_description = $title . $DT['seo_delimiter'] . $L['announce_title'];
$destoon_task = "moduleid={$moduleid}&html=announce&itemid={$itemid}";
$template = $item['template'] ? $item['template'] : 'announce';
ob_start();
include template($template, $module);
$data = ob_get_contents();
ob_clean();
file_put(DT_ROOT . '/announce/' . $itemid . '.' . $DT['file_ext'], $data);
return true;
开发者ID:hcd2008,项目名称:destoon,代码行数:24,代码来源:announce.htm.php


示例15: server_update_points

function server_update_points($server)
{
    global $no_ranking_clusters;
    mysql_select_db(dbname($server));
    file_put('data/calc-stat.dat', 'Berechnung von Server $server ...');
    ignore_user_abort(0);
    $clusters = array();
    // Alle Datens&auml;tze zurcksetzen,
    // damit es bei herrenlosen PCs keine falschen Anzeigen gibt:
    #db_query('UPDATE pcs SET owner_name=\'\', owner_points=0, owner_cluster=0, owner_cluster_code=\'\';');
    $current = 0;
    $u_result = db_query('SELECT * FROM users');
    $total = mysql_num_rows($u_result);
    while ($user = mysql_fetch_assoc($u_result)) {
        $current++;
        $upoints = 0;
        if ($current % 100 == 0) {
            file_put('data/calc-stat.dat', 'Berechnung von Server ' . $server . ' ... ' . $current . ' / ' . $total);
        }
        $pc_result = db_query('SELECT * FROM pcs WHERE owner=\'' . mysql_escape_string($user['id']) . '\';');
        $pc_cnt = mysql_num_rows($pc_result);
        while ($pc = mysql_fetch_assoc($pc_result)) {
            processupgrades($pc);
            $pcpoints = getpcpoints($pc, 'bydata');
            db_query('UPDATE pcs SET points=\'' . mysql_escape_string($pcpoints) . '\' WHERE id=\'' . mysql_escape_string($pc['id']) . '\';');
            $upoints += $pcpoints;
        }
        #reset($pcs);
        #foreach($pcs As $pcid):
        #$sql='UPDATE pcs SET owner_points=$upoints,owner_name=\''.mysql_escape_string($user['name']).'\' ';
        #$cluster=getcluster($user['cluster']);
        #if($cluster!==false) {
        #  $sql.=',owner_cluster='.mysql_escape_string($cluster['id']).', owner_cluster_code=\''.mysql_escape_string($cluster['code']).'\' ';
        #}
        #$sql.='WHERE id=\''.mysql_escape_string($pcid).'\'';
        #db_query($sql);
        #endforeach;
        $c = $user['cluster'];
        if ($c != '' && $c != 0) {
            #$r=db_query('SELECT id FROM clusters WHERE id=\''.mysql_escape_string($c).'\' LIMIT 1');
            #if(mysql_num_rows($r)>0) {
            $clusters['c' . $c]['points'] += $upoints;
            $clusters['c' . $c]['members'] += 1;
            $clusters['c' . $c]['pcs'] += $pc_cnt;
            #}
        }
        if (is_noranKINGuser($user['id']) == false && $user['id'] != 6249 && $user['id'] != 19061) {
            $rank[$user['id'] . ';' . $user['name'] . ';' . $user['cluster']] = $upoints;
        } else {
            db_query('UPDATE users SET points=\'' . mysql_escape_string($upoints) . '\',rank=\'0\' WHERE id=\'' . mysql_escape_string($user['id']) . '\';');
        }
    }
    #$pcinfo=gettableinfo('pcs',dbname($server));
    #file_put('data/_server'.$server.'/pc-count.dat', $pcinfo['Rows']);
    file_put('data/_server' . $server . '/user-count.dat', mysql_num_rows($u_result));
    ignore_user_abort(0);
    file_put('data/calc-stat.dat', 'Berechnung von Server ' . $server . ' ... Berechnung abgeschlossen: Schreiben in DB ...');
    arsort($rank);
    db_query('TRUNCATE TABLE rank_users');
    # Tabelle leeren
    #$platz=0;
    while (list($dat, $points) = each($rank)) {
        #$platz++;
        $dat = explode(';', $dat);
        $dat[2] = (int) $dat[2];
        db_query('INSERT INTO rank_users VALUES(0, ' . mysql_escape_string($dat[0]) . ', \'' . mysql_escape_string($dat[1]) . '\', ' . mysql_escape_string($points) . ', ' . mysql_escape_string($dat[2]) . ');');
        db_query('UPDATE users SET points=' . mysql_escape_string($points) . ', rank=' . mysql_insert_id() . ' WHERE id=' . mysql_escape_string($dat[0]) . ' LIMIT 1;');
    }
    #file_put('data/_server'.$server.'/rank-user-count.dat', count($rank));
    db_query('TRUNCATE TABLE rank_clusters');
    # Tabelle leeren
    unset($b);
    settype($b, 'array');
    while (list($bez, $val) = each($clusters)) {
        $b[$bez] = $clusters[$bez]['points'];
    }
    arsort($b);
    unset($c);
    settype($c, 'array');
    while (list($bez, $val) = each($b)) {
        $c[$bez]['points'] = $val;
        $c[$bez]['pcs'] = $clusters[$bez]['pcs'];
        $c[$bez]['members'] = $clusters[$bez]['members'];
    }
    while (list($bez, $dat) = each($c)) {
        $bez = substr($bez, 1);
        $av_p = round($dat['points'] / $dat['members'], 2);
        $av_pcs = round($dat['pcs'] / $dat['members'], 2);
        // SUCCESS RATE CALCULATION START
        $cluster = getcluster($bez);
        $total = $cluster['srate_total_cnt'];
        $scnt = $cluster['srate_success_cnt'];
        $ncnt = $cluster['srate_noticed_cnt'];
        if ($total > 0) {
            $psucceeded = $scnt * 100 / $total;
            $pnoticed = $ncnt * 100 / $total;
            // Erfolg ist gut und zählt 75%
            // Bemerkt ist schlecht (deshalb 100-$pnoticed) und z&auml;hlt 25%
            $srate = $psucceeded * 0.75 + (100 - $pnoticed) * 0.25;
        } else {
//.........这里部分代码省略.........
开发者ID:dergriewatz,项目名称:htn-original,代码行数:101,代码来源:calc_points.php


示例16: install_file

function install_file($file, $dir, $extend = 0)
{
    $content = "<?php\n";
    if ($extend == 1) {
        $content .= "define('DT_REWRITE', true);\n";
    }
    $content .= "require 'config.inc.php';\n";
    $content .= "require '../common.inc.php';\n";
    $content .= "require DT_ROOT.'/module/'.\$module.'/" . $file . ".inc.php';\n";
    $content .= '?>';
    return file_put(DT_ROOT . '/' . $dir . '/' . $file . '.php', $content);
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:12,代码来源:global.func.php


示例17: defined

<?php

defined('IN_DESTOON') or exit('Access Denied');
if (!$_userid) {
    exit;
}
isset($MODULE[$mid]) or exit;
if ($job == 'get') {
    $file = DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/editor.data.' . $mid . '.php';
    $content = file_get($file);
    if ($content) {
        echo substr($content, 13);
    } else {
        echo '';
    }
} else {
    if (!$content) {
        exit;
    }
    $content = stripslashes($content);
    $content = convert($content, 'UTF-8', DT_CHARSET);
    $content = '<?php exit;?>' . timetodate($DT_TIME) . $content;
    file_put(DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/editor.data.' . $mid . '.php', $content);
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:24,代码来源:userdata.inc.php


示例18: isset

             }
         }
     }
     $sqldump = '';
     $tableid = isset($tableid) ? $tableid - 1 : 0;
     $startfrom = isset($startfrom) ? intval($startfrom) : 0;
     $tablenumber = count($tables);
     for ($i = $tableid; $i < $tablenumber && strlen($sqldump) < $sizelimit * 1000; $i++) {
         $sqldump .= sql_dumptable($tables[$i], $startfrom, strlen($sqldump));
         $startfrom = 0;
     }
     if (trim($sqldump)) {
         $sqldump = "# Destoon V" . DT_VERSION . " R" . DT_RELEASE . " http://www.destoon.com\n# " . timetodate($DT_TIME, 6) . "\n# --------------------------------------------------------\n\n\n" . $sqldump;
         $tableid = $i;
         $filename = $random . '/' . $fileid . '.sql';
         file_put($D . $filename, $sqldump);
         $fid = $fileid;
         msg('分卷 <strong>#' . $fileid++ . '</strong> 备份成功.. 程序将自动继续...' . progress(0, $fid, $tid), '?file=' . $file . '&sizelimit=' . $sizelimit . '&sqlcompat=' . $sqlcompat . '&sqlcharset=' . $sqlcharset . '&tableid=' . $tableid . '&fileid=' . $fileid . '&fileid=' . $fileid . '&tid=' . $tid . '&startfrom=' . $startrow . '&random=' . $random . '&backup=1');
     } else {
         cache_delete($_username . '_backup.php');
         $db->query("DELETE FROM {$DT_PRE}setting WHERE item='destoon' AND item_key='backtime'");
         $db->query("INSERT INTO {$DT_PRE}setting (item,item_key,item_value) VALUES('destoon','backtime','{$DT_TIME}')");
         msg('数据库备份成功', '?file=' . $file . '&action=import');
     }
 } else {
     $dtables = $tables = $C = $T = array();
     $i = $j = $dtotalsize = $totalsize = 0;
     $result = $db->query("SHOW TABLES FROM `" . $CFG['db_name'] . "`");
     while ($rr = $db->fetch_row($result)) {
         if (!$rr[0]) {
             continue;
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:database.inc.php


示例19: exit

             $db->query("UPDATE {$table} SET {$sql} WHERE chatid='{$chatid}'");
         } else {
             exit('ko');
         }
     }
 } else {
     exit('ko');
 }
 $filename = get_chat_file($chatid);
 if (is_file($filename)) {
     if (filesize($filename) > 500 * 1024) {
         file_copy($filename, substr($filename, 0, -4) . '-' . timetodate($DT_TIME, 'YmdHis') . '.php');
         file_put($filename, '<?php exit;?>');
     }
 } else {
     file_put($filename, '<?php exit;?>');
 }
 $font_s = $font_s ? intval($font_s) : 0;
 $font_c = $font_c ? intval($font_c) : 0;
 $font_b = $font_b ? 1 : 0;
 $font_i = $font_i ? 1 : 0;
 $font_u = $font_u ? 1 : 0;
 $css = '';
 if ($font_s) {
     $css .= ' s' . $font_s;
 }
 if ($font_c) {
     $css .= ' c' . $font_c;
 }
 if ($font_b) {
     $css .= ' fb';
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:chat.php


示例20: write_session_data

function write_session_data()
{
    global $usrid, $pcid, $sid, $server;
    file_put('data/login/' . $sid . '.txt', $server . "\v" . $usrid . "\v" . $pcid);
}
开发者ID:dergriewatz,项目名称:htn-original,代码行数:5,代码来源:gres.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP file_put_contents函数代码示例发布时间:2022-05-15
下一篇:
PHP file_prepare_standard_filemanager函数代码示例发布时间: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