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


PHP Version::save_dbversion方法代码示例

本文整理汇总了PHP中Version::save_dbversion方法的典型用法代码示例。如果您正苦于以下问题:PHP Version::save_dbversion方法的具体用法?PHP Version::save_dbversion怎么用?PHP Version::save_dbversion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Version的用法示例。


在下文中一共展示了Version::save_dbversion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSave_dbversion

 public function testSave_dbversion()
 {
     Options::delete('db_version');
     Version::save_dbversion();
     $this->assertEquals(Version::DB_VERSION, Options::get('db_version'));
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:6,代码来源:versionTest.php

示例2: test_save_dbversion

 function test_save_dbversion()
 {
     Options::delete('db_version');
     Version::save_dbversion();
     $this->assert_equal(Version::DB_VERSION, Options::get('db_version'));
 }
开发者ID:habari,项目名称:tests,代码行数:6,代码来源:test_version.php

示例3: upgrade_db

 /**
  * Upgrade the database when the database version stored is lower than the one in source
  * @todo Make more db-independent
  */
 public function upgrade_db()
 {
     if (Options::get('db_upgrading')) {
         // quit with an error message.
         $this->display_currently_upgrading();
     }
     // don't allow duplicate upgrades.
     Options::set('db_upgrading', true);
     // This database-specific code needs to be moved into the schema-specific functions
     list($schema, $remainder) = explode(':', Config::get('db_connection')->connection_string);
     switch ($schema) {
         case 'sqlite':
             $db_name = '';
             break;
         case 'mysql':
         case 'pgsql':
             $pairs = $this->parse_dsn($remainder);
             $db_name = $pairs['dbname'];
             break;
     }
     Cache::purge();
     // get the current db version
     $version = Options::get('db_version');
     // do some pre-dbdelta ad-hoc hacky hack code
     $this->upgrade_db_pre($version);
     // run schema-specific upgrade scripts for before dbdelta
     DB::upgrade_pre($version);
     // Get the queries for this database and apply the changes to the structure
     $queries = $this->get_create_table_queries($schema, Config::get('db_connection')->prefix, $db_name);
     DB::dbdelta($queries);
     // Apply data changes to the database based on version, call the db-specific upgrades, too.
     $this->upgrade_db_post($version);
     // run schema-specific upgrade scripts for after dbdelta
     DB::upgrade_post($version);
     Version::save_dbversion();
     Options::delete('db_upgrading');
 }
开发者ID:habari,项目名称:system,代码行数:41,代码来源:installhandler.php

示例4: upgrade_db

 /**
  * Upgrade the database when the database version stored is lower than the one in source
  * @todo Make more db-independent
  */
 public function upgrade_db()
 {
     // This database-specific code needs to be moved into the schema-specific functions
     list($schema, $remainder) = explode(':', Config::get('db_connection')->connection_string);
     switch ($schema) {
         case 'sqlite':
             $db_name = '';
             break;
         case 'mysql':
             list($host, $name) = explode(';', $remainder);
             list($discard, $db_name) = explode('=', $name);
             break;
         case 'pgsql':
             list($host, $name) = explode(' ', $remainder);
             list($discard, $db_name) = explode('=', $name);
             break;
     }
     // get the current db version
     $version = Options::get('db_version');
     // do some pre-dbdelta ad-hoc hacky hack code
     $this->upgrade_db_pre($version);
     // run schema-specific upgrade scripts for before dbdelta
     DB::upgrade_pre($version);
     // Get the queries for this database and apply the changes to the structure
     $queries = $this->get_create_table_queries($schema, Config::get('db_connection')->prefix, $db_name);
     DB::dbdelta($queries);
     // Apply data changes to the database based on version, call the db-specific upgrades, too.
     $this->upgrade_db_post($version);
     // run schema-specific upgrade scripts for after dbdelta
     DB::upgrade_post($version);
     Version::save_dbversion();
 }
开发者ID:anupom,项目名称:my-blog,代码行数:36,代码来源:installhandler.php


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