本文整理汇总了PHP中waAppSettingsModel::del方法的典型用法代码示例。如果您正苦于以下问题:PHP waAppSettingsModel::del方法的具体用法?PHP waAppSettingsModel::del怎么用?PHP waAppSettingsModel::del使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waAppSettingsModel
的用法示例。
在下文中一共展示了waAppSettingsModel::del方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
$path = $this->getConfig()->getConfigPath('data/welcome/', false);
if (file_exists($path)) {
$files = waFiles::listdir($path, false);
$this->types = shopTypeModel::getTemplates();
foreach ($files as $file) {
if (preg_match('/^country_([a-z]{3})\\.php$/', $file, $matches)) {
$this->countries[$matches[1]] = $matches[1];
}
}
}
$locale_path = $path . 'locale/' . $this->getUser()->getLocale() . '.php';
if (file_exists($locale_path)) {
$this->translate = (include $locale_path);
if (!is_array($this->translate)) {
$this->translate = array();
}
}
if (waRequest::post()) {
$app_settings_model = new waAppSettingsModel();
$app_settings_model->del('shop', 'welcome');
$this->setup();
} else {
$this->overview();
}
}
示例2: execute
public function execute()
{
if (waRequest::post()) {
$app_settings_model = new waAppSettingsModel();
$app_settings_model->del('shop', 'checkout_flow_changed');
}
}
示例3: execute
public function execute()
{
try {
$message = array();
$settings = waRequest::get('setting');
if ($settings) {
$model = new waAppSettingsModel();
$changed = false;
foreach ((array) $settings as $setting) {
if (in_array($setting, array('auth_form_background'))) {
$images_path = wa()->getDataPath(null, true, 'webasyst');
if ($images = waFiles::listdir($images_path)) {
foreach ($images as $image) {
if (is_file($images_path . '/' . $image) && !preg_match('@\\.(jpe?g|png|gif|bmp)$@', $image)) {
waFiles::delete($images_path . "/" . $image);
}
}
$message[] = _w('Image deleted');
}
} else {
$changed = true;
}
$model->del('webasyst', $setting);
}
if ($changed) {
$message[] = _w('Settings saved');
}
}
$params = array('module' => 'settings', 'msg' => installerMessage::getInstance()->raiseMessage(implode(', ', $message)));
$this->redirect($params);
} catch (waException $ex) {
$msg = installerMessage::getInstance()->raiseMessage($ex->getMessage(), installerMessage::R_FAIL);
$params = array('module' => 'settings', 'msg' => $msg);
$this->redirect($params);
}
}
示例4: uninstall
public function uninstall()
{
// check uninstall.php
$file = $this->getAppConfigPath('uninstall');
if (file_exists($file)) {
include $file;
}
$file_db = $this->getAppPath('lib/config/db.php');
if (file_exists($file_db)) {
$schema = (include $file_db);
$model = new waModel();
foreach ($schema as $table => $fields) {
$sql = "DROP TABLE IF EXISTS " . $table;
$model->exec($sql);
}
}
// Remove all app settings
$app_settings_model = new waAppSettingsModel();
$app_settings_model->del($this->application);
$contact_settings_model = new waContactSettingsModel();
$contact_settings_model->deleteByField('app_id', $this->application);
// Remove all rights to app
$contact_rights_model = new waContactRightsModel();
$contact_rights_model->deleteByField('app_id', $this->application);
// Remove logs
$log_model = new waLogModel();
$log_model->deleteByField('app_id', $this->application);
// Remove cache
waFiles::delete($this->getPath('cache') . '/apps/' . $this->application);
}
示例5: setGeoCoords
private function setGeoCoords($value)
{
if (!isset($value['data'])) {
return $value;
}
$sm = new waAppSettingsModel();
$app_id = 'webasyst';
$name = 'geocoding';
$last_geocoding = $sm->get($app_id, $name, 0);
if (time() - $last_geocoding >= 3600) {
$response = $this->sendGeoCodingRequest($value);
if ($response) {
$response = json_decode($response, true);
if ($response['status'] == "OK") {
$sm->del($app_id, $name);
foreach ($response['results'] as $result) {
if (empty($result['partial_match'])) {
// address correct, geocoding without errors
$value['data']['lat'] = ifset($result['geometry']['location']['lat'], '');
$value['data']['lng'] = ifset($result['geometry']['location']['lng'], '');
break;
}
}
} else {
if ($response['status'] == "OVER_QUERY_LIMIT") {
$sm->set($app_id, $name, time());
}
}
}
}
return $value;
}
示例6: uninstall
public function uninstall()
{
// check uninstall.php
$file = $this->path . '/lib/config/uninstall.php';
if (file_exists($file)) {
include $file;
}
$file_db = $this->path . '/lib/config/db.php';
if (file_exists($file_db)) {
$schema = (include $file_db);
$model = new waModel();
foreach ($schema as $table => $fields) {
$sql = "DROP TABLE IF EXISTS " . $table;
$model->exec($sql);
}
}
// Remove plugin settings
$app_settings_model = new waAppSettingsModel();
$app_settings_model->del($this->app_id . "." . $this->id);
if (!empty($this->info['rights'])) {
// Remove rights to plugin
$contact_rights_model = new waContactRightsModel();
$sql = "DELETE FROM " . $contact_rights_model->getTableName() . "\n WHERE app_id = s:app_id AND (\n name = '" . $contact_rights_model->escape('plugin.' . $this->id) . "' OR\n name LIKE '" . $contact_rights_model->escape('plugin.' . $this->id) . ".%'\n )";
$contact_rights_model->exec($sql, array('app_id' => $this->app_id));
}
// Remove cache of the appliaction
waFiles::delete(wa()->getAppCachePath('', $this->app_id));
}
示例7: reset
public function reset()
{
$this->settings = null;
self::$model->del($this->name);
$this->load();
}