Today we publicly announced the 1.8.1 release of Google App Engine, and as part of this release we’ve added a bunch of new features for the PHP runtime. The highlights of what’s new includes:
- Three more runtime extensions:
- The ability to
requirefiles PHP scripts from Google Cloud Storage.
- Better support for
url_statof items in Google Cloud Storage.
- Support for application files with ‘@’ in their name.
- Honor the
default_stream_context()when using the Google Cloud Storage stream wrapper.
- Added the
CloudStorageTools::deleteImageServiceUrl()call for the high speed image serving service.
- Fixed a bug where $_SERVER[“PHP_SELF”] was including the query string of the URL.
- Removed the
- Simplified the types of exceptions that can be thrown from the Users API.
Including Files From Google Cloud Storage
As mentioned, with this release we’ve made it possible to include and/or require script files from Google Cloud Storage.
To enable this feature, you must list the buckets that you want to include files from in your applications php.ini file. The bucket names can be specified as a comma separated list to the
google_app_engine.allow_include_gs_buckets ini setting.
google_app_engine.allow_include_gs_buckets = "my_bucket"
Once you have configured the bucket, you can then include the files directly in your PHP application code.
<?php require_once "gs://my_bucket/file.php";
The ideal use case for storing script files in Google Cloud Storage is for the intermediate files generated by various templating frameworks. Accessing script files from Google Cloud Storage is slower than accessing files that have been uploaded as part of you application and these files cannot take advantage of the powerful versioning system that App Engine provides.