Initializes the default configuration for the object.

Called from {@link __construct()} as a first step of object instantiation.

@param AnConfig $config An optional AnConfig object with configuration options.
19601
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'enabled' => AnRequest::format() != 'json' && $config->mixer->isDispatched(),
        ));

        parent::_initialize($config);
    }
1329390
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'padding' => '',
            'version' => '1.0',
        ))->append(array(
            'mimetype' => 'application/json; version='.$config->version,
        ));

        parent::_initialize($config);
    }
1243221
public function setConfig(&$config)
    {
        $this->_checkConfig($config);

        $this->config = $config;
        $this->init();
    }
117274
protected function _initialize(AnConfig $config)
    {
		$config->append(array(
			'state' => self::STATE_ACTIVE,
			'expire' => LibSessionsDomainEntitySession::MAX_LIFETIME + time(),
			'security' => array('fix_browser'),
			'force_ssl' => is_ssl(),
			'namespace' => '__anahita',
			'storage' => 'database'
		));

		parent::_initialize($config);
	}
405249
protected function _initialize(AnConfig $config)
    {
        $permission = clone $this->getIdentifier();
        $permission->path = array($permission->path[0], 'permission');
        register_default(array('identifier' => $permission, 'prefix' => $this));

        $config->append(array(
            'behaviors' => array($permission),
            'request' => array('format' => 'html'),
        ))->append(array(
            'view' => $config->request->get ? $config->request->get : ($config->request->view ? $config->request->view : $this->getIdentifier()->name),
        ));

        parent::_initialize($config);
    }
887197
protected function _initialize(AnConfig $config)
    {
        $base = clone AnRequest::base();

        foreach (array('host', 'scheme', 'port', 'user', 'pass') as $part) {
            $base->$part = AnRequest::url()->$part;
        }

        if (PHP_SAPI == 'cli') {
            $base->scheme = extension_loaded('openssl') ? 'https' : 'http';
            $settings = $this->getService('com:settings.setting');
            $base->host = AnRequest::get('server.HOSTNAME', 'url', $settings->live_site);
            $base->path = '';
        }

        $config->append(array(
            'base_url' => $base,
            'enable_rewrite' => false,
            'url' => clone AnService::get('anahita:http.url')
        ));

        parent::_initialize($config);
    }
728745
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'max_upload_limit' => (int) ini_get('upload_max_filesize'),
        ));

        parent::_initialize($config);

        $config->append(array(
            'behaviors' => to_hash(array(
                'com:search.controller.behavior.searchable',
                'com:stories.controller.behavior.publisher',
                'com:notifications.controller.behavior.notifier',
                'followable',
                'administrable',
                'ownable',
                'privatable',
                'enablable',
                'verifiable',
                'subscribable',
                'com:hashtags.controller.behavior.hashtagable',
                'com:locations.controller.behavior.geolocatable',
                'coverable',
            )),
        ));

        $this->getService('anahita:language')->load('com_actors');
    }
666602
protected function _initialize(AnConfig $config)
    {
        $child = clone $this->_parent;

        $child->name = AnInflector::singularize($config->name);

        $config->append(array(
            'entityset' => 'anahita:domain.entityset.onetomany',
            'cardinality' => 'many',
            'child_key' => $this->_parent->name,
            'parent_delete' => AnDomain::DELETE_CASCADE,
            'child' => $child,
        ));

        parent::_initialize($config);
    }
1046724
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'relationships' => array(
                'locations' => array(
                    'through' => 'com:locations.domain.entity.tag',
                    'target' => $config->target ? $config->target : 'com:base.domain.entity.node',
                    'child_key' => 'tagable',
                    'target_child_key' => 'location',
                    'inverse' => true,
                ),
            )
        ));

        parent::_initialize($config);
    }
881817
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'parser' => 'com:notifications.template.helper.parser',
            'behaviors' => array(
                'com:mailer.controller.behavior.mailer' => $config->toArray()
             ),
        ));

        parent::_initialize($config);
    }
587604
protected function _initialize(AnConfig $config)
    {
        $base_url = AnRequest::base();
        $settings = $this->getService('com:settings.setting');

        if (PHP_SAPI == 'cli' && $settings->live_site != '') {
            $scheme = is_ssl() ? 'https://' : 'http://';
            $base_url = $scheme.$settings->live_site;
        }

        $config->append(array(
            'base_url' => $base_url,
            'test_options' => array(
                'enabled' => get_config_value('mailer.debug', false),
                'email' => get_config_value('mailer.redirect_email'),
                'log' => $settings->tmp_path . '/emails/',
            ),
            'template_view' => null,
        ));

        parent::_initialize($config);
    }
1145411
public static function init($config = [])
    {
        if (!self::$config) {
            self::$config = include __DIR__ ."/default-config.php";
        }
        self::$config = Arr::array_merge_multi(self::$config, $config);
    }
423165
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'theme' => 'base'
        ));

        $config->append(array(
            'view' => 'tmpl:'.$config->theme.'.view.'.$this->getIdentifier()->name.'.'.$config->request->getFormat(),
        ));

        parent::_initialize($config);
    }
967652
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'priority' => AnCommand::PRIORITY_HIGH,
        ));

        parent::_initialize($config);
    }
610132
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'inheritance' => array('abstract' => $this->getIdentifier()->classname === __CLASS__),
            'relationships' => array(
                  'author' => array(
                      'parent' => 'com:people.domain.entity.person',
                      'child_column' => 'created_by',
                      'required' => true,
                   ),
            ),
            'attributes' => array(
                'name' => array('read' => 'public'),
                'enabled' => array('default' => 1)
             ),
            'behaviors' => array(
                'votable',
                'authorizer',
                'privatable',
                'ownable',
                'dictionariable',
                'subscribable',
                'describable',
                'com:hashtags.domain.behavior.hashtagable',
                'com:people.domain.behavior.mentionable',
                'com:locations.domain.behavior.geolocatable',
            ),
        ));

        $behaviors = $config->behaviors;

        $behaviors->append(array(
            'modifiable' => array(
                'modifiable_properties' => array('name', 'body'),
            ),
            'commentable' => array('comment' => array('length' => 5000)),
        ));

        parent::_initialize($config);
    }
93637
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'profile_name' => ucfirst($this->getIdentifier()->package),
            'profile_description' => AnTranslator::_('COM-'.$this->getIdentifier()->package.'-APP-DESCRIPTION'),
            'profile_features' => array(),
            'assignment_option' => self::OPTION_OPTIONAL,
            'actor_identifiers' => array(),
            'relationships' => array(
                'assignments' => array(
                   'child' => 'com:components.domain.entity.assignment',
                   'child_key' => 'componentEntity',
                ),
            ),
        ));

        parent::_initialize($config);
    }
145530
protected function _initialize(AnConfig $config)
    {
        $settings = $this->getService('com:settings.setting');
        $database = $settings->db;
        $prefix = $settings->dbprefix;
        $port = null;
        $socket = null;
        $host = $settings->host;
        $username = $settings->user;
        $password = $settings->password;

        $targetSlot = substr(strstr($host, ":"), 1);

        if (!empty($targetSlot)) {
            // Get the port number or socket name
            if (is_numeric($targetSlot)) {
                $port = $targetSlot;
            } else {
                $socket = $targetSlot;
            }

            // Extract the host name only
            $host = substr($host, 0, strlen($host) - (strlen($targetSlot) + 1));

            // This will take care of the following notation: ":3306"
            if ($host === '') {
                $host = 'localhost';
            }
        }

        $config->append(array(
            'options' => array(
                'host' => $host,
                'username' => $username,
                'password' => $password,
                'database' => $database,
                'port' => $port,
                'socket' => $socket
            ),
            'table_prefix' => $settings->dbprefix,
            'charset' => 'utf8mb4'
        ));

        parent::_initialize($config);
    }