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


PHP clear_all_files函数代码示例

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


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

示例1: install

 /**
  * 模板安装
  */
 public function install()
 {
     $tpl_name = I('get.tpl_name');
     $tpl_fg = I('get.tpl_fg', 0);
     $data['value'] = $tpl_name;
     $condition['code'] = 'template';
     $this->model->table('touch_shop_config')->data($data)->where($condition)->update();
     $data['value'] = $tpl_fg;
     $condition['code'] = 'stylename';
     $this->model->table('touch_shop_config')->data($data)->where($condition)->update();
     clear_all_files();
     //清除模板编译文件
     make_json_result($this->read_style_and_tpl($tpl_name, $tpl_fg), L('install_template_success'));
 }
开发者ID:m7720647,项目名称:demo,代码行数:17,代码来源:TemplateController.class.php

示例2: edit

 /**
  * 编辑分类信息
  */
 public function edit()
 {
     if (IS_POST) {
         $cat_id = I('cat_id');
         $cat_info = I('data');
         /* 数据验证 */
         $msg = Check::rule(array(array(Check::must($cat_info['cat_name']), L('catname_empty'))));
         /* 提示信息 */
         if ($msg !== true) {
             $this->message($msg, NULL, 'error');
         }
         /* 判断上级目录是否合法 */
         $children = array_keys(cat_list($cat_id, 0, false));
         // 获得当前分类的所有下级分类
         if (in_array($cat_info['parent_id'], $children)) {
             $this->message(L('is_leaf_error'), NULL, 'error');
         }
         /* 更新栏目 */
         $this->cat_update($cat_id, $cat_info);
         /* 更新栏目图标 */
         if ($_FILES['cat_image']['name']) {
             /* cat_image图标 */
             $result = $this->ectouchUpload('cat_image', 'cat_image');
             if ($result['error'] > 0) {
                 $this->message($result['message'], NULL, 'error');
             }
             $data['cat_image'] = substr($result['message']['cat_image']['savepath'], 2) . $result['message']['cat_image']['savename'];
             $this->model->table('touch_category')->data($data)->where('cat_id=' . $cat_id)->update();
         }
         /* 清除缓存 */
         clear_all_files();
         $this->message(L('catedit_succed'), url('index'));
     }
     $cat_id = I('cat_id');
     //查询附表信息
     $result = $this->model->table('touch_category')->where('cat_id=' . $cat_id)->find();
     if (empty($result)) {
         $data['cat_id'] = $cat_id;
         $this->model->table('touch_category')->data($data)->insert();
     }
     // 查询分类信息数据
     $cat_info = $this->get_cat_info($cat_id);
     /* 模板赋值 */
     $this->assign('ur_here', L('category_edit'));
     $this->assign('cat_info', $cat_info);
     $this->assign('cat_select', cat_list(0, $cat_info['parent_id'], true));
     $this->display();
 }
开发者ID:noikiy,项目名称:shop-3,代码行数:51,代码来源:CategoryController.class.php

示例3: edit

    /**
     * 编辑文章
     */
    public function edit() {
        $id = I('cat_id');
        if (IS_POST) {
            $data = I('data');
            //更新数据库
            $touch_result = $this->model->table('touch_article_cat')->where('cat_id=' . $id)->find();
            if (!empty($touch_result)) {

                $this->model->table('touch_article_cat')->data($data)->where('cat_id=' . $id)->update();
            }
            clear_all_files();
            $this->message(L('catedit_succed'), url('index'));
        }
        $cat = $this->model->table('touch_article_cat')->field('*')->where(array('cat_id' => $id))->find();
        /* 模板赋值 */
        $options = model('ArticleBase')->article_cat_list(0, $cat['parent_id'], false);
        $select = '';
        $selected = $cat['parent_id'];
        foreach ($options as $var) {
            if ($var['cat_id'] == $id) {
                continue;
            }
            $select .= '<option value="' . $var['cat_id'] . '" ';
            $select .= ($selected == $var['cat_id']) ? "selected='ture'" : '';
            $select .= '>';
            if ($var['level'] > 0) {
                $select .= str_repeat('&nbsp;', $var['level'] * 4);
            }
            $select .= htmlspecialchars($var['cat_name']) . '</option>';
        }
        
        unset($options);
        $this->assign('cat_select',$select );      
        $this->assign('cat', $cat);
        $this->assign('ur_here', L('articlecat_edit'));
        $this->display();
    }
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:40,代码来源:ArticlecatController.class.php

示例4: put_affiliate

function put_affiliate($config)
{
    $temp = serialize($config);
    $sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "SET  value = '{$temp}'" . "WHERE code = 'affiliate'";
    $GLOBALS['db']->query($sql);
    clear_all_files();
}
开发者ID:dlpc,项目名称:ecshop,代码行数:7,代码来源:affiliate.php

示例5: del

 /**
  * 删除文章分类
  */
 public function del()
 {
     $id = I('get.cat_id');
     $count = $this->model->table('touch_article_cat')->field('COUNT(*)')->where("parent_id = '{$id}'")->getOne();
     if ($count > 0) {
         /* 还有子分类,不能删除 */
         $this->message(L('is_fullcat'), url('index'));
     }
     /* 非空的分类不允许删除 */
     $count = $this->model->table('touch_article')->field('COUNT(*)')->where("cat_id = '{$id}'")->getOne();
     if ($count > 0) {
         $this->message(L('not_emptycat'), url('index'));
     } else {
         $condition['cat_id'] = $id;
         $this->model->table('touch_article_cat')->where($condition)->delete();
         clear_all_files();
         $this->message(L('drop_succeed'), url('index'));
     }
 }
开发者ID:noikiy,项目名称:shop-3,代码行数:22,代码来源:ArticlecatController.class.php

示例6: del

 /**
  * 删除文章
  */
 public function del()
 {
     $id = I('id');
     $condition['article_id'] = $id;
     $this->model->table('touch_article')->where($condition)->delete();
     clear_all_files();
     $this->message(L('drop_succeed'), url('index'));
 }
开发者ID:noikiy,项目名称:shop-3,代码行数:11,代码来源:ArticleController.class.php

示例7: done


//.........这里部分代码省略.........
         $res = $this->model->query($sql);
         $virtual_goods = array();
         foreach ($res as $row) {
             $virtual_goods['virtual_card'][] = array('goods_id' => $row['goods_id'], 'goods_name' => $row['goods_name'], 'num' => $row['num']);
         }
         if ($virtual_goods) {
             /* 虚拟卡发货 */
             if (model('OrderBase')->virtual_goods_ship($virtual_goods, $msg, $order['order_sn'], true)) {
                 /* 如果没有实体商品,修改发货状态,送积分和红包 */
                 $count = $this->model->table('order_goods')->field('COUNT(*)')->where("order_id = '{$order['order_id']}' " . " AND is_real = 1")->getOne();
                 if ($count <= 0) {
                     /* 修改订单状态 */
                     model('Users')->update_order($order['order_id'], array('shipping_status' => SS_SHIPPED, 'shipping_time' => gmtime()));
                     /* 如果订单用户不为空,计算积分,并发给用户;发红包 */
                     if ($order['user_id'] > 0) {
                         /* 取得用户信息 */
                         $user = model('Order')->user_info($order['user_id']);
                         /* 计算并发放积分 */
                         $integral = model('Order')->integral_to_give($order);
                         model('ClipsBase')->log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf(L('order_gift_integral'), $order['order_sn']));
                     }
                 }
             }
         }
     }
     // 销量
     model('Flow')->add_touch_goods($flow_type, $order['extension_code']);
     /* 记录供应商信息 */
     $sql = "update " . $this->model->pre . "order_goods og , " . $this->model->pre . "goods g set og.suppliers_id=g.suppliers_id\r\n            where og.goods_id=g.goods_id and og.order_id='" . $order['order_id'] . "'";
     $this->model->query($sql);
     /* 清空购物车 */
     model('Order')->clear_cart($flow_type);
     /* 清除缓存,否则买了商品,但是前台页面读取缓存,商品数量不减少 */
     clear_all_files();
     /* 插入支付日志 */
     $order['log_id'] = model('ClipsBase')->insert_pay_log($new_order_id, $order['order_amount'], PAY_ORDER);
     /* 取得支付信息,生成支付代码 */
     if ($order['order_amount'] > 0) {
         $payment = model('Order')->payment_info($order['pay_id']);
         include_once ROOT_PATH . 'plugins/payment/' . $payment['pay_code'] . '.php';
         $pay_obj = new $payment['pay_code']();
         $pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));
         $order['pay_desc'] = $payment['pay_desc'];
         $this->assign('pay_online', $pay_online);
     }
     if (!empty($order['shipping_name'])) {
         $order['shipping_name'] = trim(stripcslashes($order['shipping_name']));
     }
     // 货到付款不显示
     if ($payment['pay_code'] != 'balance') {
         /* 生成订单后,修改支付,配送方式 */
         // 支付方式
         $payment_list = model('Order')->available_payment_list(0);
         if (isset($payment_list)) {
             foreach ($payment_list as $key => $payment) {
                 /* 如果有易宝神州行支付 如果订单金额大于300 则不显示 */
                 if ($payment['pay_code'] == 'yeepayszx' && $total['amount'] > 300) {
                     unset($payment_list[$key]);
                 }
                 // 过滤掉当前的支付方式
                 if ($payment['pay_id'] == $order['pay_id']) {
                     unset($payment_list[$key]);
                 }
                 /* 如果有余额支付 */
                 if ($payment['pay_code'] == 'balance') {
                     /* 如果未登录,不显示 */
开发者ID:noikiy,项目名称:shop-3,代码行数:67,代码来源:FlowController.class.php

示例8: clearCache

 public function clearCache()
 {
     clear_all_files();
     $this->message(L('caches_cleared'));
 }
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:5,代码来源:IndexController.class.php

示例9: del

 /**
  * 删除上传文件
  */
 public function del()
 {
     /* 取得参数 */
     $code = I('code');
     $filename = C($code);
     //删除文件
     @unlink($filename);
     //更新设置
     $this->update_configure($code, '');
     /* 清除缓存 */
     clear_all_files();
     $this->message(L('save_success'));
 }
开发者ID:noikiy,项目名称:shop-3,代码行数:16,代码来源:ConfigController.class.php

示例10: action_post

function action_post()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    $chat_keys = $GLOBALS['chat_keys'];
    // 检查shop_config
    $sql = "select * from " . $ecs->table("shop_config") . " where code = 'chat'";
    $row = $db->getRow($sql, true);
    if ($row == false) {
        $sql = "select max(parent_id) from " . $ecs->table("shop_config") . "";
        $parent_id = $db->getOne($sql) + 1;
        $chat = array("id" => $parent_id, "code" => "chat", "parent_id" => 0, "type" => "group", "value" => "");
        $db->autoExecute($ecs->table('shop_config'), $chat, 'INSERT');
    } else {
        $parent_id = $row['id'];
    }
    $chat_server_ip = empty($_POST['chat_server_ip']) ? '' : $_POST['chat_server_ip'];
    $chat_server_port = empty($_POST['chat_server_port']) ? '9090' : $_POST['chat_server_port'];
    $chat_http_bind_port = empty($_POST['chat_http_bind_port']) ? '7070' : $_POST['chat_http_bind_port'];
    $chat_server_admin_username = empty($_POST['chat_server_admin_username']) ? 'admin' : $_POST['chat_server_admin_username'];
    $chat_server_admin_password = $_POST['chat_server_admin_password'];
    $chat = array("chat_server_ip" => $chat_server_ip, "chat_server_port" => $chat_server_port, "chat_http_bind_port" => $chat_http_bind_port, "chat_server_admin_username" => $chat_server_admin_username);
    if (!empty($chat_server_admin_password)) {
        $chat['chat_server_admin_password'] = $chat_server_admin_password;
    }
    $sql = "select * from " . $ecs->table("shop_config") . " where parent_id = '" . $parent_id . "'";
    $rows = $db->getAll($sql);
    $records = array();
    foreach ($rows as $row) {
        $key = $row['code'];
        $value = $row['value'];
        $records[$key] = $row;
    }
    foreach ($chat as $key => $value) {
        if ($key == 'chat_server_admin_password') {
            $record = array("code" => $key, "value" => $value, "type" => "password", "parent_id" => $parent_id);
        } else {
            $record = array("code" => $key, "value" => $value, "type" => "text", "parent_id" => $parent_id);
        }
        if (isset($records[$key])) {
            $id = $records[$key]['id'];
            if ($value != $records[$key]['value']) {
                $db->autoExecute($ecs->table('shop_config'), $record, 'UPDATE', "id = '{$id}'");
            }
        } else {
            $db->autoExecute($ecs->table('shop_config'), $record, 'INSERT', "parent_id = '{$parent_id}'");
        }
    }
    /* 清除缓存 */
    clear_all_files();
    $_CFG = load_config();
    /* 提示信息 */
    $links = array(array('href' => 'chat_settings.php', 'text' => "返回上一页"));
    sys_msg("修改聊天服务设置成功!", 0, $links);
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:60,代码来源:chat_settings.php

示例11: done


//.........这里部分代码省略.........
	error_log('4',3,'flow.log');
	        $virtual_goods = array();
	        foreach ($res AS $row)
	        {
	            $virtual_goods['virtual_card'][] = array('goods_id' => $row['goods_id'], 'goods_name' => $row['goods_name'], 'num' => $row['num']);
	        }
	
	        if ($virtual_goods AND $flow_type != CART_GROUP_BUY_GOODS)
	        {
	            /* 虚拟卡发货 */
	            if (virtual_goods_ship($virtual_goods,$msg, $order['order_sn'], true))
	            {
	                /* 如果没有实体商品,修改发货状态,送积分和红包 */
	                $sql = "SELECT COUNT(*)" .
	                        " FROM " . $ecs->table('order_goods') .
	                        " WHERE order_id = '$order[order_id]' " .
	                        " AND is_real = 1";
	                if ($db->getOne($sql) <= 0)
	                {
	                    /* 修改订单状态 */
	                    update_order($order['order_id'], array('shipping_status' => SS_SHIPPED, 'shipping_time' => gmtime()));
	error_log('5',3,'flow.log');
	                    /* 如果订单用户不为空,计算积分,并发给用户;发红包 */
	                    if ($order['user_id'] > 0)
	                    {
	                        /* 取得用户信息 */
	                        $user = user_info($order['user_id']);
	
	                        /* 计算并发放积分 */
	                        $integral = integral_to_give($order);
	                        log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($_LANG['order_gift_integral'], $order['order_sn']));
	error_log('6',3,'flow.log');
	                        /* 发放红包 */
	                        send_order_bonus($order['order_id']);
	                    }
	                }
	            }
	        }
	
	    }
	
	    /* 清空购物车 */
	    clear_cart($flow_type);
	error_log('7',3,'flow.log');
	    /* 清除缓存,否则买了商品,但是前台页面读取缓存,商品数量不减少 */
	    clear_all_files();
	
	    /* 插入支付日志 */
	    //$order['log_id'] = insert_pay_log($new_order_id, $order['order_amount'], PAY_ORDER);
	
	   error_log('8',3,'flow.log'); 
		
		/*取得支付代码
	
		#取得支付信息,生成支付代码 
	    if ($order['order_amount'] > 0)
	    {
	        $payment = payment_info($order['pay_id']);
	
	        include_once('includes/modules/payment/' . $payment['pay_code'] . '.php');
	
	        $pay_obj    = new $payment['pay_code'];
	
	        $pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));
	
	        $order['pay_desc'] = $payment['pay_desc'];
	
	        $smarty->assign('pay_online', $pay_online);
	    }
		*/
	
	    if(!empty($order['shipping_name']))
	    {
	        $order['shipping_name']=trim(stripcslashes($order['shipping_name']));
	    }
	error_log('9',3,'flow.log');
	    /*
		#订单信息
	    $smarty->assign('order',      $order);
	    $smarty->assign('total',      $total);
	    $smarty->assign('goods_list', $cart_goods);
	    $smarty->assign('order_submit_back', sprintf($_LANG['order_submit_back'], $_LANG['back_home'], $_LANG['goto_user_center'])); // 返回提示
		*/
	    //user_uc_call('add_feed', array($order['order_id'], BUY_GOODS)); //推送feed到uc
	    unset($_SESSION['flow_consignee']); // 清除session中保存的收货人信息
	    unset($_SESSION['flow_order']);
	    unset($_SESSION['direct_shopping']);
	
	
		$order_done = array('order'=>$order,'total'=>$total,'cart_goods'=>$cart_goods);
		//var_dump($order_done);exit;
	error_log('10',3,'flow.log');	
		$order_id = $order['order_id'];
		$price = $order['order_amount'];
		$order = array ('order_id'=>$order_id,'order_number'=>$order['order_sn'],'price'=>$price) ;
		error_log('11',3,'flow.log');
		//print_r($order);die;
		jsonExit($order);
		
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:101,代码来源:flow.action.php

示例12: check_authz_json

if ($_REQUEST['act'] == 'install')
{
    check_authz_json('backup_setting');

    $tpl_name = trim($_GET['tpl_name']);
    $tpl_fg=0;
    $tpl_fg = trim($_GET['tpl_fg']);

    $sql = "UPDATE " .$GLOBALS['ecs']->table('ecsmart_shop_config',1). " SET value = '$tpl_name' WHERE code = 'template'";
    $step_one = $db->query($sql, 'SILENT');
    $sql = "UPDATE " .$GLOBALS['ecs']->table('ecsmart_shop_config',1). " SET value = '$tpl_fg' WHERE code = 'stylename'";
    $step_two = $db->query($sql, 'SILENT');

    if ($step_one && $step_two)
    {
        clear_all_files(); //清除模板编译文件

        $error_msg = '';
        if (move_plugin_library($tpl_name, $error_msg))
        {
            make_json_error($error_msg);
        }
        else
        {
            make_json_result(read_style_and_tpl($tpl_name, $tpl_fg), $_LANG['install_template_success']);
        }
    }
    else
    {
        make_json_error($db->error());
    }
开发者ID:alphaouyang,项目名称:ecshop,代码行数:31,代码来源:template.php

示例13: put_affiliate

function put_affiliate($temp)
{
    $sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "SET  value = '{$temp}'" . "WHERE code = 'compensate_instal'";
    $GLOBALS['db']->query($sql);
    clear_all_files();
}
开发者ID:dlpc,项目名称:ecshop,代码行数:6,代码来源:compensate_instal.php

示例14: del

 /**
  * 删除专题
  */
 public function del()
 {
     $id = I('id');
     if (!$id) {
         $this->redirect(url('index'));
     }
     /* 删除该品牌的图标 */
     $topic = $this->model->table('touch_topic')->field('*')->where('topic_id = ' . $id)->find();
     $topic_img = $topic['topic_img'];
     $title_pic = $topic['title_pic'];
     $intro = html_out($topic['intro']);
     //删除编辑器中的附件
     $match = array();
     preg_match_all("/(src|href)\\=\"\\/(.*?)\"/i", $intro, $match);
     if (is_array($match[2])) {
         foreach ($match[2] as $vo) {
             $index = strpos($vo, 'data/');
             @unlink(ROOT_PATH . substr($vo, $index));
         }
     }
     //删除logo
     if (!empty($topic_img)) {
         $index = strpos($topic_img, 'data/');
         @unlink(ROOT_PATH . substr($topic_img, $index));
     }
     //删除分类图标
     if (!empty($title_pic)) {
         $index = strpos($title_pic, 'data/');
         @unlink(ROOT_PATH . substr($title_pic, $index));
     }
     //删除品牌
     $this->model->table('touch_topic')->where(array('topic_id' => $id))->delete();
     clear_all_files();
     $this->message(L('succed'), url('index'));
 }
开发者ID:noikiy,项目名称:shop-3,代码行数:38,代码来源:TopicController.class.php

示例15: del

 /**
  * 删除品牌
  */
 public function del() {
     $id = I('id');
     /* 删除该品牌的图标 */
     $sql = "SELECT a.brand_logo,b.brand_banner,b.brand_content FROM " . $this->model->pre . "brand as a left join " . $this->model->pre . "touch_brand as b on a.brand_id = b.brand_id WHERE a.brand_id = '$id'";
     $result = $this->model->query($sql);
     $brand_logo = $result[0]['brand_logo'];
     $brand_banner = $result[0]['brand_banner'];
     $brand_content = html_out($result[0]['brand_content']);
     //删除编辑器中的附件
     preg_match_all("/(src|href)\=\"\/(.*?)\"/i", $brand_content, $match);
     if (is_array($match[2])) {
         foreach ($match[2] as $vo) {
             $index = strpos($vo, 'data/');
             @unlink(ROOT_PATH . substr($vo, $index));
         }
     }
     //删除logo
     if (!empty($brand_logo)) {
         $index = strpos($brand_logo, 'data/');
         @unlink(ROOT_PATH . substr($brand_logo, $index));
     }
     //删除广告位
     if (!empty($brand_banner)) {
         $index = strpos($brand_banner, 'data/');
         @unlink(ROOT_PATH . substr($brand_banner, $index));
     }
     //更新商品的品牌编号
     $this->model->table('goods')->data('brand_id=0')->where('brand_id=' . $id)->update();
     //删除品牌
     $condition['brand_id'] = $id;
     $this->model->table('brand')->where($condition)->delete();
     $this->model->table('touch_brand')->where($condition)->delete();
     clear_all_files();
     $this->message(L('drop_succeed'), url('index'));
 }
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:38,代码来源:BrandController.class.php


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