svn: /web/php-rmtools/trunk/include/ Storage.php

From: Date: Wed, 20 Jan 2010 17:41:49 +0000
Subject: svn: /web/php-rmtools/trunk/include/ Storage.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-7092@lists.php.net to get a copy of this message
pajoye Wed, 20 Jan 2010 17:41:49 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=293781 Log: - fix possible reset of the status Changed paths: U web/php-rmtools/trunk/include/Storage.php Modified: web/php-rmtools/trunk/include/Storage.php =================================================================== --- web/php-rmtools/trunk/include/Storage.php 2010-01-20 17:30:45 UTC (rev 293780) +++ web/php-rmtools/trunk/include/Storage.php 2010-01-20 17:41:49 UTC (rev 293781) @@ -89,9 +89,9 @@ if ($res && sqlite_num_rows($res) > 0) { $row = sqlite_fetch_array($res); - if ($row && empty($row['author'])) { - $res = sqlite_query($this->db, "UPDATE revision SET author='" . sqlite_escape_string($author) . - "', status=$status WHERE revision='" . sqlite_escape_string($rev) . "'"); + if ($row) { + $res = sqlite_query($this->db, "UPDATE revision SET " . + "status=" . $row['status'] . " WHERE revision='" . sqlite_escape_string($rev) . "'"); if (!$res) { Throw new \Exception('Update query failed for ' . $rev); } @@ -120,8 +120,14 @@ } $time = time(); if (!$filename) { + if (!is_dir(SNAPS_PATH)) { + if (!mkdir(SNAPS_PATH)) { + throw new \Exception('Snap dir does not exist and cannot be created: ' . SNAPS_PATH); + } + } $filename = SNAPS_PATH . '/php-' . $this->release['name'] . '-src-' . date("YmdHi", $time) . '.zip'; } + $snaps_archive_name = $filename; if ($this->release['release_last_revision'] == $this->release['release_last_snap_revision'] && !$force) { return TRUE; @@ -135,11 +141,6 @@ $odir = getcwd(); chdir($tmpname_dir); - if (!$filename) { - $snaps_archive_name = SNAPS_PATH . '/test.zip'; - } else { - $snaps_archive_name = $filename; - } $now = date(DATE_RFC822, $time);

« previous php.webmaster (#7092) next »