当前位置: 首页>>代码示例>>PHP>>正文


PHP Migration::execute方法代码示例

本文整理汇总了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);
 }
开发者ID:scottdavis,项目名称:nimblize,代码行数:12,代码来源:migration_runner.php

示例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;
 }
开发者ID:scottdavis,项目名称:nimblize,代码行数:14,代码来源:create_table.php

示例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 . ";");
         }
     }
 }
开发者ID:scottdavis,项目名称:nimblize,代码行数:11,代码来源:alter_table.php

示例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;
             }
         }
     });
 }
开发者ID:linear,项目名称:linear,代码行数:60,代码来源:Core.php


注:本文中的Migration::execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。