diff --git a/.gitmodules b/.gitmodules index e9081529..d2e07969 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,9 @@ [submodule "batcache"] path = batcache url = https://github.com/Automattic/batcache.git -[submodule "wordpress"] - path = wordpress - url = https://github.com/WordPress/WordPress.git [submodule "wp-memcache"] path = wp-memcache url = https://github.com/jeremyfelt/Memcached-Object-Cache.git +[submodule "wordpress"] + path = wordpress + url = https://github.com/WordPress/WordPress.git diff --git a/README.md b/README.md index afd6e302..86a090cf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +![status: inactive](https://img.shields.io/badge/status-inactive-red.svg) + +This project is no longer actively developed or maintained. + +For new work on this check out [A helper command for running WordPress on Google Cloud Platform](https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/appengine/wordpress) + # WordPress on App Engine Starter Project ***Note: This repo is essentially the "source" of the starter projects, allowing you to browse our code, suggest changes, etc. We provide already-built-and-zipped WordPress projects for Windows, Mac, and Linux at [Quick Start WordPress for Google App Engine](http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/).*** @@ -7,9 +13,9 @@ 1. Install the [PHP SDK for Google App Engine](https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_PHP) 2. Install [MySQL](http://dev.mysql.com/downloads/) 3. [Sign up](http://cloud.google.com/console) for a Google Cloud Platform project, and -set up a Cloud SQL instance, as described [here](https://developers.google.com/cloud-sql/docs/instances), and a +set up a Cloud SQL instance, as described [here](https://cloud.google.com/sql/docs/getting-started#create), and a Cloud Storage bucket, as described [here](https://developers.google.com/storage/docs/signup). You'll want to name -your Cloud SQL instance "wordpress" to match the config files provided here. +your Cloud SQL instance "wordpress" to match the config files provided here. To keep costs down, we suggest signing up for a D0 instance with package billing. 4. Visit your project in the [Google Cloud Console](http://cloud.google.com/console), going to the App Engine section's **Application Settings** area, and make a note of the **Service Account Name** for your application, which has an e-mail address @@ -55,7 +61,11 @@ This script: ## Running WordPress locally -Using MySQL, run `databasesetup.sql` to set up your local database. For a default installation (no root password) +>First, edit [wp-config.php](https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project/edit/master/wp-config.php) + so that the local environment password for root is not literally the string "password" -- unless that's what you used + when setting up MySQL locally. + +Using MySQL's command line version, run `databasesetup.sql` to set up your local database. For a default installation (no root password) this would be: mysql -u root < databasesetup.sql diff --git a/app.yaml b/app.yaml index 9a166849..ea0881d8 100644 --- a/app.yaml +++ b/app.yaml @@ -1,6 +1,6 @@ application: your-project-id version: wpfromstarterproject -runtime: php +runtime: php55 api_version: 1 handlers: @@ -9,14 +9,20 @@ handlers: upload: wordpress/.*\.(htm|html|css|js)$ application_readable: true -- url: /wp-content/(.*\.(ico|jpg|png|gif))$ +- url: /wp-content/(.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg))$ static_files: wordpress/wp-content/\1 - upload: wordpress/wp-content/.*\.(ico|jpg|png|gif)$ + upload: wordpress/wp-content/.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg)$ application_readable: true -- url: /(.*\.(ico|jpg|png|gif))$ +- url: /(.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg))$ static_files: wordpress/\1 - upload: wordpress/.*\.(ico|jpg|png|gif)$ + upload: wordpress/.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg)$ + application_readable: true + +- url: /wp-includes/images/media/(.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg))$ + static_files: wordpress/wp-includes/images/media/\1 + upload: wordpress/wp-includes/images/media/.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg)$ + application_readable: true - url: /wp-admin/(.+) script: wordpress/wp-admin/\1 diff --git a/appengine-php-wordpress-starter-project_build_linux_mac.zip b/appengine-php-wordpress-starter-project_build_linux_mac.zip index 556ff773..b4f94cc2 100644 Binary files a/appengine-php-wordpress-starter-project_build_linux_mac.zip and b/appengine-php-wordpress-starter-project_build_linux_mac.zip differ diff --git a/appengine-php-wordpress-starter-project_windows.zip b/appengine-php-wordpress-starter-project_windows.zip index a7de2c51..f246fe79 100644 Binary files a/appengine-php-wordpress-starter-project_windows.zip and b/appengine-php-wordpress-starter-project_windows.zip differ diff --git a/appengine-wordpress-plugin b/appengine-wordpress-plugin index 7b699262..53761c4a 160000 --- a/appengine-wordpress-plugin +++ b/appengine-wordpress-plugin @@ -1 +1 @@ -Subproject commit 7b699262212845287bac141ff56ddbe65ff4f14b +Subproject commit 53761c4a99cedada3137a112929dae6aec001640 diff --git a/batcache b/batcache index e31e7759..efc252da 160000 --- a/batcache +++ b/batcache @@ -1 +1 @@ -Subproject commit e31e775972e2fa2f91ad2aa6db95e5c6cb402f9d +Subproject commit efc252da6e0300fff4a67d90759a7e54fb372b97 diff --git a/cron.yaml b/cron.yaml index a6891b5a..6eddf505 100644 --- a/cron.yaml +++ b/cron.yaml @@ -1,4 +1,4 @@ cron: - description: wordpress cron tasks url: /wp-cron.php - schedule: every 2 hours \ No newline at end of file + schedule: every 15 minutes \ No newline at end of file diff --git a/php.ini b/php.ini index 66e8d912..5fe2210a 100644 --- a/php.ini +++ b/php.ini @@ -1,3 +1,6 @@ google_app_engine.enable_functions = "php_sapi_name, gc_enabled" allow_url_include = "1" upload_max_filesize = 8M + +; enable downloading files for localhost +google_app_engine.disable_readonly_filesystem = 1 diff --git a/wordpress b/wordpress index 54a3b49f..d101cb39 160000 --- a/wordpress +++ b/wordpress @@ -1 +1 @@ -Subproject commit 54a3b49fa91b7beeb3da2f448154f9e75f005a9a +Subproject commit d101cb394733f3a7d3fe6d935df0610ec2510057 diff --git a/wp-config.php b/wp-config.php index 508aec43..5a6c74e6 100644 --- a/wp-config.php +++ b/wp-config.php @@ -18,15 +18,18 @@ define('WP_CACHE', true); // ** MySQL settings - You can get this info from your web host ** // - /** The name of the database for WordPress */ - define('DB_NAME', 'wordpress_db'); if (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) { + /** The name of the Cloud SQL database for WordPress */ + define('DB_NAME', 'wordpress_db'); /** Live environment Cloud SQL login and SITE_URL info */ + /** Note that from App Engine, the password is not required, so leave it blank here */ define('DB_HOST', ':/cloudsql/your-project-id:wordpress'); define('DB_USER', 'root'); define('DB_PASSWORD', ''); } else { + /** The name of the local database for WordPress */ + define('DB_NAME', 'wordpress_db'); /** Local environment MySQL login info */ define('DB_HOST', '127.0.0.1'); define('DB_USER', 'root'); @@ -95,7 +98,18 @@ * in their development environments. */ define('WP_DEBUG', false); - + + /** + * Disable default wp-cron in favor of a real cron job + */ + define('DISABLE_WP_CRON', true); + + // configures batcache + $batcache = [ + 'seconds'=>0, + 'max_age'=>30*60, // 30 minutes + 'debug'=>false + ]; /* That's all, stop editing! Happy blogging. */ /** Absolute path to the WordPress directory. */ @@ -105,9 +119,4 @@ /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php'); - // configures batcache - $batcache = [ - 'seconds'=>0, - 'max_age'=>30*60, // 30 minutes - 'debug'=>false - ]; +