Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

PHPCS

  • Loading branch information...
commit 9a05ac6a69437d011efb4ba808ca7a052c046b4b 1 parent a539643
@CloCkWeRX CloCkWeRX authored
Showing with 61 additions and 50 deletions.
  1. +46 −39 HTTP/Download2/Archive.php
  2. +15 −11 HTTP/Download2/PgLOB.php
View
85 HTTP/Download2/Archive.php
@@ -4,15 +4,15 @@
/**
* HTTP::Download2::Archive
*
- * PHP versions 4 and 5
+ * PHP version 5
*
- * @category HTTP
- * @package HTTP_Download2
- * @author Michael Wallner <mike@php.net>
- * @copyright 2003-2005 Michael Wallner
- * @license BSD, revisewd
- * @version CVS: $Id$
- * @link http://pear.php.net/package/HTTP_Download2
+ * @category HTTP
+ * @package HTTP_Download2
+ * @author Michael Wallner <mike@php.net>
+ * @copyright 2003-2005 Michael Wallner
+ * @license BSD, revised
+ * @version CVS: $Id$
+ * @link http://pear.php.net/package/HTTP_Download2
*/
/**
@@ -31,8 +31,12 @@
*
* Helper class for sending Archives.
*
- * @access public
- * @version $Revision$
+ * @category HTTP
+ * @package HTTP_Download2
+ * @author Daniel O'Connor <clockwerx@php.net>
+ * @copyright 2012 Daniel O'Connor
+ * @license BSD, revised
+ * @link http://pear.php.net/package/HTTP_Download2
*/
class HTTP_Download2_Archive
{
@@ -51,51 +55,54 @@ class HTTP_Download2_Archive
* );
* </code>
*
+ * @param string $name name the sent archive should have
+ * @param mixed $files files/directories
+ * @param string $type archive type
+ * @param string $add_path path that should be prepended to the files
+ * @param string $strip_path path that should be stripped from the files
+ *
* @see Archive_Tar::createModify()
* @static
* @access public
* @return mixed Returns true on success or PEAR_Error on failure.
- * @param string $name name the sent archive should have
- * @param mixed $files files/directories
- * @param string $type archive type
- * @param string $add_path path that should be prepended to the files
- * @param string $strip_path path that should be stripped from the files
*/
- function send($name, $files, $type = HTTP_DOWNLOAD2_TGZ, $add_path = '', $strip_path = '')
- {
+ function send(
+ $name, $files, $type = HTTP_DOWNLOAD2_TGZ,
+ $add_path = '', $strip_path = ''
+ ) {
$tmp = System::mktemp();
switch ($type = strToUpper($type))
{
- case HTTP_DOWNLOAD2_TAR:
- include_once 'Archive/Tar.php';
- $arc = new Archive_Tar($tmp);
- $content_type = 'x-tar';
+ case HTTP_DOWNLOAD2_TAR:
+ include_once 'Archive/Tar.php';
+ $arc = new Archive_Tar($tmp);
+ $content_type = 'x-tar';
break;
- case HTTP_DOWNLOAD2_TGZ:
- include_once 'Archive/Tar.php';
- $arc = new Archive_Tar($tmp, 'gz');
- $content_type = 'x-gzip';
+ case HTTP_DOWNLOAD2_TGZ:
+ include_once 'Archive/Tar.php';
+ $arc = new Archive_Tar($tmp, 'gz');
+ $content_type = 'x-gzip';
break;
- case HTTP_DOWNLOAD2_BZ2:
- include_once 'Archive/Tar.php';
- $arc = new Archive_Tar($tmp, 'bz2');
- $content_type = 'x-bzip2';
+ case HTTP_DOWNLOAD2_BZ2:
+ include_once 'Archive/Tar.php';
+ $arc = new Archive_Tar($tmp, 'bz2');
+ $content_type = 'x-bzip2';
break;
- case HTTP_DOWNLOAD2_ZIP:
- include_once 'Archive/Zip.php';
- $arc = new Archive_Zip($tmp);
- $content_type = 'x-zip';
+ case HTTP_DOWNLOAD2_ZIP:
+ include_once 'Archive/Zip.php';
+ $arc = new Archive_Zip($tmp);
+ $content_type = 'x-zip';
break;
- default:
- throw new HTTP_Download2_Exception(
- 'Archive type not supported: ' . $type,
- HTTP_DOWNLOAD2_E_INVALID_ARCHIVE_TYPE
- );
+ default:
+ throw new HTTP_Download2_Exception(
+ 'Archive type not supported: ' . $type,
+ HTTP_DOWNLOAD2_E_INVALID_ARCHIVE_TYPE
+ );
}
if ($type == HTTP_DOWNLOAD2_ZIP) {
@@ -119,4 +126,4 @@ function send($name, $files, $type = HTTP_DOWNLOAD2_TGZ, $add_path = '', $strip_
$dl->setContentDisposition(HTTP_DOWNLOAD2_ATTACHMENT, $name);
return $dl->send();
}
-}
+}
View
26 HTTP/Download2/PgLOB.php
@@ -4,15 +4,15 @@
/**
* HTTP::Download2::PgLOB
*
- * PHP versions 4 and 5
+ * PHP version 5
*
- * @category HTTP
- * @package HTTP_Download2
- * @author Michael Wallner <mike@php.net>
- * @copyright 2003-2005 Michael Wallner
- * @license BSD, revised
- * @version CVS: $Id$
- * @link http://pear.php.net/package/HTTP_Download2
+ * @category HTTP
+ * @package HTTP_Download2
+ * @author Michael Wallner <mike@php.net>
+ * @copyright 2003-2005 Michael Wallner
+ * @license BSD, revised
+ * @version CVS: $Id$
+ * @link http://pear.php.net/package/HTTP_Download2
*/
$GLOBALS['_HTTP_Download2_PgLOB_Connection'] = null;
@@ -33,8 +33,12 @@
* $dl->send()
* </code>
*
- * @access public
- * @version $Revision$
+ * @category HTTP
+ * @package HTTP_Download2
+ * @author Daniel O'Connor <clockwerx@php.net>
+ * @copyright 2012 Daniel O'Connor
+ * @license BSD, revised
+ * @link http://pear.php.net/package/HTTP_Download2
*/
class HTTP_Download2_PgLOB
{
@@ -167,7 +171,7 @@ function stream_close()
if (pg_lo_close($this->handle)) {
return pg_query($this->conn, 'COMMIT');
} else {
- pg_query($this->conn ,'ROLLBACK');
+ pg_query($this->conn, 'ROLLBACK');
return false;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.