Permalink
Browse files

1.5 release. https://aws.amazon.com/releasenotes/PHP/3719565440874916

  • Loading branch information...
1 parent 4cc15b3 commit 573ede698293b72b64703b5bd65027654b0d76e0 @skyzyx skyzyx committed with amazonwebservices Dec 20, 2011
Showing with 9,616 additions and 7,177 deletions.
  1. +1 −0 .gitignore
  2. +13 −0 _compatibility_test/README.md
  3. +21 −5 _compatibility_test/sdk_compatibility_test.php
  4. +82 −63 _compatibility_test/sdk_compatibility_test_cli.php
  5. +92 −0 _docs/CHANGELOG.md
  6. +1 −0 _docs/CONTRIBUTORS.md
  7. +227 −0 _docs/STREAMWRAPPER_README.html
  8. 0 _samples/cli-ec2_sorting_and_filtering.php
  9. 0 _samples/cli-s3_get_urls_for_uploads.php
  10. 0 _samples/cli-s3_progress_bar.php
  11. 0 _samples/html-sdb_create_domain_data.php
  12. +48 −0 authentication/signable.interface.php
  13. +163 −0 authentication/signature_v2query.class.php
  14. +192 −0 authentication/signature_v3query.class.php
  15. +68 −0 authentication/signer.abstract.php
  16. +59 −73 config-sample.inc.php
  17. +2 −1 extensions/s3browserupload.class.php
  18. +613 −0 extensions/s3streamwrapper.class.php
  19. 0 lib/cachecore/LICENSE
  20. 0 lib/cachecore/README
  21. 0 lib/cachecore/_sql/README
  22. 0 lib/cachecore/_sql/mysql.sql
  23. 0 lib/cachecore/_sql/pgsql.sql
  24. 0 lib/cachecore/_sql/sqlite3.sql
  25. 0 lib/cachecore/cacheapc.class.php
  26. 0 lib/cachecore/cachecore.class.php
  27. 0 lib/cachecore/cachefile.class.php
  28. 0 lib/cachecore/cachemc.class.php
  29. 0 lib/cachecore/cachepdo.class.php
  30. 0 lib/cachecore/cachexcache.class.php
  31. 0 lib/cachecore/icachecore.interface.php
  32. 0 lib/requestcore/LICENSE
  33. 0 lib/requestcore/README.md
  34. 0 lib/requestcore/cacert.pem
  35. +1 −1 lib/requestcore/requestcore.class.php
  36. +8 −8 package.xml
  37. +183 −454 sdk.class.php
  38. +546 −499 services/as.class.php
  39. +296 −211 services/cloudformation.class.php
  40. +20 −24 services/cloudfront.class.php
  41. +402 −347 services/cloudwatch.class.php
  42. +2,680 −2,443 services/ec2.class.php
  43. +322 −284 services/elasticache.class.php
  44. +542 −548 services/elasticbeanstalk.class.php
  45. +544 −383 services/elb.class.php
  46. +306 −247 services/emr.class.php
  47. +169 −170 services/iam.class.php
  48. +87 −74 services/importexport.class.php
  49. +505 −475 services/rds.class.php
  50. +241 −96 services/s3.class.php
  51. +263 −225 services/sdb.class.php
  52. +154 −166 services/ses.class.php
  53. +202 −183 services/sns.class.php
  54. +149 −111 services/sqs.class.php
  55. +103 −79 services/sts.class.php
  56. +1 −1 utilities/array.class.php
  57. +30 −2 utilities/batchrequest.class.php
  58. +1 −1 utilities/complextype.class.php
  59. +144 −0 utilities/credential.class.php
  60. +125 −0 utilities/credentials.class.php
  61. +10 −3 utilities/request.class.php
  62. 0 utilities/utilities.class.php
View
@@ -10,3 +10,4 @@ build
*output*
*_coverage_report*
_tests
+*~
@@ -11,6 +11,19 @@ to it at `www.example.com/sdk_compatibility_test.php`
## Via the command line
+### Windows
+
+1. Upload `sdk_compatibility_test_cli.php` to your server via SFTP.
+
+2. SSH/RDP into the machine, and find the directory where you uploaded the test.
+
+3. Run the test, and review the results:
+
+ php .\sdk_compatibility_test_cli.php
+
+
+### Non-Windows (Mac or *nix)
+
1. Upload `sdk_compatibility_test_cli.php` to your server via SFTP.
2. SSH into the machine, and find the directory where you uploaded the test.
@@ -246,7 +246,7 @@
curl_setopt($ch, CURLOPT_TIMEOUT, 5184000);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_NOSIGNAL, true);
- curl_setopt($ch, CURLOPT_USERAGENT, 'AWS SDK for PHP Compatibility Test');
+ curl_setopt($ch, CURLOPT_USERAGENT, 'aws-sdk-php/compat-www');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
@@ -308,6 +308,11 @@ function get_cfg_ini($config)
}
}
+function is_windows()
+{
+ return strtolower(substr(PHP_OS, 0, 3)) === 'win';
+}
+
header('Content-type: text/html; charset=UTF-8');
?><!DOCTYPE html>
@@ -328,7 +333,7 @@ function get_cfg_ini($config)
<style type="text/css">
body {
- font:14px/1.4em "Helvetica Neue", Helvetica, "Lucida Grande", "Droid Sans", Ubuntu, Verdana, Arial, Clean, Sans, sans-serif;
+ font:14px/1.4em "Helvetica Neue", Helvetica, "Lucida Grande", Roboto, "Droid Sans", Ubuntu, Verdana, Arial, Clean, Sans, sans-serif;
letter-spacing:0px;
color:#333;
margin:0;
@@ -639,7 +644,9 @@ function get_cfg_ini($config)
<tr class="<?php echo ($int64_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="https://aws.amazon.com/amis/4158">Architecture</a></td>
<td>64-bit</td>
- <td><?php echo ($int64_ok) ? '64-bit' : '32-bit'; ?></td>
+ <td><?php echo ($int64_ok) ? '64-bit' : '32-bit'; ?><?php if (is_windows()): ?>
+ (<a href="#win64">why?</a>)
+ <?php endif; ?></td>
</tr>
</tbody>
</table>
@@ -693,7 +700,7 @@ function get_cfg_ini($config)
</thead>
<tbody>
<tr>
- <td><code>AWS_DEFAULT_CACHE_CONFIG</code></td>
+ <td><code>default_cache_config</code></td>
<?php if ($apc_ok): ?>
<td><code>apc</code></td>
<?php elseif ($xcache_ok): ?>
@@ -703,8 +710,12 @@ function get_cfg_ini($config)
<?php endif; ?>
</tr>
<tr>
- <td><code>AWS_CERTIFICATE_AUTHORITY</code></td>
+ <td><code>certificate_authority</code></td>
+ <?php if (is_windows()): ?>
+ <td id="ssl_check"><code>true</code></td>
+ <?php else: ?>
<td id="ssl_check"><img src="<?php echo pathinfo(__FILE__, PATHINFO_BASENAME); ?>?loader" alt="Loading..."></td>
+ <?php endif; ?>
</tr>
</tbody>
</table>
@@ -732,6 +743,9 @@ function get_cfg_ini($config)
<?php if (!$int64_ok): ?>
<li>You're running on a <strong>32-bit</strong> system. This means that PHP does not correctly handle files larger than 2GB (this is a <a href="http://www.google.com/search?q=php+2gb+32-bit">well-known PHP issue</a>). For more information, please see: <a href="http://docs.php.net/manual/en/function.filesize.php#refsect1-function.filesize-returnvalues">PHP filesize: Return values</a>.</li>
+ <?php if (is_windows()): ?>
+ <li id="win64"><em>Note that PHP on Microsoft® Windows® <a href="http://j.mp/php64win">does not support 64-bit integers at all</a>, even if both the hardware and PHP are 64-bit.</em></li>
+ <?php endif; ?>
<?php endif; ?>
<?php if ($ini_open_basedir || $ini_safe_mode): ?>
@@ -803,13 +817,15 @@ function get_cfg_ini($config)
</div>
+<?php if (!is_windows()): ?>
<script type="text/javascript" charset="utf-8">
reqwest('<?php echo pathinfo(__FILE__, PATHINFO_BASENAME); ?>?ssl_check', function(resp) {
$sslCheck = document.getElementById('ssl_check');
$sslCheck.innerHTML = '';
$sslCheck.innerHTML = '<code>' + resp + '</code>';
});
</script>
+<?php endif; ?>
</body>
</html>
View
@@ -51,20 +51,25 @@ function get_cfg_ini($config)
}
}
+function is_windows()
+{
+ return strtolower(substr(PHP_OS, 0, 3)) === 'win';
+}
+
// CLI display
function success($s = 'Yes')
{
- return "\033[1;37m\033[42m " . $s . " \033[0m";
+ return is_windows() ? $s : "\033[1;37m\033[42m " . $s . " \033[0m";
}
function info($s = 'Info')
{
- return "\033[1;37m\033[44m " . $s . " \033[0m";
+ return is_windows() ? $s : "\033[1;37m\033[44m " . $s . " \033[0m";
}
function failure($s = 'No ')
{
- return "\033[1;37m\033[41m " . $s . " \033[0m";
+ return is_windows() ? $s : "\033[1;37m\033[41m " . $s . " \033[0m";
}
/////////////////////////////////////////////////////////////////////////
@@ -76,47 +81,55 @@ function failure($s = 'No ')
echo '----------------------------------------' . PHP_EOL;
echo PHP_EOL;
-echo 'PHP 5.2 or newer... ' . ($php_ok ? (success() . ' ' . phpversion()) : failure()) . PHP_EOL;
-echo '64-bit architecture... ' . ($int64_ok ? success() : failure()) . PHP_EOL;
-echo 'cURL with SSL... ' . ($curl_ok ? (success() . ' ' . $curl_version['version'] . ' (' . $curl_version['ssl_version'] . ')') : failure($curl_version['version'] . (in_array('https', $curl_version['protocols'], true) ? ' (with ' . $curl_version['ssl_version'] . ')' : ' (without SSL)'))) . PHP_EOL;
-echo 'Standard PHP Library... ' . ($spl_ok ? success() : failure()) . PHP_EOL;
-echo 'SimpleXML... ' . ($simplexml_ok ? success() : failure()) . PHP_EOL;
-echo 'JSON... ' . ($json_ok ? success() : failure()) . PHP_EOL;
-echo 'PCRE... ' . ($pcre_ok ? success() : failure()) . PHP_EOL;
-echo 'File system read/write... ' . ($file_ok ? success() : failure()) . PHP_EOL;
-echo 'OpenSSL extension... ' . ($openssl_ok ? success() : failure()) . PHP_EOL;
-echo 'Zlib... ' . ($zlib_ok ? success() : failure()) . PHP_EOL;
-echo 'APC... ' . ($apc_ok ? success() : failure()) . PHP_EOL;
-echo 'XCache... ' . ($xcache_ok ? success() : failure()) . PHP_EOL;
-echo 'Memcache... ' . ($memcache_ok ? success() : failure()) . PHP_EOL;
-echo 'Memcached... ' . ($memcached_ok ? success() : failure()) . PHP_EOL;
-echo 'PDO... ' . ($pdo_ok ? success() : failure()) . PHP_EOL;
-echo 'SQLite 2... ' . ($sqlite2_ok ? success() : failure()) . PHP_EOL;
-echo 'SQLite 3... ' . ($sqlite3_ok ? success() : failure()) . PHP_EOL;
-echo 'PDO-SQLite driver... ' . ($pdo_sqlite_ok ? success() : failure()) . PHP_EOL;
-echo 'open_basedir disabled... ' . (!$ini_open_basedir ? success() : failure()) . PHP_EOL;
-echo 'safe_mode disabled... ' . (!$ini_safe_mode ? success() : failure()) . PHP_EOL;
+echo 'PHP 5.2 or newer............ ' . ($php_ok ? (success() . ' ' . phpversion()) : failure()) . PHP_EOL;
+echo '64-bit architecture......... ' . ($int64_ok ? success() : failure()) . (is_windows() ? ' (see note below)' : '') . PHP_EOL;
+echo 'cURL with SSL............... ' . ($curl_ok ? (success() . ' ' . $curl_version['version'] . ' (' . $curl_version['ssl_version'] . ')') : failure($curl_version['version'] . (in_array('https', $curl_version['protocols'], true) ? ' (with ' . $curl_version['ssl_version'] . ')' : ' (without SSL)'))) . PHP_EOL;
+echo 'Standard PHP Library........ ' . ($spl_ok ? success() : failure()) . PHP_EOL;
+echo 'SimpleXML................... ' . ($simplexml_ok ? success() : failure()) . PHP_EOL;
+echo 'JSON........................ ' . ($json_ok ? success() : failure()) . PHP_EOL;
+echo 'PCRE........................ ' . ($pcre_ok ? success() : failure()) . PHP_EOL;
+echo 'File system read/write...... ' . ($file_ok ? success() : failure()) . PHP_EOL;
+echo 'OpenSSL extension........... ' . ($openssl_ok ? success() : failure()) . PHP_EOL;
+echo 'Zlib........................ ' . ($zlib_ok ? success() : failure()) . PHP_EOL;
+echo 'APC......................... ' . ($apc_ok ? success() : failure()) . PHP_EOL;
+echo 'XCache...................... ' . ($xcache_ok ? success() : failure()) . PHP_EOL;
+echo 'Memcache.................... ' . ($memcache_ok ? success() : failure()) . PHP_EOL;
+echo 'Memcached................... ' . ($memcached_ok ? success() : failure()) . PHP_EOL;
+echo 'PDO......................... ' . ($pdo_ok ? success() : failure()) . PHP_EOL;
+echo 'SQLite 2.................... ' . ($sqlite2_ok ? success() : failure()) . PHP_EOL;
+echo 'SQLite 3.................... ' . ($sqlite3_ok ? success() : failure()) . PHP_EOL;
+echo 'PDO-SQLite driver........... ' . ($pdo_sqlite_ok ? success() : failure()) . PHP_EOL;
+echo 'open_basedir disabled....... ' . (!$ini_open_basedir ? success() : failure()) . PHP_EOL;
+echo 'safe_mode disabled.......... ' . (!$ini_safe_mode ? success() : failure()) . PHP_EOL;
echo 'Garbage Collector enabled... ' . ($ini_zend_enable_gc ? success() : failure()) . PHP_EOL;
// Test SSL cert
-$ch = curl_init();
-curl_setopt($ch, CURLOPT_URL, 'https://email.us-east-1.amazonaws.com');
-curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
-curl_setopt($ch, CURLOPT_HEADER, false);
-curl_setopt($ch, CURLOPT_NOBODY, true);
-curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
-curl_setopt($ch, CURLOPT_TIMEOUT, 5184000);
-curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
-curl_setopt($ch, CURLOPT_NOSIGNAL, true);
-curl_setopt($ch, CURLOPT_USERAGENT, 'AWS SDK for PHP Compatibility Test');
-curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
-curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
-curl_setopt($ch, CURLOPT_VERBOSE, false);
-curl_exec($ch);
-$ssl_result = (curl_getinfo($ch, CURLINFO_SSL_VERIFYRESULT) === 0) ? 'false' : 'true';
-curl_close($ch);
-
-echo 'Valid SSL certificate... ' . ($ssl_result ? success() : failure()) . PHP_EOL;
+if (!is_windows())
+{
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, 'https://email.us-east-1.amazonaws.com');
+ curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
+ curl_setopt($ch, CURLOPT_HEADER, false);
+ curl_setopt($ch, CURLOPT_NOBODY, true);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 5184000);
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
+ curl_setopt($ch, CURLOPT_NOSIGNAL, true);
+ curl_setopt($ch, CURLOPT_USERAGENT, 'aws-sdk-php/compat-cli');
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
+ curl_setopt($ch, CURLOPT_VERBOSE, false);
+ curl_exec($ch);
+ $ssl_result = !(curl_getinfo($ch, CURLINFO_SSL_VERIFYRESULT) === 0);
+ curl_close($ch);
+
+ echo 'Valid SSL certificate....... ' . ($ssl_result ? failure() : success()) . PHP_EOL;
+}
+else
+{
+ $ssl_result = false;
+ echo 'Valid SSL certificate....... ' . failure() . ' (will use the bundled certificate instead)' . PHP_EOL;
+}
echo PHP_EOL;
@@ -130,6 +143,7 @@ function failure($s = 'No ')
if ($openssl_ok) { echo '* The OpenSSL extension is installed. This will allow you to use CloudFront' . PHP_EOL . ' Private URLs and decrypt Windows instance passwords.' . PHP_EOL . PHP_EOL; }
if ($zlib_ok) { echo '* The Zlib extension is installed. The SDK will automatically leverage the' . PHP_EOL . ' compression capabilities of Zlib.' . PHP_EOL . PHP_EOL; }
if (!$int64_ok) { echo '* You\'re running on a 32-bit system. This means that PHP does not correctly' . PHP_EOL . ' handle files larger than 2GB (this is a well-known PHP issue).' . PHP_EOL . PHP_EOL; }
+ if (!$int64_ok && is_windows()) { echo '* Note that PHP on Microsoft(R) Windows(R) does not support 64-bit integers' . PHP_EOL . ' at all, even if both the hardware and PHP are 64-bit. http://j.mp/php64win' . PHP_EOL . PHP_EOL; }
if ($ini_open_basedir || $ini_safe_mode) { echo '* You have open_basedir or safe_mode enabled in your php.ini file. Sometimes' . PHP_EOL . ' PHP behaves strangely when these settings are enabled. Disable them if you can.' . PHP_EOL . PHP_EOL; }
if (!$ini_zend_enable_gc) { echo '* The PHP garbage collector (available in PHP 5.3+) is not enabled in your' . PHP_EOL . ' php.ini file. Enabling zend.enable_gc will provide better memory management' . PHP_EOL . ' in the PHP core.' . PHP_EOL . PHP_EOL; }
@@ -171,41 +185,46 @@ function failure($s = 'No ')
echo info('Recommended settings for config.inc.php') . PHP_EOL;
echo PHP_EOL;
- echo 'define(\'AWS_DEFAULT_CACHE_CONFIG\', ';
- if ($apc_ok) echo '\'apc\'';
- elseif ($xcache_ok) echo '\'xcache\'';
- elseif ($file_ok) echo '\'/path/to/cache/folder\'';
- echo ');' . PHP_EOL;
-
- echo 'define(\'AWS_CERTIFICATE_AUTHORITY\', ';
- echo $ssl_result;
- echo ');' . PHP_EOL;
+ echo "CFCredentials::set(array(" . PHP_EOL;
+ echo " '@default' => array(" . PHP_EOL;
+ echo " 'key' => 'aws-key'," . PHP_EOL;
+ echo " 'secret' => 'aws-secret'," . PHP_EOL;
+ echo " 'default_cache_config' => ";
+ if ($apc_ok) echo success('\'apc\'');
+ elseif ($xcache_ok) echo success('\'xcache\'');
+ elseif ($file_ok) echo success('\'/path/to/cache/folder\'');
+ echo "," . PHP_EOL;
+ echo " 'certificate_authority' => " . success($ssl_result ? 'true' : 'false') . PHP_EOL;
+ echo " )" . PHP_EOL;
+ echo "));" . PHP_EOL;
}
-elseif ($php_ok && $curl_ok && $simplexml_ok && $spl_ok && $json_ok && $pcre_ok && $file_ok)
+elseif ($php_ok && $curl_ok && $simplexml_ok && $spl_ok && $json_ok && $pcre_ok && ($apc_ok || $xcache_ok || $sqlite_ok))
{
echo success('Bottom Line: Yes, you can!') . PHP_EOL;
echo PHP_EOL;
- echo 'Your PHP environment is ready to go! There are a couple of minor features that you won\'t be able to take advantage of, but nothing that\'s a show-stopper.' . PHP_EOL;
+ echo 'Your PHP environment is ready to go! There are a couple of minor features that' . PHP_EOL . 'you won\'t be able to take advantage of, but nothing that\'s a show-stopper.' . PHP_EOL;
echo PHP_EOL;
echo info('Recommended settings for config.inc.php') . PHP_EOL;
echo PHP_EOL;
- echo 'define(\'AWS_DEFAULT_CACHE_CONFIG\', ';
- if ($apc_ok) echo '\'apc\'';
- elseif ($xcache_ok) echo '\'xcache\'';
- elseif ($file_ok) echo '\'/path/to/cache/folder\'';
- echo ');' . PHP_EOL;
-
- echo 'define(\'AWS_CERTIFICATE_AUTHORITY\', ';
- echo $ssl_result;
- echo ');' . PHP_EOL;
+ echo "CFCredentials::set(array(" . PHP_EOL;
+ echo " '@default' => array(" . PHP_EOL;
+ echo " 'key' => 'aws-key'," . PHP_EOL;
+ echo " 'secret' => 'aws-secret'," . PHP_EOL;
+ echo " 'default_cache_config' => ";
+ if ($apc_ok) echo success('\'apc\'');
+ elseif ($xcache_ok) echo success('\'xcache\'');
+ elseif ($file_ok) echo success('\'/path/to/cache/folder\'');
+ echo "," . PHP_EOL;
+ echo " 'certificate_authority' => " . ($ssl_result ? 'false' : 'true') . PHP_EOL;
+ echo " )" . PHP_EOL;
+ echo "));" . PHP_EOL;
}
else
{
echo failure('Bottom Line: We\'re sorry...') . PHP_EOL;
- echo 'Your PHP environment does not support the minimum requirements for the AWS SDK for PHP.' . PHP_EOL;
+ echo 'Your PHP environment does not support the minimum requirements for the ' . PHP_EOL . 'AWS SDK for PHP.' . PHP_EOL;
}
echo PHP_EOL;
-?>
Oops, something went wrong.

0 comments on commit 573ede6

Please sign in to comment.