/** * Initiate current time list. * * @param Ai1ec_Registry_Object $registry * * @return void */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $gmt_time = version_compare(PHP_VERSION, '5.1.0') >= 0 ? time() : gmmktime(); $this->_current_time = array((int) $_SERVER['REQUEST_TIME'], $gmt_time); $this->_gmtdates = $registry->get('cache.memory'); }
/** * Standard constructor * * @param Ai1ec_Registry_Object $registry */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $exploded_class = explode('_', get_class($this)); $this->_page_suffix = strtolower(end($exploded_class)); $this->_api_registration = $this->_registry->get('model.api.api-registration'); }
/** * The contructor method. * * @param Ai1ec_Registry_Object $registry */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $app = $registry->get('bootstrap.registry.application'); $this->page = $app->get('calendar_base_page'); $this->pretty_permalinks_enabled = $app->get('permalinks_enabled'); }
public function __construct(Ai1ec_Registry_Object $registry, $preview_mode = false) { parent::__construct($registry); $this->persistance_context = $this->_registry->get('cache.strategy.persistence-context', self::KEY_FOR_PERSISTANCE, AI1EC_CACHE_PATH); $this->lessphp_controller = $this->_registry->get('less.lessphp'); $this->db_adapter = $this->_registry->get('model.option'); $this->preview_mode = $preview_mode; }
public function __construct(Ai1ec_Registry_Object $registry, $default_theme_url = AI1EC_DEFAULT_THEME_URL) { parent::__construct($registry); $this->lessc = $this->_registry->get('lessc'); $this->default_theme_url = $this->sanitize_default_theme_url($default_theme_url); $this->parsed_css = ''; $this->files = array('style.less', 'event.less', 'calendar.less'); }
/** * Constructor * * Initialize internal memory objects and date keys. * * @param Ai1ec_Memory_Utility $memory Optionally inject memory to use * * @return void Constructor does not return */ public function __construct(Ai1ec_Registry_Object $registry, Ai1ec_Cache_Memory $memory = null) { parent::__construct($registry); if (NULL === $memory) { $memory = $this->_registry->get('cache.memory', 120); // 30 * 4 } $this->_memory = $memory; $this->_transf = $this->_registry->get('cache.memory'); $this->_keys = $this->_initialize_keys(); $this->_skeys = $this->_initialize_keys($this->_separator, $this->_separator); $this->_format = implode($this->_separator, $this->_keys); }
public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_cache_paths[] = array('path' => AI1EC_CACHE_PATH, 'url' => AI1EC_CACHE_URL); $filesystem = $this->_registry->get('filesystem.checker'); $wp_static_folder = $filesystem->get_ai1ec_static_dir_if_available(); if ('' !== $wp_static_folder) { $this->_cache_paths[] = array('path' => $wp_static_folder, 'url' => content_url() . '/ai1ec_static/'); } $this->persistance_context = $this->_registry->get('cache.strategy.persistence-context', self::KEY_FOR_PERSISTANCE, $this->_cache_paths, true); if (!$this->persistance_context->is_file_cache()) { /* @TODO: move this to Settings -> Advanced -> Cache */ } $this->lessphp_controller = $this->_registry->get('less.lessphp'); $this->db_adapter = $this->_registry->get('model.option'); }
/** * Constructor * * Store locally copy of arguments array * * @param array $argv Arguments to be parsed [optional=null] * * @return void Constructor does not return */ public function __construct(Ai1ec_Registry_Object $registry, array $argv = NULL) { parent::__construct($registry); if (NULL === $argv) { $request_uri = explode('?', $_SERVER['REQUEST_URI']); $request_uri = urldecode($request_uri[0]); $argv = trim($request_uri, '/'); if (($arg_start = strpos($argv, '/')) > 0) { $argv = substr($argv, $arg_start + 1); } $arg_list = explode('/', $argv); $argv = array(); foreach ($arg_list as $arg) { if (($colon = strpos($arg, Ai1ec_Uri::DIRECTION_SEPARATOR)) > 0) { $argv[substr($arg, 0, $colon)] = substr($arg, $colon + 1); } } } $this->_rules = array(); $this->_request = $argv; }
/** * Store event ID in local variable. * * @param int $post_id ID of post being managed. * * @return void */ public function __construct(Ai1ec_Registry_Object $registry, $post_id = 0) { parent::__construct($registry); $this->_post_id = (int) $post_id; }
/** * Initialize local cache and identifiers. * * @param Ai1ec_Registry_Object $registry Registry to use. * * @return void */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_cache = $this->_registry->get('cache.memory'); $this->_init_identifiers(); }
/** * Public constructor * * @param Ai1ec_Registry_Object $registry The registry object */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_exact_dates = $registry->get('cache.memory'); }
/** * Public constructor * * @param Ai1ec_Registry_Object $registry * @param Ai1ec_Request_Parser $request */ public function __construct(Ai1ec_Registry_Object $registry, Ai1ec_Request_Parser $request) { parent::__construct($registry); $this->_request = $request; }
/** * Constructor accepts system as injectable and requests HTML helper. * * @param Ai1ec_Registry_Object $system Injected system argument. * * @return void Constructor does not return. */ public function __construct(Ai1ec_Registry_Object $registry, array $args) { parent::__construct($registry); $this->_args = $args; $this->_html = $registry->get('html.helper'); }
/** * Standard constructor * * @param Ai1ec_Registry_Object $registry */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $exploded_class = explode('_', get_class($this)); $this->_page_suffix = strtolower(end($exploded_class)); }
/** * Create new event object, using provided data for initialization. * * @param Ai1ec_Registry_Object $registry Injected object registry. * @param int|array|null $data Look up post with id $data, or * initialize fields with associative * array $data containing both post * and event fields. * @param bool $instance Optionally instance ID. * * @throws Ai1ec_Invalid_Argument_Exception When $data is not one * of int|array|null. * @throws Ai1ec_Event_Not_Found_Exception When $data relates to * non-existent ID. * * @return void */ function __construct(Ai1ec_Registry_Object $registry, $data = null, $instance = false) { parent::__construct($registry); $this->_entity = $this->_registry->get('model.event.entity'); if (null === $data) { return; // empty object } else { if (is_numeric($data)) { $this->initialize_from_id($data, $instance); } else { if (is_array($data)) { $this->initialize_from_array($data); } else { throw new Ai1ec_Invalid_Argument_Exception('Argument to constructor must be integer, array or null' . ', not ' . var_export($data, true)); } } } if ($this->is_allday()) { try { $timezone = $this->_registry->get('date.timezone')->get($this->get('timezone_name')); $this->_entity->set_preferred_timezone($timezone); } catch (Exception $excpt) { // ignore } } }
/** * Initiate internal variables */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_query_manager = $registry->get('query.helper'); }
/** * Standard constructor for basic files. * * @param Ai1ec_Registry_Object $registry * @param string $name * @param array $paths */ public function __construct(Ai1ec_Registry_Object $registry, $name, array $paths) { parent::__construct($registry); $this->_paths = $paths; $this->_name = $name; }
/** * Public constructor * * @param Ai1ec_Registry_Object $registry */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_legacy = $registry->get('theme.loader')->is_legacy_theme(); }
/** * Initiate base objects. * * @param Ai1ec_Registry_Object $registry * @internal param \Ai1ec_Registry_Object $system Injectable system object. */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_initialize(); }
/** * Register filters early on. * * @param Ai1ec_Registry_Object $registry Instance to use. * * @return void */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); add_filter('ai1ec_twig_environment', array($this, 'ai1ec_twig_environment')); add_filter('ai1ec_twig_add_debug', '__return_false'); }
/** * Constructor. * * @param Ai1ec_Registry_Object $registry Registry object. * * @return void Method does not return. */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_content_filter = $registry->get('content.filter'); $this->_strict_compatibility_content_filtering = $registry->get('model.settings')->get('strict_compatibility_content_filtering'); }
/** * Constructor. * * @param Ai1ec_Registry_Object $registry * * @return Ai1ec_Captcha_Provider * * @throws Ai1ec_Bootstrap_Exception */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_settings = $registry->get('model.settings'); $this->_theme_loader = $registry->get('theme.loader'); }
/** * Initialize values to some sane defaults. * * @param Ai1ec_Registry_Object $registry Injected registry. * * @return void */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_start = $this->_registry->get('date.time'); $this->_end = $this->_registry->get('date.time', '+1 hour'); }
/** * Store locally instance of Ai1ec_Dbi. * * @param Ai1ec_Registry_Object $registry Injected object registry. * */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_dbi = $this->_registry->get('dbi.dbi'); $this->_dbi_utils = $this->_registry->get('dbi.dbi-utils'); }
/** * Constructor * * Initialize object, by storing instance of `wpdb` in local variable * * @return void Constructor does not return */ public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_db = $registry->get('dbi.dbi'); $this->_database = $registry->get('database.helper'); }
/** * Public constructor * * @param Ai1ec_Registry_Object $registry * @param Ai1ec_Request_Parser $request */ public function __construct(Ai1ec_Registry_Object $registry, Ai1ec_Request_Parser $request) { parent::__construct($registry); $this->_request = $request; $this->_compatibility = $registry->get('compatibility.check'); }
public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_taxonomy_model = $this->_registry->get('model.taxonomy'); }
/** * Constructor function * * @param Ai1ec_Registry_Object $registry * @param string $value * @param mixed $context */ public function __construct(Ai1ec_Registry_Object $registry, $value, $context = array()) { parent::__construct($registry); $this->_value = $value; $this->_context = $context; }
public function __construct(Ai1ec_Registry_Object $registry) { parent::__construct($registry); $this->_option = $registry->get('model.option'); $this->_review_items = $this->_get_array(self::OPTION_KEY); }