本文整理汇总了PHP中KObject::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP KObject::__construct方法的具体用法?PHP KObject::__construct怎么用?PHP KObject::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KObject
的用法示例。
在下文中一共展示了KObject::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construct method, add a session if options are passed
*
* @author Stian Didriksen <stian@ninjaforge.com>
* @param $config KConfig
*/
public function __construct(KConfig $config)
{
parent::__construct($config);
if (isset($config->retry)) {
$this->retry = $config->retry;
}
}
示例2: __construct
/**
* 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);
}
示例3: __construct
/**
* 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();
}
示例4: __construct
/**
* 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);
}
示例5: __construct
/**
* 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));
}
示例6: __construct
public function __construct(KConfig $config = null)
{
parent::__construct($config);
if (isset($config->adapters)) {
$this->_adapters = KConfig::unbox($config->adapters);
}
}
示例7: __construct
/**
* 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;
}
}
示例8: __construct
/**
* 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);
}
示例9: __construct
/**
* 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;
}
示例10: __construct
/**
* 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();
}
示例11: __construct
/**
* 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);
}
}
示例12: __construct
/**
* 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);
}
}
示例13: __construct
/**
* 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);
}
}
示例14: __construct
/**
* 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);
}
示例15: __construct
/**
* 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);
}