public function onCreate(array $methods) { $log = new Log(self::TAG); $res = ResourceManager::getResource(MainConfig::DB_INDEX_NAME); $listPattern = new LogList($this); $queuedString = new \genonbeta\util\QueuedString(); $queuedString->put("my"); $queuedString->put("name"); $queuedString->put("is"); $queuedString->put("veli"); $queuedString->useSeperator(" "); $log->d($queuedString->getString()); try { $sdbLoader = new SQLite3Loader($res->findByName("tr_en")); $sdb = $sdbLoader->getDbInstance(); $result = $sdb->query("SELECT * FROM `tr_en`"); $cursor = $result->getCursor(); $log->i("Veritabanında " . $cursor->getCount() . " adet kelime bulunuyor"); } catch (\Exception $e) { } $this->loadLanguage(new Turkish()); $this->setUrlResolver(new UrlResolver(EnvironmentVariables::get("workerAddress"), CurrentManifest::getViewIndex())); $log->d($this->getString("t", ["naber lan"])); $dbLoader = new MySQLLoader(); $db = $dbLoader->getDbInstance(); $log->i("<a href=\"" . $this->getUri("about", "?isOkay=true") . "\">Goto about page</a>"); $this->drawPattern(new GBasicSkeleton($this), "system_html", array(GBasicSkeleton::TITLE => "Home", GBasicSkeleton::BODY => $listPattern->drawAsAdapter(Log::getLogs()))); }
function __construct() { $log = new Log(self::TAG); $this->loadedClasses = new HashMap(); ResourceManager::addResource(self::RES_NAME, System::getClassStorage(__CLASS__), self::RES_FILETYPE); $res = ResourceManager::getResource(self::RES_NAME, true); foreach ($res->getIndex() as $fileName => $fileInfo) { $className = str_replace(".", "\\", $fileName); if (class_exists($className)) { new $className(); $log->i(self::TAG . ".load({$className}) loaded."); $this->loadedClasses->add($className); } else { $log->e(self::TAG . ".load({$className}) process failed"); } } }