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(); }
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(); }
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); }