public function install()
 {
     $file_db = $this->getAppPath('lib/config/db.php');
     if (file_exists($file_db)) {
         $schema = (include $file_db);
         $model = new waModel();
         $model->createSchema($schema);
     }
     $file = $this->getAppConfigPath('install');
     if (file_exists($file)) {
         $app_id = $this->application;
         include $file;
     }
 }
 protected function install()
 {
     $file_db = $this->path . '/lib/config/db.php';
     if (file_exists($file_db)) {
         $schema = (include $file_db);
         $model = new waModel();
         $model->createSchema($schema);
     } else {
         // check plugin.sql
         $file_sql = $this->path . '/lib/config/plugin.sql';
         if (file_exists($file_sql)) {
             waAppConfig::executeSQL($file_sql, 1);
         }
     }
     // check install.php
     $file = $this->path . '/lib/config/install.php';
     if (file_exists($file)) {
         $app_id = $this->app_id;
         include $file;
         // clear db scheme cache, see waModel::getMetadata
         try {
             // remove files
             $path = waConfig::get('wa_path_cache') . '/db/';
             waFiles::delete($path, true);
         } catch (waException $e) {
             waLog::log($e->__toString());
         }
         // clear runtime cache
         waRuntimeCache::clearAll();
     }
 }
 public function install()
 {
     $file_db = $this->getAppPath('lib/config/db.php');
     if (file_exists($file_db)) {
         $schema = (include $file_db);
         $model = new waModel();
         $model->createSchema($schema);
     } else {
         // check app.sql
         $file_sql = $this->getAppPath('lib/config/app.sql');
         if (file_exists($file_sql)) {
             self::executeSQL($file_sql, 1);
         }
     }
     $file = $this->getAppConfigPath('install');
     if (file_exists($file)) {
         $app_id = $this->application;
         include $file;
     }
 }
Example #4
0
 protected function install()
 {
     $file_db = $this->path . '/lib/config/db.php';
     if (file_exists($file_db)) {
         $schema = (include $file_db);
         $model = new waModel();
         $model->createSchema($schema);
     } else {
         // check plugin.sql
         $file_sql = $this->path . '/lib/config/plugin.sql';
         if (file_exists($file_sql)) {
             waAppConfig::executeSQL($file_sql, 1);
         }
     }
     // check install.php
     $file = $this->path . '/lib/config/install.php';
     if (file_exists($file)) {
         $app_id = $this->app_id;
         include $file;
     }
 }