本文整理匯總了PHP中ezcDbSchema::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP ezcDbSchema::save方法的具體用法?PHP ezcDbSchema::save怎麽用?PHP ezcDbSchema::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ezcDbSchema
的用法示例。
在下文中一共展示了ezcDbSchema::save方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCompareSchemas
/**
* Compare two schemas loaded from different sources.
*
* Load schema #1 from a .php file, save it to mysql db.
* Then load schema #2 from the same db and save it to another .php file.
* (the .php files can be then compared manually)
* Then compare the schemas.
* There should be no differences.
*
* i.e.:
* php -> schema1 -> mydb -> schema2 -> php
*
*/
public function testCompareSchemas()
{
$db = ezcDbInstance::get();
$schema = new ezcDbSchema();
$schema->load($this->referenceFile, 'php-file', 'schema');
$schema->save($db, $db->getName() . '-db');
$schema2 = new ezcDbSchema();
$schema2->load($db, $db->getName() . '-db');
$schema2->save($this->generatedFile, 'php-file', 'schema');
$diff = $schema->compare($schema2);
$schema->saveDelta($diff, $this->deltaFile, $db->getName() . '-file');
$this->assertEquals(array(), $diff, 'Found differences in the schemas.');
}