本文整理匯總了PHP中waModel::createSchema方法的典型用法代碼示例。如果您正苦於以下問題:PHP waModel::createSchema方法的具體用法?PHP waModel::createSchema怎麽用?PHP waModel::createSchema使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類waModel
的用法示例。
在下文中一共展示了waModel::createSchema方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: install
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;
}
}
示例2: install
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();
}
}
示例3: install
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;
}
}
示例4: install
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;
}
}