Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Typeless gears compatibility

  • Loading branch information...
commit 5b2578be3a34ac8b00c1ed1fff5e90ac6b335197 1 parent 8acdb01
@ironcladlou ironcladlou authored
Showing with 10 additions and 11 deletions.
  1. +3 −3 .openshift/action_hooks/deploy
  2. +4 −5 README
  3. +3 −3 php/config.php
View
6 .openshift/action_hooks/deploy
@@ -6,7 +6,7 @@
set -e
-if [ -z $OPENSHIFT_DB_HOST ]
+if [ -z $OPENSHIFT_MYSQL_DB_HOST ]
then
echo 1>&2
echo "Could not find mysql database. Please run:" 1>&2
@@ -17,12 +17,12 @@ then
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 user;" wolfcms > /dev/null 2>&1
+if ! /usr/bin/mysql -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" -e "select * from user;" wolfcms > /dev/null 2>&1
then
echo
echo "Database schema not found, importing 'wolfcms.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/wolfcms.sql"
+ /usr/bin/mysql -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" "$OPENSHIFT_APP_NAME" < "$OPENSHIFT_REPO_DIR/.openshift/action_hooks/wolfcms.sql"
echo
echo "done."
echo "=================================================="
View
9 README
@@ -30,17 +30,16 @@ OpenShift 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_GEAR_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 app cartridge add', 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
+ $_ENV['OPENSHIFT_MYSQL_DB_HOST'] - DB host
+ $_ENV['OPENSHIFT_MYSQL_DB_PORT'] - DB Port
+ $_ENV['OPENSHIFT_MYSQL_DB_USERNAME'] - DB Username
+ $_ENV['OPENSHIFT_MYSQL_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.
View
6 php/config.php
@@ -6,9 +6,9 @@
// For more info look at: www.php.net/pdo
// Database settings:
-define('DB_DSN', 'mysql:dbname=wolfcms;host=' . $_ENV['OPENSHIFT_DB_HOST'] . ';port=' . $_ENV['OPENSHIFT_DB_PORT']);
-define('DB_USER', $_ENV['OPENSHIFT_DB_USERNAME']);
-define('DB_PASS', $_ENV['OPENSHIFT_DB_PASSWORD']);
+define('DB_DSN', 'mysql:dbname=wolfcms;host=' . $_ENV['OPENSHIFT_MYSQL_DB_HOST'] . ';port=' . $_ENV['OPENSHIFT_MYSQL_DB_PORT']);
+define('DB_USER', $_ENV['OPENSHIFT_MYSQL_DB_USERNAME']);
+define('DB_PASS', $_ENV['OPENSHIFT_MYSQL_DB_PASSWORD']);
define('TABLE_PREFIX', '');
// Should Wolf produce PHP error messages for debugging?
Please sign in to comment.
Something went wrong with that request. Please try again.