本文整理汇总了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;
}
}