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


PHP Cache::removeAll方法代码示例

本文整理汇总了PHP中Cache::removeAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache::removeAll方法的具体用法?PHP Cache::removeAll怎么用?PHP Cache::removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cache的用法示例。


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

示例1: deleteManufacturer

 public function deleteManufacturer($manufacturer_id)
 {
     $this->query("DELETE FROM PREFIX_manufacturer WHERE manufacturer_id = " . (int) $manufacturer_id);
     $this->query("DELETE FROM PREFIX_manufacturer_to_store WHERE manufacturer_id = " . (int) $manufacturer_id);
     $this->query("DELETE FROM PREFIX_url_alias WHERE query = 'manufacturer_id=" . (int) $manufacturer_id . "'");
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:7,代码来源:manufacturer.php

示例2: remove

 public function remove()
 {
     if ($this->request->server['REQUEST_METHOD'] == 'POST') {
         Cache::removeAll(true);
         Language::rebuildCacheFor($this->config->get('language_id'));
         $files = $this->scan(DIR_IMAGE . 'cache/*', array());
         $check = array();
         if (is_array($files)) {
             foreach ($files as $file) {
                 @unlink($file);
             }
         }
         $this->response->setOutput(json_encode(Logger::get('warning')));
     }
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:15,代码来源:cache.php

示例3: update

 public function update()
 {
     Cache::removeAll();
     $type = !empty($this->request->post['type']) ? $this->request->post['type'] : '';
     $id = !empty($this->request->post['id']) ? $this->request->post['id'] : 0;
     if (!empty($this->request->get['new'])) {
         $names = $this->request->post['name'];
         if (is_array($names) && count($names) && !empty($type) && in_array($type, $this->types)) {
             $id = 0;
             foreach ($names as $lang => $name) {
                 Database::query("INSERT INTO PREFIX_" . $type . "\n                        SET language_id = :lang,\n                            name        = :name", array('lang' => $lang, 'name' => $name));
                 if (!$id) {
                     $id = Database::lastInsertId();
                 } else {
                     Database::query("UPDATE PREFIX_" . $type . " SET " . $type . "_id = :new WHERE " . $type . "_id = :old", array('old' => Database::lastInsertId(), 'new' => $id));
                 }
             }
         }
         $this->redirect('index', '', 'SSL');
         exit;
     } else {
         if (empty($type) || empty($id) || !in_array($type, $this->types)) {
             return;
         }
         $data = array();
         parse_str(str_replace('amp;', '', $this->request->post['data']), $data);
         if ($type == $data['type']) {
             foreach ($data['name'] as $lang => $name) {
                 Database::query("UPDATE PREFIX_" . $type . "\n                        SET     name                    = :name\n                        WHERE   language_id             = :lang\n                        AND     " . $type . "_id = :id", array('name' => $name, 'lang' => $lang, 'id' => $id));
             }
         } else {
             if (in_array($data['type'], $this->types)) {
                 $id = 0;
                 foreach ($data['name'] as $lang => $name) {
                     Database::query("INSERT INTO PREFIX_" . $data['type'] . "\n                        SET language_id = :lang,\n                            name        = :name", array('lang' => $lang, 'name' => $name));
                     if (!$id) {
                         $id = Database::lastInsertId();
                     } else {
                         Database::query("UPDATE PREFIX_" . $data['type'] . " SET " . $data['type'] . "_id = :new WHERE " . $data['type'] . "_id = :old", array('old' => Database::lastInsertId(), 'new' => $id));
                     }
                 }
             }
         }
     }
     $this->response->setOutput('OK');
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:46,代码来源:status.php

示例4: remove

 public function remove($type, $id)
 {
     if ($type == 'blog') {
         $this->query("DELETE FROM PREFIX_blog WHERE blog_id = :id", array('id' => $id));
     } else {
         $this->query("DELETE FROM PREFIX_information WHERE parent_id = :id", array('id' => $id));
         $this->query("DELETE FROM PREFIX_information WHERE information_id = :id", array('id' => $id));
     }
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:10,代码来源:cms.php

示例5: deleteProduct

 public function deleteProduct($product_id)
 {
     $this->query("DELETE FROM PREFIX_product WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_attribute WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_description WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_discount WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_image WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_option_value_description WHERE value_id IN (SELECT value_id FROM PREFIX_product_option_value WHERE option_id IN (SELECT option_id FROM PREFIX_product_option WHERE product_id = " . (int) $product_id . "))");
     $this->query("DELETE FROM PREFIX_product_option_value WHERE option_id IN (SELECT option_id FROM PREFIX_product_option WHERE product_id = " . (int) $product_id . ")");
     $this->query("DELETE FROM PREFIX_product_option_description WHERE option_id IN (SELECT option_id FROM PREFIX_product_option WHERE product_id = " . (int) $product_id . ")");
     $this->query("DELETE FROM PREFIX_product_option WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_related WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_related WHERE related_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_special WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_to_category WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_to_download WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_product_to_store WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_review WHERE product_id = " . (int) $product_id);
     $this->query("DELETE FROM PREFIX_url_alias WHERE query = 'product_id=" . (int) $product_id . "'");
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:21,代码来源:product.php

示例6: updateStatus

 public function updateStatus($category_id, $status = 1)
 {
     if ($status) {
         $check = $this->query("SELECT parent_id FROM PREFIX_category WHERE category_id = :id", array('id' => $category_id))->fetch();
         if ($check['parent_id']) {
             $check = $this->query("SELECT status FROM PREFIX_category WHERE category_id = :id", array('id' => $check['parent_id']))->fetch();
             if (!$check['status']) {
                 return false;
             }
         }
     }
     $this->query("UPDATE PREFIX_category\n            SET status          = :status,\n                date_modified   = :date\n            WHERE category_id   = :id", array('status' => $status, 'date' => date('Y-m-d H:i:s'), 'id' => $category_id));
     if (!$status) {
         foreach ($this->fetchAll("SELECT category_id FROM PREFIX_category WHERE parent_id = :id", array('id' => $category_id)) as $cat) {
             $this->updateStatus($cat['category_id'], 0);
         }
     }
     Cache::removeAll();
     return true;
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:20,代码来源:category.php

示例7: duplicateLanguage

 public function duplicateLanguage($originalID)
 {
     $data = $this->getLanguage($originalID);
     $translations = $this->fetchAll("SELECT key_id, value FROM PREFIX_translations WHERE language_id = :id", array('id' => $originalID));
     $newLanguageID = $this->addLanguage($data);
     foreach ($translations as $list) {
         $list['languageID'] = $newLanguageID;
         $this->query("INSERT INTO PREFIX_translations SET key_id = :key_id, value = :value, language_id = :languageID", $list);
     }
     Cache::removeAll(true);
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:11,代码来源:language.php

示例8: addReturnHistory

 public function addReturnHistory($return_id, $data)
 {
     $this->query("UPDATE PREFIX_return\n            SET return_status_id    = :status_id,\n                date_modified       = :date\n            WHERE return_id         = :id", array('status_id' => $data['return_status_id'], 'date' => date('Y-m-d H:i:s'), 'id' => $return_id));
     if (!isset($data['notify'])) {
         $data['notify'] = 0;
     }
     $data['date'] = date('Y-m-d H:i:s');
     $data['return_id'] = $return_id;
     $this->query("INSERT INTO PREFIX_return_history\n            SET return_id           = :return_id,\n                return_status_id    = :return_status_id,\n                notify              = :notify,\n                comment             = :comment,\n                date_added          = :date", $data);
     if ($data['notify']) {
         $return_data = $this->getReturn($return_id);
         Mailer::setCustomer($return_data);
         Mailer::setReturn($return_data);
         $mail = Mailer::getTemplate('update_return_status_' . $data['return_status_id']);
         if (!empty($data['comment'])) {
             $mail['content'] = str_replace('{hasComments}', $data['comment'] . '<br /><br />', $mail['content']);
         } else {
             $mail['content'] = str_replace('{hasComments}', '', $mail['content']);
         }
         Mail::setTo($return_data['email']);
         Mail::setSubject($mail['title']);
         Mail::setHTML($mail['content']);
         Mail::send();
     }
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:26,代码来源:return.php

示例9: deleteReward

 public function deleteReward($order_id)
 {
     $this->query("DELETE FROM PREFIX_customer_reward WHERE order_id = '" . (int) $order_id . "'");
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:5,代码来源:customer.php

示例10: editNewsletter

 public function editNewsletter($newsletter)
 {
     $this->query("UPDATE PREFIX_customer SET newsletter = :news WHERE customer_id = :cid", array('news' => $newsletter, 'cid' => $this->customer->getId()));
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:5,代码来源:customer.php

示例11: deleteCountry

 public function deleteCountry($country_id)
 {
     $this->query("DELETE FROM PREFIX_country WHERE country_id = " . (int) $country_id);
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:5,代码来源:country.php

示例12: updateStatus


//.........这里部分代码省略.........
    </thead>
    <tbody>';
                foreach ($products as $product) {
                    $order_view .= '
        <tr>
            <td>' . $product['quantity'] . '</td>
            <td>' . $product['name'] . '</td>
            <td>' . $product['model'] . '</td>
            <td class="text-right">' . $product['price'] . '</td>
            <td class="text-right">' . $product['total'] . '</td>
        </tr>';
                }
                $order_view .= '
    </tbody>
</table>
<hr>
<div class="row">
    <div class="col-sm-6">
        <div class="content">
            <dl class="info">
                <dt>' . Language::getVar('SUMO_NOUN_PAYMENT_BY') . ':</dt>
                <dd>' . $payment_method . '</dd>
            </dl>

            <dl class="info">
                <dt>' . Language::getVar('SUMO_NOUN_SHIPPING_METHOD') . ':</dt>
                <dd>' . $shipping_method . '</dd>
            </dl>
        </div>
    </div>
    <div class="col-sm-6">
        <div class="content pull-right">';
                foreach ($totals as $total) {
                    $order_view .= '
            <dl class="info">
                <dt>' . $total['label'] . ':</dt>
                <dd class="text-right" style="min-width: 75px; padding-right: 38px;">' . $total['value_hr'] . '</dd>
            </dl>';
                }
                $order_view .= '
        </div>
    </div>
</div>';
            }
            if (!empty($content)) {
                if ($notify) {
                    $data = $this->get($order_id);
                    Mailer::setCustomer($data['customer']);
                    Mailer::setOrder(array('order_id' => $order_id));
                    $template = Mailer::getTemplate('update_order_status_' . $status_id);
                    $content = $template['content'] = str_replace('{hasComments}', '<br />' . $extra, $template['content']);
                    if ($status_id == 1) {
                        $template['content'] = str_replace('{orderView}', $order_view, $template['content']);
                    }
                    Mail::setTo($data['customer']['email']);
                    Mail::setSubject($template['title']);
                    Mail::setHtml($template['content']);
                    Mail::send();
                }
                if ($this->config->get('admin_notify_email')) {
                    $sendTo = array($this->config->get('email'));
                    $extraMails = $this->config->get('extra_notify_email');
                    if (!empty($extraMails)) {
                        $extraMails = explode(',', $extraMails);
                        foreach ($extraMails as $mail) {
                            if (!empty($mail) && filter_var($mail, \FILTER_VALIDATE_EMAIL)) {
                                $sendTo[] = $mail;
                            }
                        }
                    }
                    $data = $this->get($order_id);
                    Mailer::setCustomer($data['customer']);
                    Mailer::setOrder(array('order_id' => $order_id));
                    $template = Mailer::getTemplate('update_order_status_' . $status_id);
                    $template['content'] = str_replace('{hasComments}', '<br />' . $extra, $template['content']);
                    if ($status_id == 1) {
                        $template['content'] = str_replace('{orderView}', $order_view, $template['content']);
                    }
                    foreach ($sendTo as $to) {
                        Mail::setTo($to);
                        Mail::setSubject($template['title']);
                        Mail::setHtml($template['content']);
                        Mail::send();
                    }
                }
            }
        }
        // Fallback
        if ($status_id != 1) {
            $template = Mailer::getTemplate('update_order_status_' . $status_id);
            $content = $template['content'];
            $content = str_replace('{hasComments}', '<br />' . $extra, $content);
            $content = str_replace('{orderView}', '', $content);
        } else {
            $content = $extra;
        }
        $this->query("INSERT INTO PREFIX_orders_history\n            SET order_id        = :id,\n                status_id       = :status,\n                notify          = :notify,\n                comment         = :comment,\n                history_date    = :date", array('id' => $order_id, 'status' => $status_id, 'notify' => $notify, 'comment' => !empty($content) ? $content : '', 'date' => date('Y-m-d H:i:s')));
        Cache::removeAll();
        return true;
    }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:101,代码来源:order.php

示例13: optionStock

 public function optionStock()
 {
     $value_id = $this->request->post['value_id'];
     if (!$value_id) {
         return;
     }
     Database::query("UPDATE PREFIX_product_option_value SET quantity = " . (int) $this->request->post['quantity'] . " WHERE value_id = " . (int) $value_id);
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:9,代码来源:product.php

示例14: deleteReview

 public function deleteReview($reviewID)
 {
     $this->query("DELETE FROM PREFIX_review\n            WHERE review_id = :reviewID", array('reviewID' => $reviewID));
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:5,代码来源:review.php

示例15: removeStore

 public function removeStore($store_id)
 {
     if (!$store_id) {
         return;
     }
     // Remove apps that are installed on the store
     $this->query("DELETE FROM PREFIX_apps_active WHERE store_id = :id", array('id' => $store_id));
     // Fetch blogs that are added for this store
     foreach ($this->fetchAll("SELECT blog_id FROM PREFIX_blog WHERE store_id = :id", array('id' => $store_id)) as $blog) {
         $this->query("DELETE FROM PREFIX_blog_description WHERE blog_id = :id", array('id' => $blog['blog_id']));
     }
     $this->query("DELETE FROM PREFIX_blog WHERE store_id = :id", array('id' => $store_id));
     // Fetch categories that are linked to this store
     foreach ($this->fetchAll("SELECT category_id FROM PREFIX_category_to_store WHERE store_id = :id", array('id' => $store_id)) as $cat) {
         $this->query("DELETE FROM PREFIX_category_to_store WHERE category_id = :id AND store_id = :sid", array('id' => $cat['category_id'], 'sid' => $store_id));
         $check = $this->query("SELECT COUNT(*) AS total FROM PREFIX_category_to_store WHERE category_id = :id", array('id' => $cat['category_id']))->fetch();
         if (!$check['total']) {
             // Prevent "floating" category, remove all references
             $this->query("DELETE FROM PREFIX_category WHERE category_id = :id", array('id' => $cat['category_id']));
             $this->query("DELETE FROM PREFIX_category_description WHERE category_id = :id", array('id' => $cat['category_id']));
             $this->query("DELETE FROM PREFIX_category_path WHERE category_id = :id OR path_id = :cid", array('id' => $cat['category_id'], 'cid' => $cat['category_id']));
             $this->query("DELETE FROM PREFIX_coupon_category WHERE category_id = :id", array('id' => $cat['category_id']));
             $this->query("DELETE FROM PREFIX_url_alias WHERE query = :query", array('query' => 'category_id=' . $cat['category_id']));
             // Fetch all products that are linked to that category
             foreach ($this->fetchAll("SELECT product_id FROM PREFIX_product_to_category WHERE category_id = :id", array('id' => $cat['category_id'])) as $product) {
                 $this->query("DELETE FROM PREFIX_product_to_category WHERE category_id = :id", array('id' => $cat['category_id']));
                 $check2 = $this->query("SELECT COUNT(*) AS total FROM PREFIX_product_to_category WHERE product_id = :id", array('id' => $product['product_id']))->fetch();
                 if (!$check2['total']) {
                     // Prevent "floating" products, remove all references
                     $this->query("DELETE FROM PREFIX_product WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_attribute WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_description WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_discount WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_image WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_option WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_option_description WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_related WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_special WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_to_category WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_to_download WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_product_to_store WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_review WHERE product_id = :product_id", $product);
                     $this->query("DELETE FROM PREFIX_url_alias WHERE query = :query", array('query' => 'product_id=' . $product['product_id']));
                 }
             }
         }
     }
     // Fetch all customers from that store
     /*
     foreach ($this->fetchAll("SELECT customer_id FROM PREFIX_customer WHERE store_id = :id", array('id' => $store_id)) as $customer) {
         $this->query("DELETE FROM PREFIX_customer_history WHERE customer_id = :id", array('id' => $customer['customer_id']));
         $this->query("DELETE FROM PREFIX_customer_ip WHERE customer_id = :id", array('id' => $customer['customer_id']));
         $this->query("DELETE FROM PREFIX_customer_login_history WHERE customer_id = :id", array('id' => $customer['customer_id']));
         $this->query("DELETE FROM PREFIX_customer_online WHERE customer_id = :id", array('id' => $customer['customer_id']));
         $this->query("DELETE FROM PREFIX_reward WHERE customer_id = :id", array('id' => $customer['customer_id']));
         $this->query("DELETE FROM PREFIX_customer_transaction WHERE customer_id = :id", array('id' => $customer['customer_id']));
         $this->query("DELETE FROM PREFIX_address WHERE customer_id = :id", array('id' => $customer['customer_id']));
         $this->query("DELETE FROM PREFIX_review WHERE customer_id = :id", array('id' => $customer['customer_id']));
     }
     */
     // Instead of removing customer data, update customers to main store
     $this->query("UPDATE PREFIX_customer SET store_id = 0 WHERE store_id = :id", array('id' => $store_id));
     // Fetch information pages that are added for this store
     foreach ($this->fetchAll("SELECT information_id FROM PREFIX_information_to_store WHERE store_id = :id", array('id' => $store_id)) as $information) {
         $this->query("DELETE FROM PREFIX_information_to_store WHERE store_id = :id", array('id' => $store_id));
         $check = $this->query("SELECT COUNT(*) AS total FROM PREFIX_information_to_store WHERE information_id = :id", array('id' => $information['information_id']));
         if (!count($check)) {
             $this->query("DELETE FROM PREFIX_information_description WHERE information_id = :id", array('id' => $information['information_id']));
             $this->query("DELETE FROM PREFIX_information WHERE information_id = :id", array('id' => $information['id']));
         }
     }
     // Remove all aliases
     $this->query("DELETE FROM PREFIX_url_alias WHERE store_id = :id", array('id' => $store_id));
     // Remove all settings
     $this->query("DELETE FROM PREFIX_settings_stores WHERE store_id = :id", array('id' => $store_id));
     // And finally...
     $this->query("DELETE FROM PREFIX_stores WHERE store_id = :id", array('id' => $store_id));
     Cache::removeAll();
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:79,代码来源:stores.php


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