Пример #1
0
 /**
  * Register App Configuration into Config object.
  *
  * @return void
  */
 protected final function registerConfiguration()
 {
     Config::set(Config::KEY_SITE_FQDN, "http://localhost/phoenix/www");
     Config::set(Config::KEY_SITE_BASE, "/phoenix/");
     Config::set(Config::KEY_FORCE_HTTPS, false);
     Config::set(Config::KEY_APP_EXCEPTION_MODULE_NAME, ED::getModuleName());
     Config::set(Config::KEY_APP_USE_ROUTER, RouterFactory::SIMPLE_ROUTER);
     Config::setDatabasePool(Config::get(Config::KEY_DB_PRIMARY_POOL), "mysql", "localhost", "3306", "phoenix", "phoenix", "phoenix", "utf8");
 }
Пример #2
0
 public function testDisableRegistration()
 {
     Config::disableRegistration();
     /* modify user defined config */
     Config::set(2001, "XDD");
     $this->assertSame("string", Config::get(2001));
     Config::set(Config::KEY_FORCE_HTTPS, false);
     $this->assertTrue(Config::get(Config::KEY_FORCE_HTTPS));
     /* modify DIR_ROOT */
     Config::set(Config::KEY_DIR_ROOT, "/srv/www/88");
     $this->assertEquals("/srv/www", Config::get(Config::KEY_DIR_ROOT));
     /* modify Database pool 1 */
     Config::setDatabasePool(1, "mysql", "localhost", "3306", "MODIFIED", "", "db", "utf8");
     $expected1 = array(1 => "mysql", 2 => "localhost", 3 => "3306", 4 => "login", 5 => "", 6 => "db", 7 => "utf8");
     $actual1 = Config::getDatabasePool(1);
     $this->assertSame(array_diff($expected1, $actual1), array_diff($actual1, $expected1));
     /* add Database pool 4 */
     Config::setDatabasePool(4, "mysql", "localhost", "3306", "login4", "444", "db", "utf8");
     $this->assertNull(Config::getDatabasePool(4));
     /* modify Email pool 1 */
     Config::setEmailPool(1, "localhost", "25", "MODIFIED", "pass", true, "tls", "Test1");
     $expected2 = array(1 => "localhost", 2 => "25", 3 => "login", 4 => "pass", 5 => true, 6 => "tls", 7 => "Test1");
     $actual2 = Config::getEmailPool(1);
     $this->assertSame(array_diff($expected2, $actual2), array_diff($actual2, $expected2));
     /* add Email pool 4 */
     Config::setEmailPool(4, "localhost", "25", "login", "passWORD", true, "ssl", "Test3");
     $this->assertNull(Config::getDatabasePool(4));
 }