本文整理汇总了PHP中osC_Cache::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP osC_Cache::clear方法的具体用法?PHP osC_Cache::clear怎么用?PHP osC_Cache::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osC_Cache
的用法示例。
在下文中一共展示了osC_Cache::clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveWizard
function saveWizard()
{
global $toC_Json, $osC_Language, $osC_Database;
$error = false;
$configurations = $toC_Json->decode($_REQUEST['data']);
foreach ($configurations as $index => $configurations) {
$configuration = get_object_vars($configurations);
foreach ($configuration as $key => $value) {
$Qupdate = $osC_Database->query('update :table_configuration set configuration_value = :configuration_value, last_modified = now() where configuration_key = :configuration_key');
$Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qupdate->bindValue(':configuration_value', $value);
$Qupdate->bindValue(':configuration_key', $key);
$Qupdate->execute();
if ($osC_Database->isError()) {
$error = true;
break;
}
}
}
if ($error === false) {
require_once 'includes/classes/desktop_settings.php';
$toC_Desktop_Settings = new toC_Desktop_Settings();
$toC_Desktop_Settings->setWizardComplete();
$response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
osC_Cache::clear('configuration');
} else {
$response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
}
echo $toC_Json->encode($response);
}
示例2: saveData
function saveData($data)
{
global $osC_Database;
$error = false;
foreach ($data['keywords'] as $key => $value) {
$Qconfiguration = $osC_Database->query("update :table_configuration set configuration_value = :configuration_value where configuration_key = :configuration_key");
$Qconfiguration->bindValue(":configuration_key", 'HOME_META_KEYWORD_' . $key);
$Qconfiguration->bindValue(":configuration_value", $value);
$Qconfiguration->bindTable(":table_configuration", TABLE_CONFIGURATION);
$Qconfiguration->execute();
if ($osC_Database->isError()) {
$error = true;
break;
}
}
foreach ($data['descriptions'] as $key => $value) {
$Qconfiguration = $osC_Database->query("update :table_configuration set configuration_value = :configuration_value where configuration_key = :configuration_key");
$Qconfiguration->bindValue(":configuration_key", 'HOME_META_DESCRIPTION_' . $key);
$Qconfiguration->bindValue(":configuration_value", $value);
$Qconfiguration->bindTable(":table_configuration", TABLE_CONFIGURATION);
$Qconfiguration->execute();
if ($osC_Database->isError()) {
$error = true;
break;
}
}
if ($error === false) {
osC_Cache::clear("configuration");
return true;
}
return false;
}
示例3: remove
function remove()
{
global $osC_Database, $osC_Language;
$Qdel = $osC_Database->query('delete from :table_templates_boxes where code = :code and modules_group = :modules_group');
$Qdel->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
$Qdel->bindValue(':code', $this->_code);
$Qdel->bindValue(':modules_group', $this->_group);
$Qdel->execute();
if ($this->hasKeys()) {
$Qdel = $osC_Database->query('delete from :table_configuration where configuration_key in (":configuration_key")');
$Qdel->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qdel->bindRaw(':configuration_key', implode('", "', $this->getKeys()));
$Qdel->execute();
}
if (file_exists('../includes/languages/' . $osC_Language->getCode() . '/modules/' . $this->_group . '/' . $this->_code . '.xml')) {
foreach ($osC_Language->extractDefinitions($osC_Language->getCode() . '/modules/' . $this->_group . '/' . $this->_code . '.xml') as $def) {
$Qdel = $osC_Database->query('delete from :table_languages_definitions where definition_key = :definition_key and content_group = :content_group');
$Qdel->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
$Qdel->bindValue(':definition_key', $def['key']);
$Qdel->bindValue(':content_group', $def['group']);
$Qdel->execute();
}
osC_Cache::clear('languages');
}
}
示例4: save
public static function save($id = null, $data, $default = false)
{
global $osC_Database, $osC_Language;
if (is_numeric($id)) {
$group_id = $id;
} else {
$Qgroup = $osC_Database->query('select max(id) as id from :table_products_images_groups');
$Qgroup->bindTable(':table_products_images_groups', TABLE_PRODUCTS_IMAGES_GROUPS);
$Qgroup->execute();
$group_id = $Qgroup->valueInt('id') + 1;
}
$error = false;
$osC_Database->startTransaction();
foreach ($osC_Language->getAll() as $l) {
if (is_numeric($id)) {
$Qgroup = $osC_Database->query('update :table_products_images_groups set title = :title, code = :code, size_width = :size_width, size_height = :size_height, force_size = :force_size where id = :id and language_id = :language_id');
} else {
$Qgroup = $osC_Database->query('insert into :table_products_images_groups (id, language_id, title, code, size_width, size_height, force_size) values (:id, :language_id, :title, :code, :size_width, :size_height, :force_size)');
}
$Qgroup->bindTable(':table_products_images_groups', TABLE_PRODUCTS_IMAGES_GROUPS);
$Qgroup->bindInt(':id', $group_id);
$Qgroup->bindValue(':title', $data['title'][$l['id']]);
$Qgroup->bindValue(':code', $data['code']);
$Qgroup->bindInt(':size_width', $data['width']);
$Qgroup->bindInt(':size_height', $data['height']);
$Qgroup->bindInt(':force_size', $data['force_size'] === true ? 1 : 0);
$Qgroup->bindInt(':language_id', $l['id']);
$Qgroup->setLogging($_SESSION['module'], $group_id);
$Qgroup->execute();
if ($osC_Database->isError()) {
$error = true;
break;
}
}
if ($error === false) {
if ($default === true) {
$Qupdate = $osC_Database->query('update :table_configuration set configuration_value = :configuration_value where configuration_key = :configuration_key');
$Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qupdate->bindInt(':configuration_value', $group_id);
$Qupdate->bindValue(':configuration_key', 'DEFAULT_IMAGE_GROUP_ID');
$Qupdate->setLogging($_SESSION['module'], $group_id);
$Qupdate->execute();
if ($osC_Database->isError()) {
$error = true;
}
}
}
if ($error === false) {
$osC_Database->commitTransaction();
osC_Cache::clear('images_groups');
if ($default === true) {
osC_Cache::clear('configuration');
}
return true;
}
$osC_Database->rollbackTransaction();
return false;
}
示例5: save
function save($id = null, $data, $default = false)
{
global $osC_Database, $osC_Language;
$error = false;
$osC_Database->startTransaction();
if (is_numeric($id)) {
$orders_status_id = $id;
} else {
$Qstatus = $osC_Database->query('select max(orders_status_id) as orders_status_id from :table_orders_status');
$Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
$Qstatus->execute();
$orders_status_id = $Qstatus->valueInt('orders_status_id') + 1;
}
foreach ($osC_Language->getAll() as $l) {
if (is_numeric($id)) {
$Qstatus = $osC_Database->query('update :table_orders_status set orders_status_name = :orders_status_name, public_flag = :public_flag, downloads_flag = :downloads_flag, returns_flag = :returns_flag, gift_certificates_flag = :gift_certificates_flag where orders_status_id = :orders_status_id and language_id = :language_id');
} else {
$Qstatus = $osC_Database->query('insert into :table_orders_status (orders_status_id, language_id, orders_status_name, public_flag, downloads_flag, returns_flag, gift_certificates_flag) values (:orders_status_id, :language_id, :orders_status_name, :public_flag, :downloads_flag, :returns_flag, :gift_certificates_flag)');
}
$Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
$Qstatus->bindInt(':orders_status_id', $orders_status_id);
$Qstatus->bindValue(':orders_status_name', $data['name'][$l['id']]);
$Qstatus->bindInt(':public_flag', $data['public_flag']);
$Qstatus->bindInt(':downloads_flag', $data['downloads_flag']);
$Qstatus->bindInt(':returns_flag', $data['returns_flag']);
$Qstatus->bindInt(':gift_certificates_flag', $data['gift_certificates_flag']);
$Qstatus->bindInt(':language_id', $l['id']);
$Qstatus->setLogging($_SESSION['module'], $orders_status_id);
$Qstatus->execute();
if ($osC_Database->isError()) {
$error = true;
break;
}
}
if ($error === false) {
if ($default === true) {
$Qupdate = $osC_Database->query('update :table_configuration set configuration_value = :configuration_value where configuration_key = :configuration_key');
$Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qupdate->bindInt(':configuration_value', $orders_status_id);
$Qupdate->bindValue(':configuration_key', 'DEFAULT_ORDERS_STATUS_ID');
$Qupdate->setLogging($_SESSION['module'], $orders_status_id);
$Qupdate->execute();
if ($osC_Database->isError()) {
$error = true;
}
}
}
if ($error === false) {
$osC_Database->commitTransaction();
if ($default === true) {
osC_Cache::clear('configuration');
}
return true;
}
$osC_Database->rollbackTransaction();
return false;
}
示例6: deleteCaches
function deleteCaches()
{
global $toC_Json, $osC_Language;
$ids = explode(',', $_REQUEST['batch']);
foreach ($ids as $id) {
osC_Cache::clear($id);
}
$response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
echo $toC_Json->encode($response);
}
示例7: save
function save($id = null, $data, $default = false)
{
global $osC_Database, $osC_Language;
$error = false;
$osC_Database->startTransaction();
if (is_numeric($id)) {
$unit_class_id = $id;
} else {
$Qunit = $osC_Database->query('select max(quantity_unit_class_id) as quantity_unit_class_id from :table_quantity_unit_classes');
$Qunit->bindTable(':table_quantity_unit_classes', TABLE_QUANTITY_UNIT_CLASSES);
$Qunit->execute();
$unit_class_id = $Qunit->valueInt('quantity_unit_class_id') + 1;
}
foreach ($osC_Language->getAll() as $l) {
if (is_numeric($id)) {
$Qunit = $osC_Database->query('update :table_quantity_unit_classes set quantity_unit_class_title = :quantity_unit_class_title where quantity_unit_class_id = :quantity_unit_class_id and language_id = :language_id');
} else {
$Qunit = $osC_Database->query('insert into :table_quantity_unit_classes (quantity_unit_class_id, language_id, quantity_unit_class_title) values (:quantity_unit_class_id, :language_id, :quantity_unit_class_title)');
}
$Qunit->bindTable(':table_quantity_unit_classes', TABLE_QUANTITY_UNIT_CLASSES);
$Qunit->bindInt(':quantity_unit_class_id', $unit_class_id);
$Qunit->bindValue(':quantity_unit_class_title', $data['unit_class_title'][$l['id']]);
$Qunit->bindInt(':language_id', $l['id']);
$Qunit->setLogging($_SESSION['module'], $unit_class_id);
$Qunit->execute();
if ($osC_Database->isError()) {
$error = true;
break;
}
}
if ($error === false) {
if ($default === true) {
$Qupdate = $osC_Database->query('update :table_configuration set configuration_value = :configuration_value where configuration_key = :configuration_key');
$Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qupdate->bindInt(':configuration_value', $unit_class_id);
$Qupdate->bindValue(':configuration_key', 'DEFAULT_UNIT_CLASSES');
$Qupdate->setLogging($_SESSION['module'], $unit_class_id);
$Qupdate->execute();
if ($osC_Database->isError()) {
$error = true;
}
}
}
if ($error === false) {
$osC_Database->commitTransaction();
if ($default === true) {
osC_Cache::clear('configuration');
}
return true;
}
return false;
}
示例8: setStatus
function setStatus($id, $status)
{
global $osC_Database;
$Qcc = $osC_Database->query('update :table_credit_cards set credit_card_status = :credit_card_status where id = :id');
$Qcc->bindTable(':table_credit_cards', TABLE_CREDIT_CARDS);
$Qcc->bindInt(':credit_card_status', $status === true ? 1 : 0);
$Qcc->bindInt(':id', $id);
$Qcc->setLogging($_SESSION['module'], $id);
$Qcc->execute();
if ($Qcc->affectedRows()) {
osC_Cache::clear('credit-cards');
return true;
}
}
示例9: delete
function delete($id)
{
global $osC_Database;
$QguestBook = $osC_Database->query('delete from :table_guest_books where guest_books_id = :guest_books_id');
$QguestBook->bindTable(':table_guest_books', TABLE_GUEST_BOOKS);
$QguestBook->bindInt(':guest_books_id', $id);
$QguestBook->setLogging($_SESSION['module'], $id);
$QguestBook->execute();
if (!$osC_Database->isError()) {
osC_Cache::clear('box-guest-book');
return true;
}
return false;
}
示例10: save
function save($id, $value)
{
global $osC_Database;
$Qstatus = $osC_Database->query('update :table_products_frontpage set sort_order = :sort_order where products_id = :products_id');
$Qstatus->bindTable(':table_products_frontpage', TABLE_PRODUCTS_FRONTPAGE);
$Qstatus->bindInt(':products_id', $id);
$Qstatus->bindInt(':sort_order', $value);
$Qstatus->setLogging($_SESSION['module'], $id);
$Qstatus->execute();
if (!$osC_Database->isError()) {
osC_Cache::clear('feature-products');
return true;
}
return false;
}
示例11: save
function save($id, $value)
{
global $osC_Database;
$Qupdate = $osC_Database->query('update :table_configuration set configuration_value = :configuration_value, last_modified = now() where configuration_id = :configuration_id');
$Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qupdate->bindValue(':configuration_value', $value);
$Qupdate->bindInt(':configuration_id', $id);
$Qupdate->setLogging($_SESSION['module'], $id);
$Qupdate->execute();
if ($Qupdate->affectedRows()) {
osC_Cache::clear('configuration');
return true;
}
return false;
}
示例12: save
function save($id, $data)
{
global $osC_Database;
$Qreview = $osC_Database->query('update :table_reviews set reviews_text = :reviews_text, reviews_rating = :reviews_rating, last_modified = now() where reviews_id = :reviews_id');
$Qreview->bindTable(':table_reviews', TABLE_REVIEWS);
$Qreview->bindValue(':reviews_text', $data['review']);
$Qreview->bindInt(':reviews_rating', $data['rating']);
$Qreview->bindInt(':reviews_id', $id);
$Qreview->setLogging($_SESSION['module'], $id);
$Qreview->execute();
if (!$osC_Database->isError()) {
osC_Cache::clear('reviews');
return true;
}
return false;
}
示例13: uninstall
function uninstall()
{
global $toC_Json, $osC_Language;
$key = $_REQUEST['module_code'];
if (file_exists('includes/modules/geoip/' . $key . '.php')) {
include 'includes/modules/geoip/' . $key . '.php';
$module = 'osC_GeoIP_' . $key;
$module = new $module();
$module->remove();
osC_Cache::clear('modules-geoip');
osC_Cache::clear('configuration');
$response['success'] = true;
$response['feedback'] = $osC_Language->get('ms_success_action_performed');
} else {
$response['success'] = false;
$response['feedback'] = $osC_Language->get('ms_error_action_not_performed');
}
echo $toC_Json->encode($response);
}
示例14: save
public static function save($parameter)
{
global $osC_Database;
$Qcfg = $osC_Database->query('select configuration_id from :table_configuration where configuration_key = :configuration_key');
$Qcfg->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qcfg->bindValue(':configuration_key', key($parameter));
$Qcfg->execute();
if ($Qcfg->numberOfRows() === 1) {
$Qupdate = $osC_Database->query('update :table_configuration set configuration_value = :configuration_value, last_modified = now() where configuration_key = :configuration_key');
$Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qupdate->bindValue(':configuration_value', $parameter[key($parameter)]);
$Qupdate->bindValue(':configuration_key', key($parameter));
$Qupdate->setLogging($_SESSION['module'], $Qcfg->valueInt('configuration_id'));
$Qupdate->execute();
if ($Qupdate->affectedRows()) {
osC_Cache::clear('configuration');
return true;
}
}
return false;
}
示例15: __construct
function __construct()
{
global $osC_Language, $osC_MessageStack;
$this->_page_title = $osC_Language->get('heading_title');
if (!isset($_GET['action'])) {
$_GET['action'] = '';
}
// check if the cache directory exists
if (is_dir(DIR_FS_WORK)) {
if (!is_writeable(DIR_FS_WORK)) {
$osC_MessageStack->add('header', sprintf($osC_Language->get('ms_error_cache_directory_not_writable'), DIR_FS_WORK), 'error');
}
} else {
$osC_MessageStack->add('header', sprintf($osC_Language->get('ms_error_cache_directory_non_existant'), DIR_FS_WORK), 'error');
}
if (!empty($_GET['action'])) {
switch ($_GET['action']) {
case 'delete':
/*HPDL
if ( osC_Cache::clear($_GET['block']) ) {
$osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
} else {
$osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
}
*/
osC_Cache::clear($_GET['block']);
osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
break;
case 'batchDelete':
if (isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch'])) {
foreach ($_POST['batch'] as $id) {
osC_Cache::clear($id);
}
osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
}
break;
}
}
}