本文整理汇总了PHP中Migration::migrate方法的典型用法代码示例。如果您正苦于以下问题:PHP Migration::migrate方法的具体用法?PHP Migration::migrate怎么用?PHP Migration::migrate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Migration
的用法示例。
在下文中一共展示了Migration::migrate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance($conexao, $tabela=NULL){
// Verifica se existe uma instância da classe
if(!isset(self::$migrate)):
try {
self::$migrate = new Migration($conexao, $tabela);
} catch (Exception $e) {
echo "Erro " . $e->getMessage();
}
endif;
return self::$migrate;
}
示例2: PearDatabase
$new_dbname = $dbconfig['db_name'];
$new_mysql_username = $dbconfig['db_username'];
$new_mysql_password = $dbconfig['db_password'];
$conn = new PearDatabase("mysql", $new_host_name, $new_dbname, $new_mysql_username, $new_mysql_password);
$conn->connect();
$migrationlog->debug("MICKIE ==> Option = Dump File. Selected Dump File will be applied to the new database");
@session_unregister('migration_log');
$_SESSION['migration_log'] = $migration_log;
if ($conn) {
$migrationlog->debug("Pear Database object created. Going to create migration object.");
$obj = new Migration('', $conn);
$new_host = explode(":", $new_host_name);
$temp_new_host_name = $new_host[0];
$new_mysql_port = $new_host[1];
$obj->setNewDatabaseParams($new_host[0], $new_host[1], $new_mysql_username, $new_mysql_password, $new_dbname);
$obj->migrate(0, 'dumpsource', $old_dump_filename);
}
}
} elseif ($_REQUEST['migration_option'] == 'alter_db_details') {
//old database values
$old_host_name = $_REQUEST['alter_old_host_name'];
$old_mysql_port = $_REQUEST['alter_old_port_no'];
$old_mysql_username = $_REQUEST['alter_old_mysql_username'];
$old_mysql_password = $_REQUEST['alter_old_mysql_password'];
$old_dbname = $_REQUEST['alter_old_dbname'];
$migrationlog->debug("old host name = " . $old_host_name);
$migrationlog->debug("old MySQL port = " . $old_mysql_port);
$migrationlog->debug("old MySQL username = " . $old_mysql_username);
$migrationlog->debug("old MySQL password = " . $old_mysql_password);
$migrationlog->debug("old db name = " . $old_dbname);
//make a connection with the old database
示例3: migrate
public function migrate()
{
$migration = new Migration();
$migration->migrate();
}