Permalink
Browse files

Initial commit of wordpress-example

  • Loading branch information...
0 parents commit b4483967290098521dfd83a2a5a78c715baecff2 @dblado dblado committed Aug 26, 2011
Showing 958 changed files with 234,593 additions and 0 deletions.
@@ -0,0 +1,38 @@
+#!/bin/bash
+# This is a simple build script, place your post-deploy but pre-start commands
+# in this script. This script gets executed directly, so it could be python,
+# php, ruby, etc.
+
+set -e
+
+if [ -z $OPENSHIFT_DB_HOST ]
+then
+ echo 1>&2
+ echo "Could not find mysql database. Please run:" 1>&2
+ echo "rhc-ctl-app -a $OPENSHIFT_APP_NAME -e add-mysql-5.1" 1>&2
+ echo "then make a sample commit (add whitespace somewhere) and re-push" 1>&2
+ echo 1>&2
+ exit 5
+fi
+
+# Confirm database exists, if not create it
+if ! /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" -e "select * from columns_priv;" "$OPENSHIFT_APP_NAME" > /dev/null
+then
+ echo
+ echo "Database schema not found, importing 'wordpressl.sql' schema."
+ echo
+ /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" "$OPENSHIFT_APP_NAME" < "$OPENSHIFT_REPO_DIR/.openshift/action_hooks/wordpress.sql"
+ echo
+ echo "done."
+ echo "=================================================="
+ echo " Wordpress-Admin login: admin"
+ echo " Wordpress-Admin password: OpenShiftAdmin"
+ echo " Don't forget to change your Wordpress admin password!"
+ echo "=================================================="
+else
+ echo "Database found, skipping import."
+fi
+
+# Secure some settings
+chmod -v 0440 $OPENSHIFT_REPO_DIR/php/sites/default/settings.php
+chmod -v 0440 $OPENSHIFT_REPO_DIR/php/sites/default/default.settings.php

Large diffs are not rendered by default.

Oops, something went wrong.
56 README
@@ -0,0 +1,56 @@
+Feel free to change or remove this file, it is informational only.
+
+Repo layout
+===========
+php/ - Externally exposed php code goes here
+libs/ - Additional libraries
+misc/ - For not-externally exposed php code
+../data - For persistent data (full path in environment var: OPENSHIFT_DATA_DIR)
+deplist.txt - list of pears to install
+.openshift/action_hooks/build - Script that gets run every push, just prior to
+ starting your app
+
+
+Notes about layout
+==================
+Please leave php, libs and data directories but feel free to create additional
+directories if needed.
+
+Note: Every time you push, everything in your remote repo dir gets recreated
+please store long term items (like an sqlite database) in ../data which will
+persist between pushes of your repo.
+
+
+Environment Variables
+=====================
+
+OpenShift Express provides several environment variables to reference for ease
+of use. The following list are some common variables but far from exhaustive:
+
+ $_ENV['OPENSHIFT_APP_NAME'] - Application name
+ $_ENV['OPENSHIFT_APP_DIR'] - Application dir
+ $_ENV['OPENSHIFT_DATA_DIR'] - For persistent storage (between pushes)
+ $_ENV['OPENSHIFT_TMP_DIR'] - Temp storage (unmodified files deleted after 10 days)
+
+When embedding a database using rhc-ctl-app, you can reference environment
+variables for username, host and password:
+
+ $_ENV['OPENSHIFT_DB_HOST'] - DB host
+ $_ENV['OPENSHIFT_DB_PORT'] - DB Port
+ $_ENV['OPENSHIFT_DB_USERNAME'] - DB Username
+ $_ENV['OPENSHIFT_DB_PASSWORD'] - DB Password
+
+To get a full list of environment variables, simply add a line in your
+.openshift/action_hooks/build script that says "export" and push.
+
+deplist.txt
+===========
+
+A list of pears to install, line by line on the server. This will happen when
+the user git pushes.
+
+
+Additional information
+======================
+
+Link to additional information will be here, when we have it :)
@@ -0,0 +1,56 @@
+Wordpress on OpenShift Express
+============================
+
+This git repository helps you get up and running quickly w/ a Wordpress installation
+on OpenShift Express. The backend database is MySQL and the database name is the
+same as your application name (using $_ENV['OPENSHIFT_APP_NAME']). You can call
+your application by whatever name you want (the name of the database will always
+match the application).
+
+
+Running on OpenShift
+----------------------------
+
+Create an account at http://openshift.redhat.com/
+
+Create a php-5.3 application (you can call your application whatever you want)
+
+ rhc-create-app -a wordpress -t php-5.3
+
+Add MySQL support to your application
+
+ rhc-ctl-app -a wordpress -e add-mysql-5.1
+
+Add this upstream wordpress repo
+
+ cd wordpress
+ git remote add upstream -m master git://github.com/openshift/wordpress-example.git
+ git pull -s recursive -X theirs upstream master
+ # note that the git pull above can be used later to pull updates to Wordpress
+
+Then push the repo upstream
+
+ git push
+
+That's it, you can now checkout your application at (default admin account is admin/admin):
+
+ http://wordpress-$your_domain.rhcloud.com
+
+
+NOTES:
+
+GIT_ROOT/.openshift/action_hooks/build:
+ This script is executed with every 'git push'. Feel free to modify this script
+ to learn how to use it to your advantage. By default, this script will create
+ the database tables that this example uses.
+
+ If you need to modify the schema, you could create a file
+ GIT_ROOT/.openshift/action_hooks/alter.sql and then use
+ GIT_ROOT/.openshift/action_hooks/build to execute that script (make susre to
+ back up your application + database w/ rhc-snapshot first :) )
+
+Wordpress Security:
+ If you're doing more than just 'playing' be sure to edit wp-config.php and modify
+ the Authentication Unique Keys and Salts. You can use the Wordpress site auth
+ key generator @ https://api.wordpress.org/secret-key/1.1/salt to help.
+
No changes.
No changes.
No changes.
Binary file not shown.
@@ -0,0 +1,3 @@
+<?php
+print 1;
+?>
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Front to the WordPress application. This file doesn't do anything, but loads
+ * wp-blog-header.php which does and tells WordPress to load the theme.
+ *
+ * @package WordPress
+ */
+
+/**
+ * Tells WordPress to load the WordPress theme and output it.
+ *
+ * @var bool
+ */
+define('WP_USE_THEMES', true);
+
+/** Loads the WordPress Environment and Template */
+require('./wp-blog-header.php');
+?>
Oops, something went wrong.

0 comments on commit b448396

Please sign in to comment.