public function GetOption($pOption, $pFlush = false, $pDefault = null) { if (null === $pDefault) { $pDefault = isset($this->_OPTIONS_DEFAULTS[$pOption]) ? $this->_OPTIONS_DEFAULTS[$pOption] : false; } return $this->_options->get_option($pOption, $pDefault); }
/** * Get cached record expiration, or false if not cached or expired. * * @author Vova Feldman (@svovaf) * @since 1.1.7.3 * * @param string $key * * @return bool|int */ function get_record_expiration($key) { $this->_logger->entrance('key = ' . $key); $cache_entry = $this->_options->get_option($key, false); if (is_object($cache_entry) && isset($cache_entry->timestamp) && is_numeric($cache_entry->timestamp) && $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME) { return $cache_entry->timestamp; } return false; }
/** * @author Vova Feldman (@svovaf) * @since 1.1.6 * * @param string $key * @param mixed $default * * @return mixed */ function get_valid($key, $default = null) { $this->_logger->entrance('key = ' . $key); $cache_entry = $this->_options->get_option($key, false); if (is_object($cache_entry) && isset($cache_entry->timestamp) && is_numeric($cache_entry->timestamp) && $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME) { return $cache_entry->result; } return $default; }
/** * @todo TEST IF IT WORKS!!! * * Include plugins for automatic updates based on stored settings. * * @see http://wordpress.stackexchange.com/questions/131394/how-do-i-exclude-plugins-from-getting-automatically-updated/131404#131404 * * @author Vova Feldman (@svovaf) * @since 1.0.4 * * @param bool $update Whether to update (not used for plugins) * @param object $item The plugin's info * * @return bool */ static function _include_plugins_in_auto_update($update, $item) { // Before version 3.8.2 the $item was the file name of the plugin, // while in 3.8.2 statistics were added (https://core.trac.wordpress.org/changeset/27905). $by_slug = (int) str_replace('.', '', get_bloginfo('version')) >= 382; if (!isset(self::$_auto_updated_plugins)) { $plugins = self::$_accounts->get_option('plugins', array()); $identifiers = array(); foreach ($plugins as $p) { /** * @var FS_Plugin $p */ if (isset($p->auto_update) && $p->auto_update) { $identifiers[] = $by_slug ? $p->slug : plugin_basename($p->file); } } self::$_auto_updated_plugins = $identifiers; } if (in_array($by_slug ? $item->slug : $item, self::$_auto_updated_plugins)) { return true; } // Pass update decision to next filters return $update; }
private function _store_user($store = true) { $users = self::$_accounts->get_option('users'); $users[$this->_user->id] = $this->_user; self::$_accounts->set_option('users', $users, $store); }
/** * Migration from account options stored in FS accounts object back to RW options object. * * @author Vova Feldman (@svovaf) * @since 2.6.3 * * @param FS_Option_Manager $fs_options * @param string $basename */ private function migrate_from_fs_options($fs_options, $basename) { // Load site information. $sites = $fs_options->get_option('sites'); $site = $sites[$basename]; // Load user information. $users = $fs_options->get_option('users'); $user = $users[$site->user_id]; // Update account information. $this->set($site->id, $site->public_key, $site->secret_key, $user->id, $user->email); // Remove RW account from FS object. unset($sites[$basename]); unset($users[$site->user_id]); $fs_options->set_option('sites', $sites); $fs_options->set_option('users', $users); $fs_options->store(); }
function get_option($option, $default = null) { return $this->_options->get_option($option, $default); }