/** * Class constructor. * * @since 160713 App stats. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->outdated_stats_time = strtotime('-1 week'); // No reason to post more than once per week, because our stats // database will not store it anyway. Must always be 1+ week apart. }
/** * Class constructor. * * @since 160710 License key utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); if (!$this->App->is_core) { throw $this->c::issue('Core only.'); } }
/** * Class constructor. * * @since 160524 Cap utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); for ($_i = 0; $_i <= 10; ++$_i) { $this->deprecated_levels[] = 'level_' . $_i; } }
/** * Class constructor. * * @since 160710 App utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); if (!$this->App->is_core) { throw $this->c::issue('Core only.'); } $this->apps = []; $this->apps_by_slug = []; $this->apps_by_type = []; $this->apps_by_network_wide = []; }
/** * Class constructor. * * @since 160524 Dependencies. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->plugins = []; $this->themes = []; $this->others = []; $this->checked = false; $this->outdated_check_time = strtotime('-15 minutes'); $this->maybeCheck(); // On instantiation. }
/** * Class constructor. * * @since 160524 Install utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $default_history = ['first_time' => 0, 'last_time' => 0, 'last_version' => '', 'versions' => []]; if (!is_array($this->history = $this->s::sysOption('install_history'))) { $this->history = $default_history; // Defaults. } $this->history = array_merge($default_history, $this->history); $this->history = array_intersect_key($this->history, $default_history); foreach ($default_history as $_key => $_default_history_value) { settype($this->history[$_key], gettype($_default_history_value)); } // unset($_key, $_default_history_value); // Can be adjusted in special circumstances, but never > 90 days. $this->trial_days = min(90, $this->s::applyFilters('trial_days', 30)); }
/** * Class constructor. * * @since 160709 Menu page utils. * * @param Classes\App $App Instance. * @param string $action ReST action identifier. * @param array $args Any additional behavioral args. */ public function __construct(Classes\App $App, string $action, array $args = []) { parent::__construct($App); $this->action = $action; $default_args = ['Widget' => null, 'slug' => '', 'auto_prefix' => true, 'action_url' => '', 'method' => 'post']; $this->cfg = (object) array_merge($default_args, $args); if (!$this->cfg->Widget instanceof Classes\SCore\Base\Widget) { $this->cfg->Widget = null; // Invalid; nullify. } $this->cfg->slug = (string) $this->cfg->slug; $this->cfg->auto_prefix = (bool) $this->cfg->auto_prefix; $this->cfg->action_url = (string) $this->cfg->action_url; $this->cfg->method = (string) $this->cfg->method; if ($this->cfg->slug && $this->cfg->auto_prefix) { $this->cfg->slug = $this->App->Config->©brand['©slug'] . '-' . $this->cfg->slug; } if (!$this->action && !$this->cfg->Widget && !$this->cfg->slug) { throw $this->c::issue('Must have an `action`, `Widget`, or `slug`.'); } }
/** * Class constructor. * * @since 160524 Initial release. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->defaults = ['_insertion_time' => time(), 'id' => '', 'type' => 'info', 'style' => '', 'for_context' => 'network|admin', 'not_for_context' => '', 'for_page' => '', 'not_for_page' => '', 'recurs_every' => 0, 'recurs_times' => 0, '_recurrences' => 0, '_last_recur_dismiss_time' => 0, 'delay_until_time' => 0, 'for_user_id' => 0, 'requires_cap' => $this->App->Config->§caps['§manage'], 'is_applicable' => '', 'is_persistent' => false, 'is_dismissable' => false, 'is_transient' => false, 'push_to_top' => false, 'markup' => '']; $this->outdated_notice_time = strtotime('-90 days'); }
/** * Class constructor. * * @since 160524 Scripts/styles. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->did_enqueue = []; // Initialize. }
/** * Class constructor. * * @since 160608 ReST utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->var = $this->App->Config->©brand['©short_var'] . '_action'; $this->data_var = $this->App->Config->©brand['©short_var'] . '_data'; $this->data_slug = $this->App->Config->©brand['©slug'] . '-action-data'; $this->action = $this->api_version = ''; $this->registered_actions = []; // Initialize registered actions. if ($this->App->is_core) { // License key handler in the core. $this->register('§update-license-keys', '§CoreOnly\\LicenseKeys', 'onRestActionUpdateLicenseKeys'); } $this->register('§save-options', '§Options', 'onRestActionSaveOptions'); $this->register('ajax.§save-options', '§Options', 'onAjaxRestActionSaveOptions'); $this->register('§restore-default-options', '§Options', 'onRestActionRestoreDefaultOptions'); $this->register('§dismiss-notice', '§Notices', 'onRestActionDismissNotice'); }
/** * Class constructor. * * @since 160524 Initial release. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); }
/** * Class constructor. * * @since 160524 DB utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->wp =& $GLOBALS['wpdb']; }
/** * Class constructor. * * @since 160524 Uninstall utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->site_counter = 0; }
/** * Class constructor. * * @since 160530 Update utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->outdated_check_time = strtotime('-15 minutes'); }
/** * Class constructor. * * @since 160704 Transient shortlink utils. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->var = $this->App->Config->©brand['©short_var'] . '_ts'; $this->slug = $this->App->Config->©brand['©short_slug'] . '-ts'; }
/** * Class constructor. * * @since 160715 Conflicts. * * @param Classes\App $App Instance. */ public function __construct(Classes\App $App) { parent::__construct($App); $this->hook_names = []; }