Skip to content

Commit

Permalink
More stuff for Travis and Continuous Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kobia committed Oct 2, 2013
1 parent 0c60689 commit 05c671a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ php:
- 5.3
services:
- mysql
env:
- KOHANA_ENV=testing
before_script:
- composer install --no-interaction --prefer-source # Have to prefer source or hit github rate limit
- git submodule update --init --recursive
Expand All @@ -13,8 +15,8 @@ before_script:
- cp application/config/modules.template application/config/modules.php

# db setup
#- mysql -e 'create database pingapp_test;'
#- ./minion --task=migrations:run --up
- mysql -e 'create database pingapp_test;'
- ./minion --task=migrations:run --up
# webserver setup
- php -S localhost:8000 httpdocs/index.php &
- sleep 3
Expand Down
17 changes: 13 additions & 4 deletions application/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,29 @@
/**
* Set Kohana::$environment if a 'KOHANA_ENV' environment variable has been supplied.
*
* Note: If you supply an invalid environment name, a PHP warning will be thrown
* saying "Couldn't find constant Kohana::<INVALID_ENV_NAME>"
* Note: If you supply an invalid environment name 'development' will be used instead
*/
if (isset($_SERVER['KOHANA_ENV']))
if (($env = getenv('KOHANA_ENV')) === FALSE OR defined('Kohana::'.strtoupper($env)) === FALSE)
{
Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
$env = 'development';
}

// Ignoring code standards error about constant case
// @codingStandardsIgnoreStart
Kohana::$environment = constant('Kohana::'.strtoupper($env));
// @codingStandardsIgnoreEnd

/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config = new Config;
Kohana::$config->attach(new Config_File);

/**
* Attach the environment specific configuration file reader to config
*/
Kohana::$config->attach(new Config_File('config/environments/'.$env));

/**
* Initialize Kohana, setting the default options.
*/
Expand Down
18 changes: 18 additions & 0 deletions application/config/environments/testing/auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php defined('SYSPATH') or die('No direct access allowed.');

return array(

'driver' => 'ORM',
'hash_method' => 'sha256',
'hash_key' => 'somereallylongkey',
'lifetime' => 1209600,
'session_type' => Session::$default,
'session_key' => 'auth_user',

// Username/password combinations for the Auth File driver
'users' => array(
// 'admin' => 'b3154acf3a344170077d11bdb5fff31532f679a1919e716a02',
'admin' => ''
),

);
29 changes: 29 additions & 0 deletions application/config/environments/testing/database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php defined('SYSPATH') or die('No direct access allowed.');

/**
* Database Config
*
* @author Ushahidi Team <[email protected]>
* @package Ushahidi\Application
* @copyright Ushahidi - http://www.ushahidi.com
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License Version 3 (GPLv3)
*/

return array
(
'default' => array
(
'type' => 'MySQL',
'connection' => array(
'hostname' => 'localhost',
'database' => 'pingapp_test',
'username' => 'root',
'password' => '',
'persistent' => FALSE,
),
'table_prefix' => '',
'charset' => 'utf8',
'caching' => TRUE,
'profiling' => TRUE,
)
);

0 comments on commit 05c671a

Please sign in to comment.