Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Pagoda specific code back in

  • Loading branch information...
commit 9fa9c27fc16c0346aaf298599123f4d26ea184fc 1 parent dafc299
@jerel jerel authored
View
49 Boxfile
@@ -0,0 +1,49 @@
+web1:
+
+ ################################################
+ ## GENERAL SETTINGS
+ ################################################
+ shared_writable_dirs: [/system/cms/cache, /system/cms/logs, /uploads, /addons]
+
+ ################################################
+ ## WEB SPECIFIC SETTINGS
+ ################################################
+ index_list: [index.php]
+
+ ################################################
+ ## After Build Hook
+ ################################################
+ after_build:
+
+ # If we don't have a database config file yet then we'll copy the one from installer/assets
+ - "[ -f 'system/cms/config/database.php' ] || mv 'installer/assets/config/dynamic_database.php' 'system/cms/config/database.php'"
+
+ # Since we know Pagoda Box loads mod_rewrite we get rid of the index.php in the url on every install
+ - "sed -i \"s/'index.php'/''/g\" system/cms/config/config.php"
+
+ ################################################
+ ## After Deploy Hook
+ ################################################
+ after_deploy:
+
+ # All files are in place and the database connection is ready. Run the install
+ - "curl -s http://${APP_NAME}.pagodabox.com/installer/index.php/quick_install"
+
+ ################################################
+ ## PHP SPECIFIC SETTINGS
+ ################################################
+ php_extensions: [mysql, curl, gd, mbstring]
+ php_error_reporting: 'E_ALL'
+ php_display_errors: On
+ php_short_open_tag: Off
+ php_default_mimetype: text/html
+ php_date_timezone: Europe/London
+ php_max_execution_time: 30
+ php_max_input_time: 60
+ php_post_max_size: 25M
+ php_file_uploads: On
+ php_upload_max_filesize: 20M
+ php_max_file_uploads: 20
+
+db1:
+ name: 'site'
View
98 installer/assets/config/dynamic_database.php
@@ -0,0 +1,98 @@
+<?php defined('BASEPATH') OR exit('No direct script access allowed');
+/*
+| -------------------------------------------------------------------
+| DATABASE CONNECTIVITY SETTINGS
+| -------------------------------------------------------------------
+| This file will contain the settings needed to access your database.
+|
+| For complete instructions please consult the 'Database Connection'
+| page of the User Guide.
+|
+| -------------------------------------------------------------------
+| EXPLANATION OF VARIABLES
+| -------------------------------------------------------------------
+|
+| ['hostname'] The hostname of your database server.
+| ['username'] The username used to connect to the database
+| ['password'] The password used to connect to the database
+| ['database'] The name of the database you want to connect to
+| ['dbdriver'] The database type. ie: mysql. Currently supported:
+ mysql, mysqli, postgre, odbc, mssql
+| ['dbprefix'] You can add an optional prefix, which will be added
+| to the table name when using the Active Record class
+| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
+| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
+| ['active_r'] TRUE/FALSE - Whether to load the active record class
+| ['cache_on'] TRUE/FALSE - Enables/disables query caching
+| ['cachedir'] The path to the folder where cache files should be stored
+|
+| The $active_group variable lets you choose which connection group to
+| make active. By default there is only one group (the "default" group).
+|
+*/
+
+// Development
+$db[PYRO_DEVELOPMENT] = array(
+ 'hostname' => $_SERVER['DB1_HOST'],
+ 'username' => $_SERVER['DB1_USER'],
+ 'password' => $_SERVER['DB1_PASS'],
+ 'database' => $_SERVER['DB1_NAME'],
+ 'dbdriver' => 'mysql',
+ 'dbprefix' => '',
+ 'active_r' => TRUE,
+ 'pconnect' => FALSE,
+ 'db_debug' => TRUE,
+ 'cache_on' => FALSE,
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_unicode_ci',
+ 'port' => $_SERVER['DB1_PORT'],
+
+ // 'Tough love': Forces strict mode to test your app for best compatibility
+ 'stricton' => TRUE,
+);
+
+// Staging
+/*
+$db[PYRO_STAGING] = array(
+ 'hostname' => '',
+ 'username' => '',
+ 'password' => '',
+ 'database' => 'pyrocms',
+ 'dbdriver' => 'mysql',
+ 'active_r' => TRUE,
+ 'pconnect' => FALSE,
+ 'db_debug' => FALSE,
+ 'cache_on' => FALSE,
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_unicode_ci',
+ 'port' => 3306,
+);
+*/
+
+// Production
+$db[PYRO_PRODUCTION] = array(
+ 'hostname' => $_SERVER['DB1_HOST'],
+ 'username' => $_SERVER['DB1_USER'],
+ 'password' => $_SERVER['DB1_PASS'],
+ 'database' => $_SERVER['DB1_NAME'],
+ 'dbdriver' => 'mysql',
+ 'active_r' => TRUE,
+ 'pconnect' => FALSE,
+ 'db_debug' => FALSE,
+ 'cache_on' => FALSE,
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_unicode_ci',
+ 'port' => $_SERVER['DB1_PORT'],
+);
+
+
+// Check the configuration group in use exists
+if ( ! array_key_exists(ENVIRONMENT, $db))
+{
+ show_error(sprintf(lang('error_invalid_db_group'), ENVIRONMENT));
+}
+
+// Assign the group to be used
+$active_group = ENVIRONMENT;
+
+/* End of file database.php */
View
68 installer/controllers/quick_install.php
@@ -0,0 +1,68 @@
+<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * @author Jerel Unruh - PyroCMS development team
+ * @package PyroCMS
+ * @subpackage Installer
+ * @category Application
+ * @since v2.0.2
+ *
+ * Quick Installer
+ */
+class Quick_install extends CI_Controller
+{
+
+ public function index()
+ {
+ // set the user info for our throw-away account
+ $data = array('user_name' => 'default',
+ 'user_email' => 'default@site.com',
+ 'site_ref' => 'default',
+ 'user_firstname' => 'Default',
+ 'user_lastname' => 'User',
+ 'user_password' => 'password',
+ 'database' => $_SERVER['DB1_NAME']);
+
+ // If they're using the quick install then
+ // the server must supply the database auth details
+ $this->session->set_userdata(array(
+ 'hostname' => $_SERVER['DB1_HOST'],
+ 'username' => $_SERVER['DB1_USER'],
+ 'password' => $_SERVER['DB1_PASS'],
+ 'port' => $_SERVER['DB1_PORT']
+ ));
+
+ // add this to $post since that's where the
+ // module_import library expects it to be
+ $_POST['database'] = $_SERVER['DB1_NAME'];
+ $_POST['port'] = $_SERVER['DB1_PORT'];
+
+ $this->installer_lib->install($data, TRUE);
+
+ //define the default user email to be used in the settings module install
+ define('DEFAULT_EMAIL', $data['user_email']);
+
+ // set the supported languages to be saved in Settings for emails and .etc
+ // modules > settings > details.php uses this
+ require_once(dirname(FCPATH).'/system/cms/config/language.php');
+
+ define('DEFAULT_LANG', $config['default_language']);
+
+ // Import the modules
+ $this->load->library('module_import');
+ $this->module_import->import_all();
+
+ // output the results to their terminal
+ echo PHP_EOL.
+ '*************************************************************'.PHP_EOL.
+ '* '.PHP_EOL.
+ '* PyroCMS has installed successfully! '.PHP_EOL.
+ '* You may login to your new installation at http://'.$_SERVER['HTTP_HOST'].PHP_EOL.
+ '* The default email is "default@site.com" and the password is "password". Change this promptly!'.PHP_EOL.
+ '* Remember: delete the installer directory and commit before your next Git push or PyroCMS will re-install!'.PHP_EOL.
+ '* '.PHP_EOL.
+ '*************************************************************'.PHP_EOL.
+ PHP_EOL;
+ }
+}
+
+/* End of file installer.php */
Please sign in to comment.
Something went wrong with that request. Please try again.