Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed constant that is not compliant with minimum requirements of p… #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor/
nbproject/
38 changes: 20 additions & 18 deletions S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class S3
* Default delimiter to be used, for example while getBucket().
* @var string
* @access public
* @static
* @static
*/
public static $defDelimiter = null;

Expand Down Expand Up @@ -127,7 +127,7 @@ class S3
* @access public
* @static
*/
public static $useSSLVersion = CURL_SSLVERSION_TLSv1;
public static $useSSLVersion = null; // CURL_SSLVERSION_TLSv1;

/**
* Use PHP exceptions?
Expand All @@ -153,7 +153,7 @@ class S3
* @static
*/
public static $sslKey = null;

/**
* SSL client certfificate
*
Expand All @@ -162,7 +162,7 @@ class S3
* @static
*/
public static $sslCert = null;

/**
* SSL CA cert (only required if you are having problems with your system CA cert)
*
Expand All @@ -171,7 +171,7 @@ class S3
* @static
*/
public static $sslCACert = null;

/**
* AWS Key Pair ID
*
Expand All @@ -180,13 +180,13 @@ class S3
* @static
*/
private static $__signingKeyPairId = null;

/**
* Key resource, freeSigningKey() must be called to clear it from memory
*
* @var bool
* @access private
* @static
* @static
*/
private static $__signingKeyResource = false;

Expand Down Expand Up @@ -319,7 +319,7 @@ public static function setTimeCorrectionOffset($offset = 0)
$rest = new S3Request('HEAD');
$rest = $rest->getResponse();
$awstime = $rest->headers['date'];
$systime = time();
$systime = time();
$offset = $systime > $awstime ? -($systime - $awstime) : ($awstime - $systime);
}
self::$__timeOffset = $offset;
Expand Down Expand Up @@ -1827,7 +1827,7 @@ private static function __getMIMEType(&$file)
'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'gif' => 'image/gif',
'png' => 'image/png', 'ico' => 'image/x-icon', 'pdf' => 'application/pdf',
'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'svg' => 'image/svg+xml',
'svgz' => 'image/svg+xml', 'swf' => 'application/x-shockwave-flash',
'svgz' => 'image/svg+xml', 'swf' => 'application/x-shockwave-flash',
'zip' => 'application/zip', 'gz' => 'application/x-gzip',
'tar' => 'application/x-tar', 'bz' => 'application/x-bzip',
'bz2' => 'application/x-bzip2', 'rar' => 'application/x-rar-compressed',
Expand Down Expand Up @@ -1910,7 +1910,7 @@ private static function __getHash($string)
}

/**
* S3 Request class
* S3 Request class
*
* @link http://undesigned.org.za/2007/10/22/amazon-s3-php-class
* @version 0.5.0-dev
Expand All @@ -1924,47 +1924,47 @@ final class S3Request
* @access private
*/
private $endpoint;

/**
* Verb
*
* @var string
* @access private
*/
private $verb;

/**
* S3 bucket name
*
* @var string
* @access private
*/
private $bucket;

/**
* Object URI
*
* @var string
* @access private
*/
private $uri;

/**
* Final object URI
*
* @var string
* @access private
*/
private $resource = '';

/**
* Additional request parameters
*
* @var array
* @access private
*/
private $parameters = array();

/**
* Amazon specific request headers
*
Expand Down Expand Up @@ -2027,7 +2027,7 @@ final class S3Request
*/
function __construct($verb, $bucket = '', $uri = '', $endpoint = 's3.amazonaws.com')
{

$this->endpoint = $endpoint;
$this->verb = $verb;
$this->bucket = $bucket;
Expand Down Expand Up @@ -2143,7 +2143,9 @@ public function getResponse()
if (S3::$useSSL)
{
// Set protocol version
curl_setopt($curl, CURLOPT_SSLVERSION, S3::$useSSLVersion);
if (S3::$useSSLVersion !== null) {
curl_setopt($curl, CURLOPT_SSLVERSION, S3::$useSSLVersion);
}

// SSL Validation can now be optional for those with broken OpenSSL installations
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, S3::$useSSLValidation ? 2 : 0);
Expand Down