本文整理汇总了PHP中Migration::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP Migration::execute方法的具体用法?PHP Migration::execute怎么用?PHP Migration::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Migration
的用法示例。
在下文中一共展示了Migration::execute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_version
/**
* Removes a version
*/
public static function delete_version($version)
{
$table = NimbleRecord::$adapter->quote_table_name(static::migration_table_name());
$query = new NimbleQuery(NimbleQuery::DELETE);
$query->from = $table;
$query->where = NimbleQuery::condition('version', $version);
$sql = $query->build();
Migration::execute($sql);
}
示例2: go
/**
* Runs the table migration converting the table object into runable sql
*/
public function go()
{
(string) ($sql = $this->sql);
$sql .= ' (' . join(", ", $this->columns) . ')';
$sql .= ' ' . $this->options;
$out = array(Migration::execute($sql));
foreach ($this->other as $other) {
array_push($out, Migration::execute($other));
}
return $out;
}
示例3: go
/**
* Executes all the table alters in the order they were added
*/
public function go($test = false)
{
foreach ($this->columns as $sql) {
if (!$test) {
Migration::execute($sql . ";");
}
}
}
示例4: __construct
public function __construct($controller = null)
{
/* Set config */
$this->config = array();
$file_loc = SYSDOCS_DIR . '/config/json/_config.json';
$config_data = is_file($file_loc) ? json_decode(file_get_contents($file_loc), true) : array();
if (defined('CONFIG_NAME')) {
$config_names = explode("\t", CONFIG_NAME);
foreach ($config_names as $config_name) {
if (!isset($config_data[$config_name])) {
continue;
}
foreach ($config_data[$config_name] as $key => $value) {
defined($key) || !strlen($value) || define($key, $value);
}
}
}
$file_loc = SYSDOCS_DIR . '/config/json/_notice.json';
$notice_datas = is_file($file_loc) ? json_decode(file_get_contents($file_loc), true) : array();
$validate_massages = array();
foreach ($notice_datas as $notice_data) {
if ($notice_data['category'] === 'validate') {
$validate_massages[$notice_data['code']] = $notice_data['message'];
}
$this->notice_msgs[$notice_data['category']][$notice_data['code']] = $notice_data['message'];
}
count($validate_massages) && define('VALIDATE_MESSAGE', json_encode($validate_massages));
require_once SYSDOCS_DIR . '/config/common.php';
file_exists(SYSDOCS_DIR . '/config/local.php') && (require_once SYSDOCS_DIR . '/config/local.php');
defined('TEMPLATE_CACHE_DIR') || define('TEMPLATE_CACHE_DIR', $this->view()->get_cachedir());
if (defined('LINEAR_BENCHMARK_FLAG') && LINEAR_BENCHMARK_FLAG) {
$this->benchmark = new Benchmark(SYSDOCS_DIR . '/log/benchmark_log');
}
if (defined('LINEAR_MIGRATION_FLAG') && LINEAR_MIGRATION_FLAG && is_dir(SYSDOCS_DIR . '/config/database')) {
Migration::execute(SYSDOCS_DIR . '/config/database', $this);
}
$this->query = array_merge($_GET, $_POST);
if (!empty($this->query)) {
if (function_exists('mb_detect_encoding') && function_exists('mb_convert_encoding')) {
$this->dec = mb_detect_encoding($this->_implode_query($this->query), 'UTF-8, EUC-JP, Shift_JIS');
}
$this->query = $this->_convert_query($this->query);
}
defined('ROUTE_CONTROLLER') || define('ROUTE_CONTROLLER', get_class($this));
$this->session = new Session(ROUTE_CONTROLLER);
$this->userdata = array();
$GLOBALS['controller'] = $this;
spl_autoload_register(function ($class_name) {
$class_name = strtolower($class_name);
if (substr($class_name, 0, 13) == 'linear\\model\\') {
$model_dirs = explode('\\', $class_name);
array_shift($model_dirs);
array_shift($model_dirs);
$model_loc = SYSDOCS_DIR . '/model/' . implode('/', $model_dirs) . '.php';
if (is_file($model_loc)) {
require_once $model_loc;
}
}
});
}