/** * @param IfwPsn_Wp_Plugin_Manager $pm * @param $networkwide * @return mixed */ public function execute(IfwPsn_Wp_Plugin_Manager $pm, $networkwide = false) { if (IfwPsn_Wp_Proxy_Blog::isMultisite() && $networkwide == true) { // multisite installation $currentBlogId = IfwPsn_Wp_Proxy_Blog::getBlogId(); foreach (IfwPsn_Wp_Proxy_Blog::getMultisiteBlogIds() as $blogId) { IfwPsn_Wp_Proxy_Blog::switchToBlog($blogId); $this->_refreshPresentVersion($pm); } IfwPsn_Wp_Proxy_Blog::switchToBlog($currentBlogId); } else { // single blog installation $this->_refreshPresentVersion($pm); } }
/** * @param IfwPsn_Wp_Plugin_Manager|null $pm * @return mixed|void */ public static function execute($pm) { if (!$pm instanceof IfwPsn_Wp_Plugin_Manager) { return; } if (IfwPsn_Wp_Proxy_Blog::isMultisite()) { // multisite installation $currentBlogId = IfwPsn_Wp_Proxy_Blog::getBlogId(); foreach (IfwPsn_Wp_Proxy_Blog::getMultisiteBlogIds() as $blogId) { IfwPsn_Wp_Proxy_Blog::switchToBlog($blogId); $pm->getOptions()->reset(); } IfwPsn_Wp_Proxy_Blog::switchToBlog($currentBlogId); } else { // single blog installation $pm->getOptions()->reset(); } }
/** * @param bool $networkwide */ public function execute($networkwide = false) { if (IfwPsn_Wp_Proxy_Blog::isMultisite() && $networkwide == true) { // multisite installation // get the current blog id $currentBlogId = IfwPsn_Wp_Proxy_Blog::getBlogId(); // loop through all blogs foreach (IfwPsn_Wp_Proxy_Blog::getMultisiteBlogIds() as $blogId) { IfwPsn_Wp_Proxy_Blog::switchToBlog($blogId); // execute networkwide task $this->_execute(); } // switch back to current blog IfwPsn_Wp_Proxy_Blog::switchToBlog($currentBlogId); } else { // no network found or no networkwide execution requested // execute single blog task $this->_execute(); } }
/** * (non-PHPdoc) * @see IfwPsn_Wp_Plugin_Installer_ActivationInterface::execute() */ public function execute(IfwPsn_Wp_Plugin_Manager $pm, $networkwide = false) { if ($pm->isPremium() && IfwPsn_Wp_Proxy_Blog::isPluginActive('post-status-notifier-lite/post-status-notifier-lite.php')) { trigger_error(sprintf(__('The Lite version of this plugin is still activated. Please deactivate it! Refer to the <a href=\\"%s\\">Upgrade Howto</a>.', 'psn'), 'http://docs.ifeelweb.de/post-status-notifier/upgrade_howto.html')); } $this->_dbPatcher = new Psn_Patch_Database(); if (IfwPsn_Wp_Proxy_Blog::isMultisite() && $networkwide == true) { // multisite installation $currentBlogId = IfwPsn_Wp_Proxy_Blog::getBlogId(); foreach (IfwPsn_Wp_Proxy_Blog::getMultisiteBlogIds() as $blogId) { // give every site in the network the default time limit of 30 seconds set_time_limit(30); IfwPsn_Wp_Proxy_Blog::switchToBlog($blogId); $this->_createTable(); $this->_presetOptions($pm); } IfwPsn_Wp_Proxy_Blog::switchToBlog($currentBlogId); } else { // single blog installation $this->_createTable(); $this->_presetOptions($pm); } }
/** (non-PHPdoc) * @see IfwPsn_Wp_Plugin_Installer_UninstallInterface::execute() */ public static function execute($pm, $networkwide = false) { // handle the DB if (IfwPsn_Wp_Proxy_Blog::isMultisite() && $networkwide == true) { // multisite installation $currentBlogId = IfwPsn_Wp_Proxy_Blog::getBlogId(); foreach (IfwPsn_Wp_Proxy_Blog::getMultisiteBlogIds() as $blogId) { IfwPsn_Wp_Proxy_Blog::switchToBlog($blogId); self::_dropTable($pm); } IfwPsn_Wp_Proxy_Blog::switchToBlog($currentBlogId); } else { // single blog installation self::_dropTable($pm); } // remove update action if ($pm->getConfig()->plugin->autoupdate == 1) { IfwPsn_Wp_Proxy_Action::remove('in_plugin_update_message-' . $pm->getPathinfo()->getFilenamePath(), array($pm->getBootstrap()->getUpdateManager(), 'onPluginUpdateMessage'), 10, 3); IfwPsn_Wp_Proxy_Filter::remove('pre_set_site_transient_update_plugins', array($pm->getBootstrap()->getUpdateManager(), 'checkForPremiumUpdate')); if ($pm->isPremium()) { IfwPsn_Wp_Proxy_Filter::remove('plugins_api', array($pm->getBootstrap()->getUpdateManager(), 'getPluginInfo'), 10, 3); } } }