Esempio n. 1
0
 public static function CodeBehind($class)
 {
     global $page;
     $settings = PHPApplicationSettings::sharedSettings();
     require $_SERVER['DOCUMENT_ROOT'] . '/' . $settings['application']['controllers'] . '/' . $class;
     $class = substr($class, 0, strrpos($class, '.'));
     $page = new $class();
 }
Esempio n. 2
0
 public function __construct()
 {
     PHPApplication::$application = $this;
     new PHPApplicationSettings();
     $this->settings = PHPApplicationSettings::sharedSettings();
     if (isset($this->settings['application']['delegate'])) {
         $this->delegate = new $this->settings['application']['delegate']();
         if ($this->delegate && method_exists($this->delegate, 'applicationDidFinishLaunching')) {
             $this->delegate->applicationDidFinishLaunching();
         }
     }
     $this->handleRequest();
 }
Esempio n. 3
0
 private static function database_couchdb($database = null, $options = null)
 {
     $settings = PHPApplicationSettings::sharedSettings();
     $options = array('host' => $settings['database']['host'], 'port' => $settings['database']['port'], 'database' => $database ? $database : $settings['database']['database']);
     return new CouchDB($options);
 }