summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2021-04-30 19:28:10 +0200
committerDamien Regad <dregad@mantisbt.org>2021-08-14 13:09:23 +0200
commite95cdc0d2199fbfe8010d78d30febd4cbf384da2 (patch)
tree95bfdb8bea1b192d51ca235d9323884ebbfba8e2
parent466a86580025ff840414715c137adadfbd7b9070 (diff)
downloadadodb-e95cdc0d2199fbfe8010d78d30febd4cbf384da2.tar.gz
adodb-e95cdc0d2199fbfe8010d78d30febd4cbf384da2.tar.bz2
adodb-e95cdc0d2199fbfe8010d78d30febd4cbf384da2.zip
Standard file header: /replicate
-rw-r--r--replicate/adodb-replicate.inc.php99
-rw-r--r--replicate/replicate-steps.php19
-rw-r--r--replicate/test-tnb.php19
3 files changed, 86 insertions, 51 deletions
diff --git a/replicate/adodb-replicate.inc.php b/replicate/adodb-replicate.inc.php
index f1cdffad..f8d6c14e 100644
--- a/replicate/adodb-replicate.inc.php
+++ b/replicate/adodb-replicate.inc.php
@@ -1,60 +1,57 @@
<?php
+/**
+ * Replication engine
+ *
+ * - Copy table structures and data from different databases
+ * (e.g. mysql to oracle)
+ * - Generate CREATE TABLE, CREATE INDEX, INSERT for installation scripts
+ *
+ * Note: this code assumes that comments such as / * * / are allowed,
+ * which works with: mssql, postgresql, oracle, mssql
+ *
+ * Table Structure copying includes
+ * - fields and limited subset of types
+ * - optional default values
+ * - indexes
+ * - but not constraints
+ *
+ * Two modes of data copy:
+ * 1. ReplicateData - Copy from src to dest, with update of status of copy
+ * back to src, with configurable src SELECT where clause
+ * 2. MergeData - Copy from src to dest based on last mod date field and/or
+ * copied flag field
+ *
+ * Default settings are
+ * - do not execute, generate sql ($rep->execute = false)
+ * - do not delete records in dest table first ($rep->deleteFirst = false).
+ * if $rep->deleteFirst is true and primary keys are defined,
+ * then no deletion will occur unless *INSERTONLY* is defined in pkey array
+ * - only commit once at the end of every ReplicateData ($rep->commitReplicate = true)
+ * - do not autocommit every x records processed ($rep->commitRecs = -1)
+ * - even if error occurs on one record, continue copying remaining records ($rep->neverAbort = true)
+ * - debugging turned off ($rep->debug = false)
+ *
+ * This file is part of ADOdb, a Database Abstraction Layer library for PHP.
+ *
+ * @package ADOdb
+ * @link https://adodb.org Project's web site and documentation
+ * @link https://github.com/ADOdb/ADOdb Source code and issue tracker
+ *
+ * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
+ * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
+ * any later version. This means you can use it in proprietary products.
+ * See the LICENSE.md file distributed with this source code for details.
+ * @license BSD-3-Clause
+ * @license LGPL-2.1-or-later
+ *
+ * @copyright 2000-2013 John Lim
+ * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
+ */
define('ADODB_REPLICATE',1.2);
include_once(ADODB_DIR.'/adodb-datadict.inc.php');
-/*
-1.2 9 June 2009
-Minor patches
-
-1.1 8 June 2009
-Added $lastUpdateFld to replicatedata
-Added $rep->compat. If compat set to 1.0, then $lastUpdateFld not used during MergeData.
-
-1.0 Apr 2009
-Added support for MFFA
-
-0.9 ? 2008
-First release
-
-
- Note: this code assumes that comments such as / * * / ar`e allowed which works with:
- Note: this code assumes that comments such as / * * / are allowed which works with:
- mssql, postgresql, oracle, mssql
-
- Replication engine to
- - copy table structures and data from different databases (e.g. mysql to oracle)
- for replication purposes
- - generate CREATE TABLE, CREATE INDEX, INSERT ... for installation scripts
-
- Table Structure copying includes
- - fields and limited subset of types
- - optional default values
- - indexes
- - but not constraints
-
-
- Two modes of data copy:
-
- ReplicateData
- - Copy from src to dest, with update of status of copy back to src,
- with configurable src SELECT where clause
-
- MergeData
- - Copy from src to dest based on last mod date field and/or copied flag field
-
- Default settings are
- - do not execute, generate sql ($rep->execute = false)
- - do not delete records in dest table first ($rep->deleteFirst = false).
- if $rep->deleteFirst is true and primary keys are defined,
- then no deletion will occur unless *INSERTONLY* is defined in pkey array
- - only commit once at the end of every ReplicateData ($rep->commitReplicate = true)
- - do not autocommit every x records processed ($rep->commitRecs = -1)
- - even if error occurs on one record, continue copying remaining records ($rep->neverAbort = true)
- - debugging turned off ($rep->debug = false)
-*/
-
class ADODB_Replicate {
var $connSrc;
var $connDest;
diff --git a/replicate/replicate-steps.php b/replicate/replicate-steps.php
index 5b696568..fca719d2 100644
--- a/replicate/replicate-steps.php
+++ b/replicate/replicate-steps.php
@@ -1,4 +1,23 @@
<?php
+/**
+ * Replication engine
+ *
+ * This file is part of ADOdb, a Database Abstraction Layer library for PHP.
+ *
+ * @package ADOdb
+ * @link https://adodb.org Project's web site and documentation
+ * @link https://github.com/ADOdb/ADOdb Source code and issue tracker
+ *
+ * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
+ * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
+ * any later version. This means you can use it in proprietary products.
+ * See the LICENSE.md file distributed with this source code for details.
+ * @license BSD-3-Clause
+ * @license LGPL-2.1-or-later
+ *
+ * @copyright 2000-2013 John Lim
+ * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
+ */
# CONFIG
diff --git a/replicate/test-tnb.php b/replicate/test-tnb.php
index f163ff4f..6be11072 100644
--- a/replicate/test-tnb.php
+++ b/replicate/test-tnb.php
@@ -1,4 +1,23 @@
<?php
+/**
+ * Replication engine
+ *
+ * This file is part of ADOdb, a Database Abstraction Layer library for PHP.
+ *
+ * @package ADOdb
+ * @link https://adodb.org Project's web site and documentation
+ * @link https://github.com/ADOdb/ADOdb Source code and issue tracker
+ *
+ * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
+ * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
+ * any later version. This means you can use it in proprietary products.
+ * See the LICENSE.md file distributed with this source code for details.
+ * @license BSD-3-Clause
+ * @license LGPL-2.1-or-later
+ *
+ * @copyright 2000-2013 John Lim
+ * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
+ */
include_once('../adodb.inc.php');
include_once('adodb-replicate.inc.php');