public function testRemoveNamespace() { rex_config::set('test-ns', 'mykey1', 'myvalA'); rex_config::set('test-ns', 'mykey2', 'myvalB'); rex_config::removeNamespace('test-ns'); $this->assertFalse(rex_config::has('test-ns'), 'removeNamespace() removes the whole namespace'); $this->assertFalse(rex_config::has('test-ns', 'mykey1'), 'removeNamespace() all keys1'); $this->assertFalse(rex_config::has('test-ns', 'mykey2'), 'removeNamespace() all keys2'); $this->assertNull(rex_config::get('test-ns', 'mykey1'), 'removeNamespace() all keys1'); $this->assertNull(rex_config::get('test-ns', 'mykey2'), 'removeNamespace() all keys2'); }
/** * {@inheritdoc} */ public function hasConfig($key = null) { return rex_config::has($this->getPackageId(), $key); }
<?php /** @var rex_addon $this */ if (rex_string::versionCompare($this->getVersion(), '2.0.1', '<') && rex_config::has('install')) { rex_file::putCache($this->getDataPath('config.json'), rex_config::get('install')); rex_config::removeNamespace('install'); }
/** * @see rex_config::has() */ public static function hasConfig($key) { return rex_config::has(self::CONFIG_NAMESPACE, $key); }