From 71d3410b4fc0521cb8564285c07cd7a528028484 Mon Sep 17 00:00:00 2001 From: "Andreas Burchert (scarya)" Date: Wed, 20 Oct 2010 20:54:57 +0000 Subject: [PATCH] - added exlude dir variable to DfC - updated demousage --- .../class.FroxlorDeployfileCreator.php | 9 +++++- lib/classes/sshtransport/demousage.php | 30 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/lib/classes/sshtransport/class.FroxlorDeployfileCreator.php b/lib/classes/sshtransport/class.FroxlorDeployfileCreator.php index 4cfea723..0b8c6dee 100644 --- a/lib/classes/sshtransport/class.FroxlorDeployfileCreator.php +++ b/lib/classes/sshtransport/class.FroxlorDeployfileCreator.php @@ -46,6 +46,13 @@ class FroxlorDeployfileCreator */ public static $_list = null; + /** + * Excluded dirs, seperated with | (for RegEx) + * + * @var string + */ + public static $_exclude = "userdata.inc.php|navigation|configfiles"; + /** * This function iterates through the $dir and generates the deploy list. * @@ -64,7 +71,7 @@ class FroxlorDeployfileCreator ); foreach ($its as $fullFileName => $it ) { - if (!preg_match("/(userdata.inc.php|navigation|configfiles)/i", $it->getFilename())) { + if (!preg_match("/(".self::$_exclude.")/i", $fullFileName)) { $list[] = $fullFileName; } } diff --git a/lib/classes/sshtransport/demousage.php b/lib/classes/sshtransport/demousage.php index 80eb1ce1..3eb8aead 100644 --- a/lib/classes/sshtransport/demousage.php +++ b/lib/classes/sshtransport/demousage.php @@ -56,3 +56,33 @@ $transport = FroxlorSshTransport::usePublicKey("test.froxlor.org", 22, "testUser * Clean up and finish. */ $transport->close(); + + +/* + * ********************************************************************************************************************* + * + * Demousage about deploying + */ + +/* + * create a file list and save it internaly + */ +FroxlorDeployfileCreator::createList( + array( + "/var/www/froxlor/lib/", + "/var/www/froxlor/lng/", + "/var/www/froxlor/scripts/", + "/var/www/froxlor/actions/", + "/var/www/froxlor/templates/" + ) +); + +/* + * save it to disk file + */ +FroxlorDeployfileCreator::saveListTo("deploy.txt"); + +/* + * and create a zip archive + */ +new FroxlorPkgCreator("deploy.txt", "deploy.zip");