/** * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // delete posting template data $config_text = $this->container->get('config_text'); $db = $this->container->get('dbal.conn'); $config_text_table = $this->container->getParameter('tables.config_text'); // there's no method in the config_text service to retrieve the names with a sql like expression, so we do it with a query here. $sql = 'SELECT config_name FROM ' . $config_text_table . ' WHERE config_name ' . $db->sql_like_expression('marttiphpbb_postingtemplate_forum' . $db->get_any_char()); $result = $db->sql_query($sql); $postingtemplates = $db->sql_fetchrowset($result); $db->sql_freeresult($result); if (sizeof($postingtemplates)) { $postingtemplates = array_map(function ($row) { return $row['config_name']; }, $postingtemplates); $config_text->delete_array($postingtemplates); } return '1'; break; default: return parent::purge_step($old_state); break; } }
public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet global $phpbb_root_path; $phpbb_store_path = $phpbb_root_path . 'store/'; $this->del_content_dir('d120de/banner/default/'); $this->del_content_dir('d120de/banner/event/'); $this->del_content_dir('d120de/banner/'); unlink($phpbb_store_path . 'd120de/index.htm'); //this fails if there are other folders than banner $del_res = rmdir($phpbb_store_path . 'd120de/'); if ($del_res === false) { //we faild create index.htm again touch($phpbb_store_path . 'd120de/index.htm'); } return 'del_content_dir'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
public function purge_step($old_state) { global $phpbb_root_path; $database = $phpbb_root_path . 'store/messenger.db'; if (is_file($database)) { unlink($database); } return parent::purge_step($old_state); }
/** * Single purge step * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ public function purge_step($old_state) { switch ($old_state) { case '': // Before the first migration // Remove the remember flag for sortables being the default captcha. return $this->handle_default_captcha_on('purge'); default: // Run parent purge step method return parent::purge_step($old_state); } }
/** * Overwrite purge_step to purge Auto Groups notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge Auto Groups notifications return $this->notification_handler('purge', array('phpbb.autogroups.notification.type.group_added', 'phpbb.autogroups.notification.type.group_removed')); break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet $phpbb_root_path = $this->container->getParameter('core.root_path'); $user = $this->container->get('user'); $customcode_directory = new customcode_directory($user, $phpbb_root_path); $customcode_directory->remove(); return '1'; break; default: return parent::purge_step($old_state); break; } }
/** * Overwrite purge_step to purge advanced polls notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge board rules notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('wolfsblvt.advancedpolls.notification.type.pollended'); return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
function purge_step($old_state) { switch ($old_state) { case '': try { $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('dmzx.ultimatepoints.notification.type.points'); } catch (\phpbb\notification\exception $e) { // continue } return 'notifications'; break; default: return parent::purge_step($old_state); break; } }
public function purge_step($old_state) { global $phpbb_root_path; $database = $phpbb_root_path . 'store/messenger.db'; if (is_file($database)) { unlink($database); } $messengerDir = $phpbb_root_path . 'store/messenger'; if (is_dir($messengerDir)) { $objects = scandir($messengerDir); foreach ($objects as $object) { if ($object != '.' && $object != '..') { if (filetype($messengerDir . "/" . $object) == "dir") { rmdir($messengerDir . "/" . $object); } else { unlink($messengerDir . "/" . $object); } } } reset($objects); rmdir($messengerDir); } return parent::purge_step($old_state); }
function purge_step($old_state) { $ret = parent::purge_step($old_state); return $ret; }
/** * Single purge step that reverts any included and installed migrations * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge notifications return $this->notification_handler('purge', array('ernadoo.phpbbdirectory.notification.type.directory_website', 'ernadoo.phpbbdirectory.notification.type.directory_website_approved', 'ernadoo.phpbbdirectory.notification.type.directory_website_disapproved', 'ernadoo.phpbbdirectory.notification.type.directory_website_error_cron', 'ernadoo.phpbbdirectory.notification.type.directory_website_in_queue')); break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * Overwrite purge_step to purge board rules notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge board rules notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('alg.adminnotifications.notification.type.fromadmin'); return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * Overwrite purge_step to purge notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('gfksx.thanksforposts.notification.type.thanks'); $phpbb_notifications->purge_notifications('gfksx.thanksforposts.notification.type.thanks_remove'); return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * Overwrite purge_step to purge reputation notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge reputation notifications $phpbb_notifications = $this->container->get('notification_manager'); foreach ($this->reputation_notification_types as $reputation_notification_type) { $phpbb_notifications->purge_notifications($reputation_notification_type); } return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * Purge our notifications * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $this->container->get('notification_manager'); foreach (self::$notification_types as $type) { $phpbb_notifications->purge_notifications($type); } return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * @see \phpbb\extension\base::purge_step() */ public function purge_step($old_state) { switch ($old_state) { case '': $phpbb_notifications = $this->container->get('notification_manager'); foreach ($this->notification_types as $notification_type) { $phpbb_notifications->purge_notifications($notification_type); } return 'notifications'; break; default: return parent::purge_step($old_state); break; } }
/** * Single purge step that reverts any included and installed migrations * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet /** * @todo Remove this try/catch condition once purge_notifications is fixed * in the core to work with disabled extensions without fatal errors. * https://tracker.phpbb.com/browse/PHPBB3-12435 */ try { // Purge board rules notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_image_for_approval'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_image_approved'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_new_image'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_new_comment'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_new_report'); } catch (\phpbb\notification\exception $e) { // continue } return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }