Beispiel #1
0
 /**
  * Construct method, add a session if options are passed
  *
  * @author  Stian Didriksen <*****@*****.**>
  * @param   $config  KConfig
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     if (isset($config->retry)) {
         $this->retry = $config->retry;
     }
 }
 /**
  * Constructor
  *
  * @param KObjectConfig $config  An optional ObjectConfig object with configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Session write and close handlers are called after destructing objects since PHP 5.0.5.
     if (version_compare(phpversion(), '5.4.0', '>=')) {
         session_register_shutdown();
     } else {
         register_shutdown_function('session_write_close');
     }
     //Only configure the session if it's not active yet
     if (!$this->isActive()) {
         //Set the session options
         $this->setOptions($config->options);
         //Set the session name
         if (!empty($config->name)) {
             $this->setName($config->name);
         }
         //Set the session identifier
         if (!empty($config->id)) {
             $this->setId($config->id);
         }
         //Set the session handler
         $this->setHandler($config->handler, KObjectConfig::unbox($config));
     }
     //Set the session namespace
     $this->setNamespace($config->namespace);
     //Set lifetime time
     $this->getContainer('metadata')->setLifetime($config->lifetime);
 }
Beispiel #3
0
 /**
  * Constructor.
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->_state_machine = new AnDomainSpaceState();
     $this->_entities = $this->getService('anahita:domain.space.queue');
     $this->_states = new AnObjectArray();
 }
Beispiel #4
0
	/**
	 * Constructor.
	 *
	 * @param 	object 	An optional KConfig object with configuration options
	 */
	public function __construct( KConfig $config = null) 
	{ 
		//If no config is passed create it
		if(!isset($config)) $config = new KConfig();
		
		parent::__construct($config);
	}
 /**
  * Constructor.
  *
  * @param KObjectConfig $config Configuration options.
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->_title_column = KObjectConfig::unbox($config->title_column);
     $this->_controller = $config->controller;
     $this->setActions(KObjectConfig::unbox($config->actions));
 }
 public function __construct(KConfig $config = null)
 {
     parent::__construct($config);
     if (isset($config->adapters)) {
         $this->_adapters = KConfig::unbox($config->adapters);
     }
 }
Beispiel #7
0
 /**
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     foreach ($config as $key => $value) {
         $this->{$key} = $value;
     }
 }
 /**
  * Constructor.
  *
  * @param KObjectConfig $config An optional ObjectConfig object with configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->_bootstrapped = false;
     //Force a reload if cache is enabled and we have already bootstrapped
     if ($config->force_reload && $config->bootstrapped) {
         $config->bootstrapped = false;
         $config->directories = array();
         $config->components = array();
         $config->domains = array();
         $config->namespaces = array();
         $config->files = array();
         $config->aliases = array();
         $config->identifiers = array();
         $config->applications = array();
     }
     $this->_directories = KObjectConfig::unbox($config->directories);
     $this->_components = KObjectConfig::unbox($config->components);
     $this->_domains = KObjectConfig::unbox($config->domains);
     $this->_namespaces = KObjectConfig::unbox($config->namespaces);
     $this->_files = KObjectConfig::unbox($config->files);
     $this->_applications = KObjectConfig::unbox($config->applications);
     $this->_aliases = KObjectConfig::unbox($config->aliases);
     $this->_identifiers = KObjectConfig::unbox($config->identifiers);
 }
Beispiel #9
0
	/**
	 * Constructor
	 *
	 * Prevent creating instances of this class by making the contructor private
	 * 
	 * @param 	object 	An optional KConfig object with configuration options
	 */
	public function __construct(KConfig $config)
	{
		parent::__construct($config);
	
		// Set the view indentifier
    	$this->_template = $config->template;
	}
Beispiel #10
0
 /**
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     $this->_description = $config->description;
     parent::__construct($config);
     $this->_validations = $config->validations;
     $this->_filters = array();
 }
Beispiel #11
0
 /**
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $paths = array_reverse(KConfig::unbox($config->asset_paths));
     foreach ($paths as $path) {
         $this->addPath($path);
     }
 }
 /**
  * Constructor
  *
  * The user array is a hash where the keys are user identifier and the values are an array of attributes:
  * 'password', 'enabled', and 'roles' etc. The user identifiers should be unique.
  *
  * @param   KObjectConfig $config  An optional ObjectConfig object with configuration options
  * @return  KUserProviderAbstract
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Create the users
     foreach ($config->users as $identifier => $data) {
         $this->_users[$identifier] = $this->create($data);
     }
 }
Beispiel #13
0
 /**
  * Constructor.
  *
  * @param KObjectConfig $config Configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Auto register locators
     foreach ($config->locators as $locator) {
         $this->registerLocator($locator);
     }
 }
Beispiel #14
0
 /**
  * Constructor.
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     parent::__construct(null);
     $this->_store = $config->store;
     foreach ($config->resources as $resource) {
         $this->insert($resource);
     }
 }
 /**
  * Constructor.
  *
  * @param KObjectConfig $config Configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->_catalogue = $config->catalogue;
     $this->_loaded = array();
     $this->setLocaleFallback($config->locale_fallback);
     $this->setLocale($config->locale);
 }
Beispiel #16
0
 /**
  * Constructor
  *
  * @param KObjectConfig $config  An optional KObjectConfig object with configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Set the token type
     $this->setType($config->type);
     //Set the token header
     $this->setAlgorithm($config->algorithm);
 }
Beispiel #17
0
 /**
  * Constructor
  *
  * @param KObjectConfig|null $config  An optional ObjectConfig object with configuration options
  * @return KHttpCookie
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Set the config values
     foreach ($config as $key => $value) {
         $this->{$key} = $value;
     }
 }
Beispiel #18
0
 /**
  * Constructor.
  *
  * @param KObjectConfig $config	An optional ObjectConfig object with configuration options.
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Create the queue
     $this->_queue = $this->getObject('lib:object.queue');
     //The filter priority
     $this->_priority = $config->priority;
 }
Beispiel #19
0
 /** 
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  * 
  * @return void
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->setContent($config->content);
     $this->setContentType($config->content_type);
     $this->setStatus($config->status_code, $config->status_message);
     $this->_headers = $config->headers;
 }
Beispiel #20
0
 /**
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->_session = $config->session;
     if (!$this->_session instanceof ComConnectOauthServiceAbstract) {
         throw new InvalidArgumentException('Session must be an intance of ComConnectOauthServiceAbstract');
     }
 }
Beispiel #21
0
 public function __construct(KConfig $options)
 {
     parent::__construct($options);
     $identifier = $options->identifier;
     $type = $identifier->type;
     $package = $identifier->package;
     $admin = JPATH_ADMINISTRATOR . '/components/' . $type . '_' . $package;
     $site = JPATH_ROOT . '/components/' . $type . '_' . $package;
     $media = JPATH_ROOT . '/media/' . $type . '_' . $package;
     $xmls = JFolder::files(JPATH_ADMINISTRATOR . '/components/' . $type . '_' . $package, '.xml$', 0, true);
     foreach ($xmls as $manifest) {
         $xml = simplexml_load_file($manifest);
         if (isset($xml['type'])) {
             break;
         }
     }
     if (empty($xml)) {
         return;
     }
     if (!$xml->deleted) {
         return;
     }
     KLoader::load('lib.joomla.filesystem.folder');
     KLoader::load('lib.joomla.filesystem.file');
     if ($xml->deleted->admin) {
         foreach ($xml->deleted->admin->children() as $name => $item) {
             if ($name == 'folder' && JFolder::exists($admin . '/' . $item)) {
                 JFolder::delete($admin . '/' . $item);
             }
             if ($name == 'file' && JFile::exists($admin . '/' . $item)) {
                 JFile::delete($admin . '/' . $item);
             }
         }
     }
     if ($xml->deleted->site) {
         if ($xml->deleted->site['removed'] && JFolder::exists($site)) {
             JFolder::delete($site);
         }
         foreach ($xml->deleted->site->children() as $name => $item) {
             if ($name == 'folder' && JFolder::exists($site . '/' . $item)) {
                 JFolder::delete($site . '/' . $item);
             }
             if ($name == 'file' && JFile::exists($site . '/' . $item)) {
                 JFile::delete($site . '/' . $item);
             }
         }
     }
     if ($xml->deleted->media) {
         foreach ($xml->deleted->media->children() as $name => $item) {
             if ($name == 'folder' && JFolder::exists($media . '/' . $item)) {
                 JFolder::delete($media . '/' . $item);
             }
             if ($name == 'file' && JFile::exists($media . '/' . $item)) {
                 JFile::delete($media . '/' . $item);
             }
         }
     }
 }
Beispiel #22
0
 /**
  * Constructor.
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->_name = $config->name;
     $this->_version = $config->version;
     $this->_url = $config->url;
     $this->_key = $config->key;
     $this->_status = null;
 }
Beispiel #23
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config = null)
 {
     //If no config is passed create it
     if (!isset($config)) {
         $config = new KConfig();
     }
     parent::__construct($config);
     $this->_state = $config->state;
 }
Beispiel #24
0
 /**
  * Constructor.
  *
  * @param   object  An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config = null)
 {
     //If no config is passed create it
     if (!isset($config)) {
         $config = new KConfig();
     }
     parent::__construct($config);
     $this->_object_set = new ArrayObject();
 }
Beispiel #25
0
	public function __construct(KConfig $config)
	{
		parent::__construct($config);
	
		$this->_storage_path = $config->storage_path;
		$this->_storage_name = $config->storage_name;
		$this->_storage = $config->storage;
		$this->_selector = $config->selector;
	}
Beispiel #26
0
 /**
  * Constructor
  *
  * @param KConfig|null $config  An optional KConfig object with configuration options
  * @return \KObjectArray
  */
 public function __construct(KConfig $config = null)
 {
     //If no config is passed create it
     if (!isset($config)) {
         $config = new KConfig();
     }
     parent::__construct($config);
     $this->_data = KConfig::unbox($config->data);
 }
Beispiel #27
0
 /**
  * Constructor.
  *
  * @param   object  An optional KConfig object with configuration options
  */
 public function __construct( KConfig $config = null) 
 { 
     //If no config is passed create it
     if(!isset($config)) $config = new KConfig();
     
     parent::__construct($config);
     
     $this->_priority = $config->priority;
 }
Beispiel #28
0
 /**
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     //activate the test mode
     if ($config->test_mode) {
         Merchant_Billing_Base::mode('test');
     }
     $this->_gateway_config = $config->toArray();
 }
Beispiel #29
0
 /**
  * Constructor
  *
  * @param KObjectConfig $config  An optional ObjectConfig object with configuration options
  * @return KHttpMessage
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Set Headers
     $this->setHeaders($config->headers);
     $this->setVersion($config->version);
     $this->setContent($config->content);
     $this->setContentType($config->content_type);
 }
Beispiel #30
0
 /**
  * Constructor.
  *
  * @param   KObjectConfig $config Configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->_stream_prefix = $config->stream_prefix;
     //Auto register streams
     foreach ($config->streams as $stream) {
         $this->registerStream($stream);
     }
 }