本文整理汇总了PHP中fileWrite函数的典型用法代码示例。如果您正苦于以下问题:PHP fileWrite函数的具体用法?PHP fileWrite怎么用?PHP fileWrite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fileWrite函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: file
/**
* 数据库缓存到本地文件
* @return unknown
*/
public function file()
{
$arrCache = $this->findAll('cache');
foreach ($arrCache as $key => $item) {
fileWrite($item['cachename'] . '.php', 'data', $this->get($item['cachename']));
}
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:11,代码来源:tsMySqlCache.php
示例2: optionsdo
public function optionsdo()
{
//先清空数据
$this->doSql("TRUNCATE TABLE `" . dbprefix . "weibo_options`");
foreach ($_POST['option'] as $key => $item) {
$optionname = $key;
$optionvalue = trim($item);
$this->create('weibo_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
}
$arrOptions = $this->findAll('weibo_options', null, null, 'optionname,optionvalue');
foreach ($arrOptions as $item) {
$arrOption[$item['optionname']] = $item['optionvalue'];
}
fileWrite('weibo_options.php', 'data', $arrOption);
$GLOBALS['tsMySqlCache']->set('weibo_options', $arrOption);
qiMsg('修改成功!');
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:17,代码来源:admin.weibo.php
示例3: __autoload
function __autoload($class_name)
{
$file = ROOT_PATH . 'include/table/' . $class_name . '.class.php';
if (!file_exists($file)) {
$file = ROOT_PATH . 'include/class/' . $class_name . '.class.php';
if (!file_exists($file)) {
$file = ROOT_PATH . 'include/class/' . $class_name . '/' . $class_name . '.class.php';
if (!file_exists($file)) {
$str = file_get_contents(ROOT_PATH . 'include/template.php');
$str = str_replace('CLASSNAME', $class_name, $str);
fileWrite(ROOT_PATH . 'cache/', 'tmpclass.php', $str);
$file = ROOT_PATH . 'cache/' . 'tmpclass.php';
}
}
}
include_once $file;
}
开发者ID:austinliniware,项目名称:tsci-rota,代码行数:17,代码来源:common.fun.php
示例4: defined
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
//基本配置
case "":
$arrOptions = $new['redeem']->findAll('redeem_options');
foreach ($arrOptions as $item) {
$strOption[$item['optionname']] = stripslashes($item['optionvalue']);
}
include template("admin/options");
break;
case "do":
//先清空数据
$db->query("TRUNCATE TABLE `" . dbprefix . "redeem_options`");
foreach ($_POST['option'] as $key => $item) {
$optionname = $key;
$optionvalue = trim($item);
$new['redeem']->create('redeem_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
}
$arrOptions = $new['redeem']->findAll('redeem_options', null, null, 'optionname,optionvalue');
foreach ($arrOptions as $item) {
$arrOption[$item['optionname']] = $item['optionvalue'];
}
fileWrite('redeem_options.php', 'data', $arrOption);
$tsMySqlCache->set('redeem_options', $arrOption);
qiMsg('修改成功!');
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:29,代码来源:options.php
示例5: defined
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
//角色列表
case "list":
$arrRole = $new['user']->findAll('user_role');
include template('admin/role_list');
break;
//角色修改
//角色修改
case "do":
$arrRoleName = $_POST['rolename'];
$arrScoreStart = $_POST['score_start'];
$arrScoreEnd = $_POST['score_end'];
//先清空
$db->query("TRUNCATE TABLE `" . dbprefix . "user_role`");
//后添加
foreach ($arrRoleName as $key => $item) {
$rolename = trim($item);
$score_start = trim($arrScoreStart[$key]);
$score_end = trim($arrScoreEnd[$key]);
if ($rolename) {
$new['user']->create('user_role', array('rolename' => $rolename, 'score_start' => $score_start, 'score_end' => $score_end));
}
}
//再生成缓存文件
$arrRole = $new['user']->findAll('user_role', null, null, 'rolename,score_start,score_end');
fileWrite('user_role.php', 'data', $arrRole);
$tsMySqlCache->set('user_role', $arrRole);
qiMsg("修改成功!");
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:role.php
示例6: array
$new['group']->create('group_user', array('userid' => $iuserid, 'groupid' => $groupid, 'addtime' => time()));
//计算小组会员数
$count_user = $new['group']->findCount('group_user', array('groupid' => $groupid));
//更新小组成员统计
$new['group']->update('group', array('groupid' => $groupid), array('count_user' => $count_user));
//发送系统消息开始
$msg_userid = '0';
$msg_touserid = $iuserid;
$msg_content = '你被邀请加入一个小组,快去看看吧<br />' . tsUrl('group', 'show', array('id' => $groupid));
aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content);
//发送系统消息end
header('Location: ' . tsUrl('group', 'show', array('id' => $groupid)));
} else {
tsNotice('倒霉了吧?');
}
break;
//usertips
//usertips
case "usertips":
$data = fileRead('data/user_tips.php');
if ($data == '') {
$query = $db->fetch_all_assoc("select * from " . dbprefix . "user_info");
foreach ($query as $user) {
$usertip[] = array('user' => $user['username'], 'name' => $user['userid']);
}
fileWrite('user_tips.php', 'data', json_encode($usertip));
$data = fileRead('data/user_tips.php');
}
echo $data;
break;
}
开发者ID:GithuberFan,项目名称:ThinkSAAS,代码行数:31,代码来源:do.php
示例7: store_data
/**
* Writes the data to the config files
*
* @author Chris Smith <[email protected]>
*/
function store_data($d)
{
global $LC;
$ok = true;
$d['policy'] = (int) $d['policy'];
// create local.php
$now = gmdate('r');
$output = <<<EOT
<?php
/**
* Dokuwiki's Main Configuration File - Local Settings
* Auto-generated by install script
* Date: {$now}
*/
EOT;
$output .= '$conf[\'title\'] = \'' . addslashes($d['title']) . "';\n";
$output .= '$conf[\'lang\'] = \'' . addslashes($LC) . "';\n";
$output .= '$conf[\'license\'] = \'' . addslashes($d['license']) . "';\n";
if ($d['acl']) {
$output .= '$conf[\'useacl\'] = 1' . ";\n";
$output .= "\$conf['superuser'] = '@admin';\n";
}
$ok = $ok && fileWrite(DOKU_LOCAL . 'local.php', $output);
if ($d['acl']) {
// hash the password
$phash = new PassHash();
$pass = $phash->hash_smd5($d['password']);
// create users.auth.php
// --- user:SMD5password:Real Name:email:groups,comma,seperated
$output = join(":", array($d['superuser'], $pass, $d['fullname'], $d['email'], 'admin,user'));
$output = @file_get_contents(DOKU_CONF . 'users.auth.php.dist') . "\n{$output}\n";
$ok = $ok && fileWrite(DOKU_LOCAL . 'users.auth.php', $output);
// create acl.auth.php
$output = <<<EOT
# acl.auth.php
# <?php exit()?>
# Don't modify the lines above
#
# Access Control Lists
#
# Auto-generated by install script
# Date: {$now}
EOT;
if ($d['policy'] == 2) {
$output .= "* @ALL 0\n";
$output .= "* @user 8\n";
} elseif ($d['policy'] == 1) {
$output .= "* @ALL 1\n";
$output .= "* @user 8\n";
} else {
$output .= "* @ALL 8\n";
}
$ok = $ok && fileWrite(DOKU_LOCAL . 'acl.auth.php', $output);
}
return $ok;
}
开发者ID:nextghost,项目名称:dokuwiki,代码行数:63,代码来源:install.php
示例8: defined
<?php
defined('IN_TS') or die('Access Denied.');
//插件编辑
switch ($ts) {
//编辑
case "set":
$arrData = fileRead('data/plugins_pubs_wordad.php');
if ($arrData == '') {
$arrData = $tsMySqlCache->get('plugins_pubs_wordad');
}
include 'edit.html';
break;
//执行编辑
//执行编辑
case "do":
$arrTitle = $_POST['title'];
$arrUrl = $_POST['url'];
foreach ($arrTitle as $key => $item) {
$title = trim($item);
$url = trim($arrUrl[$key]);
if ($title && $url) {
$arrData[] = array('title' => $title, 'url' => $url);
}
}
fileWrite('plugins_pubs_wordad.php', 'data', $arrData);
$tsMySqlCache->set('plugins_pubs_wordad', $arrData);
header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=wordad&in=edit&ts=set');
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:30,代码来源:edit.php
示例9: mktime
$smarty->caching = false;
$smarty->cache_lifetime = $CONFIG['SMARTY_CACHE_LIFETIME'];
$smarty->template_dir = '../tpl';
$smarty->compile_dir = '../cache/tpl_c';
$smarty->cache_dir = '../cache/html';
$smarty->assign('PHPDL_INSTALLED', mktime());
$smarty->assign('DB_HOST', $DB_HOST);
$smarty->assign('DB_NAME', $DB_NAME);
$smarty->assign('DB_USER', $DB_USER);
$smarty->assign('DB_PASS', $DB_PASS);
$smarty->assign('WGET', $WGET);
$smarty->assign('PS', $PS);
$smarty->assign('USER_PASSWORD_SALT', $USER_PASSWORD_SALT);
$smarty->assign('USER_SESSION_TTL', $USER_SESSION_TTL);
if (fileWrite($CONFIG_PATH, $smarty->fetch($CONFIG_TPL_PATH))) {
if (fileWrite('INSTALLED', date('Y-m-d H:i:s'))) {
htmlInstallFinished();
}
} else {
print '<b><font color="#cc0000">Installation failed</font></b>';
}
} else {
print '<b><font color="#cc0000">Installation failed. No Smarty available!</font></b>';
}
htmlFooter();
break;
case 'mysqlCheckConnection':
$_SESSION['DB_HOST'] = $_GET['DB_HOST'];
$_SESSION['DB_NAME'] = $_GET['DB_NAME'];
$_SESSION['DB_USER'] = $_GET['DB_USER'];
$_SESSION['DB_PASS'] = $_GET['DB_PASS'];
开发者ID:TheFox,项目名称:phpdl,代码行数:31,代码来源:install.php
示例10: defined
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
//配置
case "":
$arrOptions = $new['user']->findAll('user_options');
foreach ($arrOptions as $item) {
$strOption[$item['optionname']] = $item['optionvalue'];
}
include template("admin/options");
break;
//配置执行
//配置执行
case "do":
//先清空数据
$db->query("TRUNCATE TABLE `" . dbprefix . "user_options`");
foreach ($_POST['option'] as $key => $item) {
$optionname = $key;
$optionvalue = trim($item);
$new['user']->create('user_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
}
$arrOptions = $new['user']->findAll('user_options', null, null, 'optionname,optionvalue');
foreach ($arrOptions as $item) {
$arrOption[$item['optionname']] = $item['optionvalue'];
}
fileWrite('user_options.php', 'data', $arrOption);
$tsMySqlCache->set('user_options', $arrOption);
qiMsg("用户APP配置成功!");
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:options.php
示例11: foreach
//生成缓存
$arrIps = $new['system']->findAll('anti_ip');
foreach ($arrIps as $key => $item) {
$arrIp[] = $item['ip'];
}
fileWrite('system_anti_ip.php', 'data', $arrIp);
$tsMySqlCache->set('system_anti_ip', $arrIp);
}
qiMsg('垃圾IP添加成功!');
} else {
qiMsg('垃圾IP不能为空!');
}
break;
case "ipdel":
$id = intval($_GET['id']);
$new['system']->delete('anti_ip', array('id' => $id));
//生成缓存
$arrIps = $new['system']->findAll('anti_ip');
foreach ($arrIps as $key => $item) {
$arrIp[] = $item['ip'];
}
fileWrite('system_anti_ip.php', 'data', $arrIp);
$tsMySqlCache->set('system_anti_ip', $arrIp);
qiMsg('删除成功!');
break;
//云词
//云词
case "cloud":
include template('anti_cloud');
break;
}
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:31,代码来源:anti.php
示例12: main
function main()
{
global $CONFIG, $SCHEDULER_LAST;
print "\n";
printd("start\n");
printd("cwd: " . getcwd() . "\n");
$date = date('Ymd');
fileWrite($CONFIG['PHPDL_STACK_PIDFILE'], posix_getpid());
$n = 0;
while (!$SHUTDOWN) {
$n++;
$dbh = dbConnect();
$scheduler = scheduler($dbh);
$filesDownloading = filesDownloading($dbh);
if ($SCHEDULER_LAST != $scheduler) {
plog("scheduler '{$scheduler}' matched\n");
$SCHEDULER_LAST = $scheduler;
}
$res = mysql_query("select id from packets where archive = '0' and active = '1' and ftime = '0' order by sortnr, id;", $dbh);
if (mysql_num_rows($res)) {
while ($row = mysql_fetch_assoc($res)) {
$packet = new dlpacket($CONFIG['DB_HOST'], $CONFIG['DB_NAME'], $CONFIG['DB_USER'], $CONFIG['DB_PASS']);
if ($packet->loadById($row['id'])) {
$packetDirBn = getPacketFilename($packet->get('id'), $packet->get('name'));
$packetDownloadDir = 'downloads/loading/' . $packetDirBn;
$packetFinishedDir = 'downloads/finished/' . $packetDirBn;
if ($packet->loadFiles()) {
if ($packet->filesUnfinished()) {
if ($scheduler > 0) {
if ($filesDownloading < $CONFIG['DL_SLOTS']) {
if (!$packet->get('stime')) {
$packet->save('stime', mktime());
}
if ($nextfile = $packet->getFileNextUnfinished()) {
while ($nextfile->get('error')) {
printd("nextfile " . $nextfile->get('id') . "\n");
$nextfile = $packet->getFileNextUnfinished();
if (!$nextfile) {
break;
}
sleep(1);
}
if ($nextfile) {
printd("packet " . $packet->get('id') . ": download " . $nextfile->get('id') . "\n");
$sh = 'php wget.php ' . $nextfile->get('id') . ' 1>> log/wget.' . $date . '.log 2>> log/wget.' . $date . '.log &';
printd("exec '{$sh}'\n");
system($sh);
sleep(1);
break;
}
}
} else {
plog("no free download slots (" . $CONFIG['DL_SLOTS'] . ")\n");
}
}
} else {
printd("packet " . $packet->get('id') . ": all files finished\n");
if (!$packet->get('stime')) {
$packet->set('stime', mktime());
}
$packet->save('ftime', mktime());
$packet->md5Verify();
$packet->sizeVerify();
if (!$packet->fileErrors()) {
if (file_exists($packetFinishedDir)) {
$files = scandir($packetDownloadDir);
foreach ($files as $file) {
if ($file != '.' && $file != '..' && file_exists($packetDownloadDir . '/' . $file)) {
rename($packetDownloadDir . '/' . $file, $packetFinishedDir . '/' . $file);
}
}
reset($files);
rmdir($packetDownloadDir);
} else {
rename($packetDownloadDir, $packetFinishedDir);
}
}
}
}
}
unset($packet);
}
} else {
plog("no active download\n");
}
dbClose($dbh);
$SHUTDOWN = shutdownCheck();
sleep(5);
}
shutdown();
}
开发者ID:TheFox,项目名称:phpdl,代码行数:91,代码来源:stack.php
示例13: qiMsg
qiMsg("插件停用成功!");
} elseif ($isused == '1') {
array_push($app_plugins, $pname);
if (file_exists('plugins/' . $apps . '/' . $pname . '/install.sql')) {
$sql = file_get_contents('plugins/' . $apps . '/' . $pname . '/install.sql');
$sql = str_replace('ts_', '' . dbprefix . '', $sql);
$ret = $db->query($sql);
if ($ret == '1') {
fileWrite($apps . '_plugins.php', 'data', $app_plugins);
$tsMySqlCache->set($apps . '_plugins', $app_plugins);
$msg = '插件启用成功!';
} else {
$msg = $ret;
}
} else {
fileWrite($apps . '_plugins.php', 'data', $app_plugins);
$tsMySqlCache->set($apps . '_plugins', $app_plugins);
$msg = '插件启用成功!';
}
qiMsg($msg);
}
break;
//删除插件
//删除插件
case "delete":
$apps = tsUrlCheck($_GET['apps']);
$pname = tsUrlCheck($_GET['pname']);
delDir('plugins/' . $apps . '/' . $pname);
qiMsg('删除成功!');
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:plugin.php
示例14: array
*/
//导航
case "appnav":
$appkey = $_POST['appkey'];
$appname = $_POST['appname'];
$arrNav = (include 'data/system_appnav.php');
if (is_array($arrNav)) {
$arrNav[$appkey] = $appname;
} else {
$arrNav = array($appkey => $appname);
}
foreach ($arrNav as $key => $item) {
if (!is_dir('app/' . $key)) {
unset($arrNav[$key]);
}
}
fileWrite('system_appnav.php', 'data', $arrNav);
$tsMySqlCache->set('system_appnav', $arrNav);
echo '1';
break;
//取消导航
//取消导航
case "unappnav":
$appkey = $_POST['appkey'];
$arrNav = (include 'data/system_appnav.php');
unset($arrNav[$appkey]);
fileWrite('system_appnav.php', 'data', $arrNav);
$tsMySqlCache->set('system_appnav', $arrNav);
echo '1';
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:apps.php
示例15: mysqli_query
require_once 'file.php';
$usern = $_SESSION['login_user'];
$conn1 = $_SESSION['conn'];
$quer = $_POST['stext'];
$propic = mysqli_query($conn1, "select picture from user where id = (select id from login where username='{$usern}')");
$row1 = mysqli_fetch_assoc($propic);
$serres = "";
if ($_POST["search"] && isset($_POST['sbutton'])) {
$serres = $_POST["search"];
fileWrite("---t---", $serres);
if ($serres == "t") {
$tags = mysqli_query($conn1, "SELECT * FROM pics WHERE photoid IN (SELECT picid FROM pictags WHERE tagid in (SELECT tagid FROM tags WHERE tagname LIKE '%" . $quer . "%'))");
fileWrite("---t---", "inside");
} elseif ($serres == "u") {
$tags = mysqli_query($conn1, "SELECT * FROM user WHERE firstname LIKE '%" . $quer . "%' OR lastname LIKE '%" . $quer . "%'");
fileWrite("---u---", "inside");
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Search Page</title>
<link rel="stylesheet" type="text/css" href="design.css">
</head>
<body>
<div class ="profile">
<imgd><img src="<?php
开发者ID:swardharia,项目名称:PinYourInterest,代码行数:31,代码来源:search.php
示例16: appOption
function appOption($app, $option)
{
//先清空数据
$db->query("TRUNCATE TABLE `" . dbprefix . $app . "_options`");
foreach ($option as $key => $item) {
$optionname = $key;
$optionvalue = trim($item);
$this->create($app . '_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
}
$arrOptions = $this->findAll($app . '_options', null, null, 'optionname,optionvalue');
foreach ($arrOptions as $item) {
$arrOption[$item['optionname']] = $item['optionvalue'];
}
fileWrite($app . '_options.php', 'data', $arrOption);
$tsMySqlCache->set($app . '_options', $arrOption);
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:16,代码来源:class.system.php
示例17: store_data
/**
* Writes the data to the config files
*
* @author Chris Smith <[email protected]>
*
* @param array $d
* @return bool
*/
function store_data($d)
{
global $LC;
$ok = true;
$d['policy'] = (int) $d['policy'];
// create local.php
$now = gmdate('r');
$output = <<<EOT
<?php
/**
* Dokuwiki's Main Configuration File - Local Settings
* Auto-generated by install script
* Date: {$now}
*/
EOT;
// add any config options set by a previous installer
$preset = __DIR__ . '/install.conf';
if (file_exists($preset)) {
$output .= "# preset config options\n";
$output .= file_get_contents($preset);
$output .= "\n\n";
$output .= "# options selected in installer\n";
@unlink($preset);
}
$output .= '$conf[\'title\'] = \'' . addslashes($d['title']) . "';\n";
$output .= '$conf[\'lang\'] = \'' . addslashes($LC) . "';\n";
$output .= '$conf[\'license\'] = \'' . addslashes($d['license']) . "';\n";
if ($d['acl']) {
$output .= '$conf[\'useacl\'] = 1' . ";\n";
$output .= "\$conf['superuser'] = '@admin';\n";
}
if (!$d['allowreg']) {
$output .= '$conf[\'disableactions\'] = \'register\'' . ";\n";
}
$ok = $ok && fileWrite(DOKU_LOCAL . 'local.php', $output);
if ($d['acl']) {
// hash the password
$phash = new PassHash();
$pass = $phash->hash_smd5($d['password']);
// create users.auth.php
// --- user:SMD5password:Real Name:email:groups,comma,seperated
$output = join(":", array($d['superuser'], $pass, $d['fullname'], $d['email'], 'admin,user'));
$output = @file_get_contents(DOKU_CONF . 'users.auth.php.dist') . "\n{$output}\n";
$ok = $ok && fileWrite(DOKU_LOCAL . 'users.auth.php', $output);
// create acl.auth.php
$output = <<<EOT
# acl.auth.php
# <?php exit()?>
# Don't modify the lines above
#
# Access Control Lists
#
# Auto-generated by install script
# Date: {$now}
EOT;
if ($d['policy'] == 2) {
$output .= "* @ALL 0\n";
$output .= "* @user 8\n";
} elseif ($d['policy'] == 1) {
$output .= "* @ALL 1\n";
$output .= "* @user 8\n";
} else {
$output .= "* @ALL 8\n";
}
$ok = $ok && fileWrite(DOKU_LOCAL . 'acl.auth.php', $output);
}
// enable popularity submission
if ($d['pop']) {
@touch(DOKU_INC . 'data/cache/autosubmit.txt');
}
// disable auth plugins til needed
$output = <<<EOT
<?php
/*
* Local plugin enable/disable settings
*
* Auto-generated by install script
* Date: {$now}
*/
\$plugins['authad'] = 0;
\$plugins['authldap'] = 0;
\$plugins['authmysql'] = 0;
\$plugins['authpgsql'] = 0;
EOT;
$ok = $ok && fileWrite(DOKU_LOCAL . 'plugins.local.php', $output);
return $ok;
}
开发者ID:boycaught,项目名称:dokuwiki,代码行数:99,代码来源:install.php
示例18: foreach
<?php
//更新统计活动分类缓存
$arrTypess = $db->fetch_all_assoc("select * from " . dbprefix . "event_type");
foreach ($arrTypess as $key => $item) {
$event = $db->once_fetch_assoc("select count(eventid) from " . dbprefix . "event where typeid='" . $item['typeid'] . "'");
$arrTypes['list'][] = array('typeid' => $item['typeid'], 'typename' => $item['typename'], 'count_event' => $event['count(eventid)']);
}
$eventNum = $db->once_fetch_assoc("select count(eventid) from " . dbprefix . "event");
$arrTypes['count'] = $eventNum['count(eventid)'];
//生成缓存文件
fileWrite('event_types.php', 'data', $arrTypes);
qiMsg("更新成功!");
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:13,代码来源:cache.php
示例19: PclZip
include 'thinksaas/pclzip.lib.php';
$archive = new PclZip('upgrade/' . $filezip);
if ($archive->extract(PCLZIP_OPT_PATH, 'upgrade', PCLZIP_OPT_REPLACE_NEWER) == 0) {
//die("Error : ".$archive->errorInfo(true));
echo '0';
exit;
//解压失败
} else {
unlink('upgrade/' . $filezip);
}
//直接循环覆盖吧
$filers = file_list('upgrade/thinksaas');
if ($filers) {
echo '1';
exit;
}
//删除目录
delDirAndFile('upgrade/thinksaas');
//更新数据库配置缓存下
$arrOptions = $new['system']->findAll('system_options', null, null, 'optionname,optionvalue');
foreach ($arrOptions as $item) {
$arrOption[$item['optionname']] = $item['optionvalue'];
}
fileWrite('system_options.php', 'data', $arrOption);
$tsMySqlCache->set('system_options', $arrOption);
//删除模板缓存
rmrf('cache/template');
echo '2';
exit;
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:update.php
示例20: mysqli_query
<?php
include 'session.php';
$usern = $_SESSION['login_user'];
$conn1 = $_SESSION['conn'];
$usid = $_SESSION['login_id'];
require_once 'file.php';
$pro = mysqli_query($conn1, "select * from user where id = (select id from login where username='{$usern}')");
if (isset($_POST['submit'])) {
$fn = $_POST['fname'];
$ln = $_POST['lname'];
$dob = $_POST['dob'];
$directory = "profilepic/";
$target_file = $directory . basename($_FILES["propic"]["name"]);
//echo $target_file;
if (move_uploaded_file($_FILES["propic"]["tmp_name"], $target_file)) {
fileWrite("---Result---", "File moved successfully");
} else {
fileWrite("---Result---", "File moving unsuccessful");
}
// $pic=$_REQUEST['propic'];
// fileWrite("---comment---",$pic);
if (mysqli_num_rows($pro) == 1) {
mysqli_query($conn1, "UPDATE user SET firstname='{$fn}',lastname='{$ln}',picture='{$target_file}',dob='{$dob}' WHERE id = (select id from login where username='{$usern}')");
} else {
mysqli_query($conn1, "INSERT into user(id,firstname,lastname,picture,dob) VALUES ({$usid},{$fn},{$ln},NULL,{$dob}) ");
}
}
header('location:profile.php');
?>
开发者ID:swardharia,项目名称:PinYourInterest,代码行数:29,代码来源:newchanges.php
注:本文中的fileWrite函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论