public function init($no_cache = false)
    {
        $this->bootCacher();

        // From local cache
        if (self::$_cached_settings && is_array(self::$_cached_settings) && !$no_cache) {
            return self::$_cached_settings;
        }

        if ($no_cache) {
            // Force cache invalidation
            self::$_cached_settings = [];
        } else {
            // Get from cache
            self::$_cached_settings = Cacher::getInstance()->getDefaultCacher()->get(self::CACHE_KEY);
        }

        if (!self::$_cached_settings && SQL::getInstance()->tableExists('cms_settings')) {
            // Get from DB
            $settings_collection = new SettingEntityRepository();
            self::$_cached_settings = $settings_collection->getPairs('value', 'name');
            Cacher::getInstance()->getDefaultCacher()->set(self::CACHE_KEY, self::$_cached_settings);
        }

        if (!is_array(self::$_cached_settings)) {
            self::$_cached_settings = [];
        }

        return self::$_cached_settings;
    }
public function init($no_cache = false)
    {
        $this->bootCacher();

        // From local cache
        if (self::$_cached_settings && is_array(self::$_cached_settings) && !$no_cache) {
            return self::$_cached_settings;
        }

        if ($no_cache) {
            // Force cache invalidation
            self::$_cached_settings = [];
        } else {
            // Get from cache
            self::$_cached_settings = Cacher::getInstance()->getDefaultCacher()->get(self::CACHE_KEY);
        }

        if (!self::$_cached_settings && SQL::getInstance()->tableExists('cms_settings')) {
            // Get from DB
            $settings_collection = new SettingEntityRepository();
            self::$_cached_settings = $settings_collection->getPairs('value', 'name');
            Cacher::getInstance()->getDefaultCacher()->set(self::CACHE_KEY, self::$_cached_settings);
        }

        if (!is_array(self::$_cached_settings)) {
            self::$_cached_settings = [];
        }

        return self::$_cached_settings;
    }
public function init ( $ no_cache = false ) { $ this -> bootCacher ( ) ; // From local cache if ( self :: $ _cached_settings && is_array ( self :: $ _cached_settings ) && ! $ no_cache ) { return self :: $ _cached_settings ; } if ( $ no_cache ) { // Force cache invalidation self :: $ _cached_settings = [ ] ; } else { // Get from cache self :: $ _cached_settings = Cacher :: getInstance ( ) -> getDefaultCacher ( ) -> get ( self :: CACHE_KEY ) ; } if ( ! self :: $ _cached_settings && SQL :: getInstance ( ) -> tableExists ( 'cms_settings' ) ) { // Get from DB $ settings_collection = new SettingEntityRepository ( ) ; self :: $ _cached_settings = $ settings_collection -> getPairs ( 'value' , 'name' ) ; Cacher :: getInstance ( ) -> getDefaultCacher ( ) -> set ( self :: CACHE_KEY , self :: $ _cached_settings ) ; } if ( ! is_array ( self :: $ _cached_settings ) ) { self :: $ _cached_settings = [ ] ; } return self :: $ _cached_settings ; }
Init all settings
@param bool $no_cache fetch data from cache or not
@return array
Init all settings