cvs: pear /DB_Sqlite_Tools/tests ResyncTest.php XMLExport.php ftpTest.php

From: Date: Mon, 30 Aug 2004 14:21:48 +0000
Subject: cvs: pear /DB_Sqlite_Tools/tests ResyncTest.php XMLExport.php ftpTest.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-23505@lists.php.net to get a copy of this message
gurugeek Mon Aug 30 10:21:48 2004 EDT Added files: /pear/DB_Sqlite_Tools/tests ftpTest.php ResyncTest.php XMLExport.php Log: New test files, sync with latest version http://cvs.php.net/co.php/pear/DB_Sqlite_Tools/tests/ftpTest.php?r=1.1&p=1 Index: pear/DB_Sqlite_Tools/tests/ftpTest.php +++ pear/DB_Sqlite_Tools/tests/ftpTest.php <?php error_reporting(E_ALL|E_STRICT); // FTP backup test require_once 'Tools.php'; $databases = array ('blogs.sqlite', 'code.sqlite'); // we set 2 databases for the backup operation $sqlite = new DB_Sqlite_Tools ($databases); $sqlite->showLogs = true ; $path = '//Users/davidcosta/Sites/dbsqlitetools/bkp/'; // our backup path where the safe copies are prepared $sqlite->copySafe($path); // safely copy the live databases to be uploaded $sqlite->ftpBackup('hostname.com','username','password','remotedir'); // uploding the file in the remote backup server /* <logevent> <class> DB_Sqlite_Tools </class> <function> copySafe</function> <data>'done'</data> </logevent> <logevent> <class> DB_Sqlite_Tools </class> <function> scanBackupDir</function> <data>array ( 0 => 'blogs.sqlite.bkp', 1 => 'code.sqlite.bkp', )</data> </logevent> <logevent> <class> DB_Sqlite_Tools </class> <function> ftpBackup</function> <data>'//Users/davidcosta/Sites/dbsqlitetools/bkp/.blogs.sqlite.bkp uploaded'</data> </logevent> <logevent> <class> DB_Sqlite_Tools </class> <function> ftpBackup</function> <data>'//Users/davidcosta/Sites/dbsqlitetools/bkp/.code.sqlite.bkp uploaded'</data> </logevent> */ ?> http://cvs.php.net/co.php/pear/DB_Sqlite_Tools/tests/ResyncTest.php?r=1.1&p=1 Index: pear/DB_Sqlite_Tools/tests/ResyncTest.php +++ pear/DB_Sqlite_Tools/tests/ResyncTest.php <?php error_reporting(E_ALL|E_STRICT); require_once 'Tools.php'; // require one or more databases in the array $databases = array ('blogs.sqlite','rkc.sqlite'); // instantiate a new DB_Sqlite_Tools object $sqlite = new DB_Sqlite_Tools ($databases); $sqlite->showLogs = true ; /// we specify the path for our databases // and the destination path for rsync $dbpath ='/Users/davidcosta/Sites/dbsqlitetools/bkp/'; $dest = '/Users/davidcosta/Sites/dbsqlitetools/sync/'; $sqlite->localRsync($dbpath,$dest); // and add the event to a log db logs.sqlite // note that on the second parameter we specify // true for the table creation and eventually the table // name mylogs. This will work the first time with the table created, once we have a table // we will call it as $sqlite->sqliteLogs('logs.sqlite.',false,'mylogs'); $sqlite->sqliteLogs('logs.sqlite.',false,'mylogs'); /* sample output <logevent> <class> DB_Sqlite_Tools </class> <function> localRsync</function> <data>'rsync --verbose --stats --recursive --progress --delete /Users/davidcosta/Sites/dbsqlitetools/bkp/ /Users/davidcosta/Sites/dbsqlitetools/sync/'</data> </logevent> <logevent> <class> DB_Sqlite_Tools </class> <function> localRsync</function> <data>'building file list ... 0 files... 3 files to consider created directory /Users/davidcosta/Sites/dbsqlitetools/sync blogs.sqlite.bkp 32768 15% 0.00kB/s 0:00:00 207872 100% 7.26MB/s 0:00:00 rkc.sqlite 32768 46% 0.00kB/s 0:00:00 70656 100% 18.07MB/s 0:00:00 Number of files: 3 Number of files transferred: 2 Total file size: 278528 bytes Total transferred file size: 278528 bytes Literal data: 278528 bytes Matched data: 0 bytes File list size: 70 Total bytes written: 278726 Total bytes read: 52 wrote 278726 bytes read 52 bytes 185852.00 bytes/sec total size is 278528 speedup is 1.00 '</data> </logevent> */ ?> http://cvs.php.net/co.php/pear/DB_Sqlite_Tools/tests/XMLExport.php?r=1.1&p=1 Index: pear/DB_Sqlite_Tools/tests/XMLExport.php +++ pear/DB_Sqlite_Tools/tests/XMLExport.php <?php error_reporting(E_ALL|E_STRICT); require_once 'Tools.php'; // require one or more databases in the array $databases = array ('blogs.sqlite','rkc.sqlite'); // instantiate a new DB_Sqlite_Tools object $sqlite = new DB_Sqlite_Tools ($databases); $sqlite->showLogs = true ; // copysafe is required before performing the XML export operation // this is to ensure the integrity of the original database $path = '//Users/davidcosta/Sites/dbsqlitetools/bkpnew/'; $sqlite->copySafe($path); // creating the XML export so we specify the path for the resulting XML databases $sqlite->createXMLdumps($path); // and add the event to a log db logs.sqlite // note that on the second parameter we specify // true for the table creation and eventually the table // name mylogs. This will work the first time with the table created, once we have a table // we will call it as $sqlite->sqliteLogs('logs.sqlite.',false,'mylogs'); $sqlite->sqliteLogs('logs.sqlite.',false,'mylogs'); /* sample output <logevent> <class> DB_Sqlite_Tools </class> <function> createXMLDumps</function> <data>'blogs.sqlite.xml successfully created'</data> </logevent> <logevent> <class> DB_Sqlite_Tools </class> <function> createXMLDumps</function> <data>'rkc.sqlite.xml successfully created'</data> </logevent> */ ?>

« previous php.pear.cvs (#23505) next »