svn: /web/php-rmtools/trunk/client/ include/Branch.php include/Tools.php script/snap.php
| From: | Pierre Joye | Date: | Thu, 28 Apr 2011 11:13:31 +0000 |
| Subject: | svn: /web/php-rmtools/trunk/client/ include/Branch.php include/Tools.php script/snap.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-10908@lists.php.net to get a copy of this message | ||
pajoye Thu, 28 Apr 2011 11:13:31 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=310620
Log:
- upload the branch info, useful for automatic build addition
Changed paths:
U web/php-rmtools/trunk/client/include/Branch.php
U web/php-rmtools/trunk/client/include/Tools.php
U web/php-rmtools/trunk/client/script/snap.php
Modified: web/php-rmtools/trunk/client/include/Branch.php
===================================================================
--- web/php-rmtools/trunk/client/include/Branch.php 2011-04-28 11:01:00 UTC (rev 310619)
+++ web/php-rmtools/trunk/client/include/Branch.php 2011-04-28 11:13:31 UTC (rev 310620)
@@ -10,7 +10,7 @@
public $last_revision_has_snap;
public $config;
private $repo;
- protected $db_path;
+ public $db_path;
public function __construct($config_path)
{
Modified: web/php-rmtools/trunk/client/include/Tools.php
===================================================================
--- web/php-rmtools/trunk/client/include/Tools.php 2011-04-28 11:01:00 UTC (rev 310619)
+++ web/php-rmtools/trunk/client/include/Tools.php 2011-04-28 11:13:31 UTC (rev 310620)
@@ -111,6 +111,22 @@
}
}
+function upload_file($src, $target)
+{
+ include __DIR__ . '/../data/config/credentials_ftps.php';
+$ftp_server = 'windows.php.net';
+$user_snaps = 'windows.php.net_snaps';
+$user_json = 'windows.php.net_json';
+$password = 'SwMG00gl3&$!';
+ $ftp = ftp_connect($ftp_server);
+ $login_result = ftp_login($ftp, $user_snaps, $password);
+ if (!$login_result) {
+ return false;
+ }
+ $res = ftp_put($ftp, $target, $src, FTP_BINARY);
+ ftp_close($ftp);
+ return $res;
+}
function upload_build_result_ftp_curl($src_dir, $target)
{
Modified: web/php-rmtools/trunk/client/script/snap.php
===================================================================
--- web/php-rmtools/trunk/client/script/snap.php 2011-04-28 11:01:00 UTC (rev 310619)
+++ web/php-rmtools/trunk/client/script/snap.php 2011-04-28 11:13:31 UTC (rev 310620)
@@ -21,6 +21,9 @@
$branch_name = $branch->config->getName();
$branch_name_short = $branch->config->getBranch();
+/*Upload the branch DB */
+rm\upload_file($branch->db_path, $branch_name . '/' . basename($branch->db_path));
+
echo "Running <$config_path>\n";
echo "\t$branch_name\n";
echo "\tprevious revision was: " . $branch->getPreviousRevision() . "\n";