Recommend this page to a friend! |
Download .zip |
Info | View files (5) | Download .zip | Reputation | Support forum (4) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2005-06-06 (11 years ago) | 65% | Total: 3,087 | All time: 1,130 This week: 953 |
Version | License | Categories | ||||
dbsync 1.0 | GNU General Publi... | Databases |
Description | Author | ||||||||||||||||
This class provides a way to synchronize the schema of one or more databases from the schema of a master database. Innovation Award
|
|
.------------------------------------------------------------------------------. | This is a quick reference, details on class methods are inside the file. | '------------------------------------------------------------------------------' The public methods available under DBSync class are: # SetHomeDatabase() Parameters: $database $type (default = 'mysql') $host (default = 'localhost') $user (default = 'root') $pass (default = '') Set the Home Database settings. These are the settings of the database that has it's structure correct and all other should guide thru. # AddSyncDatabase() Parameters: $database $type (default = 'mysql') $host (default = 'localhost') $user (default = 'root') $pass (default = '') Add a Sync Database. This function is used to add databases that will be synched with the Home Database. # Sync() Synchronise all the Sync Databases with the Home Database. A simple script to synchronise a database db1 with db2 on your localhost mysql server could be as simple as this: <?php include 'class.dbsync.php'; $dbsync = new DBSync(); $dbsync->SetHomeDatabase('db1'); $dbsync->AddSyncDatabase('db2'); $dbsync->Sync(); ?> This is as simple as this because of default parameters. They assume your local database server is at the localhost on a mysql server width user root and with no password. If you want you can create diferente database drivers for MSSQL and others by creating the class and naming it like class.<type>.dbsync.php. This way, when you try to sync a database and chose <type> as the type of the database, the DBSync class will try and load the correct file and make the sync. Be aware you cannot change the names of the methods, they must be exactly the same as in class.mysql.dbsync.php and should do obviously the same thing. If you have any doubt, mail me at: me@diogoresende.net |
Files |
File | Role | Description |
---|---|---|
class.dbsync.mysql.php | Class | MySQL Sync Driver |
class.dbsync.php | Class | Main Class |
README | Doc. | Read this! |
reload.png | Icon | Image on test.php |
test.php | Example | Test script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | User Comments (3) | ||||||||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Pages that reference this package |
SVN and MySQL Schema Synchronization When I started to work in a virtual team comprising of 6 developers , I felt that the most time consuming task was syncing the database changes amongst team members... |