protected static function restoreImageColumnConfig() { try { $data = array('columns' => array('image' => array('max_size' => 10 * 1024 * 1024)), 'tag' => array('cacheLifeTime' => '3600', 'cacheKey' => 'system_columns_tag', 'tag_table' => 'tags', 'cross_table' => 'document2tag')); $register = new \SystemRegister('/System/'); \SystemRegisterHelper::import($register, $data); } catch (\Exception $e) { } }
public function testImportUpdatingFileCacheWithDeletion() { $system = new SystemRegister('/System/'); $this->assertEquals(false, isset($system->array)); SystemRegisterHelper::import($system, array('XX' => '1', 'yy' => '2', 'Gisma' => 'rulit!', 'array' => array('0' => 'value1', '1' => array('1' => '2', '3' => '4')))); $this->assertEquals(true, isset($system->array)); // SystemRegisterSample::loadAll(); $base = new SystemRegister('System'); $this->assertEquals(true, isset($system->array)); $base->delete('array'); $this->assertEquals(false, isset($base->array)); // SystemRegisterSample::clearCache(); SystemRegisterSample::loadAll(); $system = new SystemRegister('/System/'); $this->assertEquals(false, isset($base->array)); }
<?php use Faid\DB; $sql = <<<SQL \tcreate table ddos_detector ( \t\t`id` int not null auto_increment, \t\t`ip` binary(16) not null default "", \t\t`date` datetime not null, \t\tindex `search_by_ip` (`ip`), \t\tprimary key (`id` ) \t) SQL; DB::post($sql); SystemRegisterHelper::import(new SystemRegister('/System/Security/'), array('DDosDetector' => array('MaxConnections' => 100, 'Period' => '1 minute', 'Message' => 'Ваш аккаунт был временно заблокирован по причине превышения допустимого количества запросов'))); SystemRegisterSample::createCache();
public static function setupRootDocuments(array $documentList) { $register = new SystemRegister(self::RootDocumentsKey); SystemRegisterHelper::import($register, $documentList); SystemRegisterSample::createCache(); }
<?php use Faid\DB; $register = new SystemRegister('/System/'); $import = array('Audit' => array('notification_emails' => '*****@*****.**')); SystemRegisterHelper::import($register, $import); SystemRegisterSample::createCache(); $sql = <<<SQL \tcreate table `audit_logs` ( \t\t`id` int not null auto_increment, \t\t`name` varchar(40) not null, \t\t`description` text null, \t\t`critical` bool not null default true, \t\t`enable_logging` bool not null default false, \t\tPRIMARY key (`id`) \t) DEFAULT CHARSET utf8 SQL; DB::post($sql); $sql = <<<SQL \tcreate table `audit_records` ( \t\t`id` int not null auto_increment, \t\t`log_id` int not null, \t\t`date` datetime default '0000-00-00 00:00:00', \t\t`user_id` int not null default 0, \t\t`user_login` varchar( 40 ) null, \t\t`short` text null, \t\t`full` text null, \t\t`ip` binary(16), \t\t`viewed` BOOL not null default false \t\tprimary key ( `id` ), \t\tindex search_by_log (`log_id` ),