$Core
- is system object, that responses for some core functionality. This is first system object, which is created, instance can be obtained in such way:
<?php
$Core = \cs\Core::instance();
Object provides loading of base system configuration.
###[Up](#) Methods$Core
object has next public methods:
- get()
- set()
Getting of base configuration parameter (which are defined in configuration file).
Also there is simplified way to get item - to get it as property of object:
<?php
$Core = \cs\Core::instance();
$Core->get('timezone');
$Core->timezone;
Setting of base configuration parameter (available only at object construction, i.e. from file config/main.php). Also works with items as properties:
<?php
$Core = \cs\Core::instance();
$Core->set('parameter', 'value');
$Core->parameter = 'value';
$Core
object has next public properties (which are not public, but instead available through magic methods as read-only):
- domain
- timezone
- db_host
- db_driver
- db_name
- db_user
- db_password
- db_prefix
- storage_driver
- storage_url
- storage_host
- storage_user
- storage_password
- language
- cache_driver
- memcache_host
- memcache_port
- public_key
All properties are the same as specified in config/main.json
, so if you add more keys there, they'll be all available as read-only properties on $Core
.