Skip to content

Commit

Permalink
Fixed conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Sturgeon committed Apr 26, 2012
2 parents cdfbd52 + f3b0074 commit ba46361
Show file tree
Hide file tree
Showing 107 changed files with 1,766 additions and 3,380 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Expand Up @@ -8,14 +8,17 @@ env:
- DB=mysql
- DB=pgsql
- DB=sqlite
- DB=pdo/mysql
- DB=pdo/pgsql
- DB=pdo/sqlite

before_script:
- pyrus channel-discover pear.php-tools.net
- pyrus install http://pear.php-tools.net/get/vfsStream-0.11.2.tgz
- phpenv rehash
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'create database ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ] || [ '$DB' = 'pdo/mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"

script: phpunit --configuration tests/travis/$DB.phpunit.xml

Expand Down
47 changes: 25 additions & 22 deletions application/config/database.php
Expand Up @@ -43,9 +43,10 @@
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database type. e.g.: mysql. Currently supported:
mysql, mysqli, pdo, postgre, odbc, mssql, sqlite, oci8
| cubrid, interbase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record class
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
Expand All @@ -68,30 +69,32 @@
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
| The $query_builder variables lets you determine whether or not to load
| the query builder class
*/

$active_group = 'default';
$active_record = TRUE;
$query_builder = TRUE;

$db['default']['dsn'] = '';
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
$db['default']['failover'] = array();
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'stricton' => FALSE,
'failover' => array()
);

/* End of file database.php */
/* Location: ./application/config/database.php */
63 changes: 34 additions & 29 deletions application/config/foreign_chars.php
Expand Up @@ -40,50 +40,55 @@
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά/' => 'a',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Ð|Ď|Đ/' => 'Dj',
'/ð|ď|đ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
'/ĝ|ğ|ġ|ģ/' => 'g',
'/Ð|Ď|Đ/' => 'Dj',
'/ð|ď|đ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
'/ĝ|ğ|ġ|ģ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ/' => 'K',
'/ķ/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł/' => 'l',
'/Ñ|Ń|Ņ|Ň/' => 'N',
'/ñ|ń|ņ|ň|ʼn/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o',
'/Ŕ|Ŗ|Ř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ß/'=> 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f'
'/ƒ/' => 'f',
'/ξ/' => 'ks',
'/π/' => 'p',
'/β/' => 'v',
'/μ/' => 'm',
'/ψ/' => 'ps',
);

/* End of file foreign_chars.php */
Expand Down
11 changes: 4 additions & 7 deletions system/core/Benchmark.php
Expand Up @@ -61,7 +61,7 @@ class CI_Benchmark {
*/
public function mark($name)
{
$this->marker[$name] = microtime();
$this->marker[$name] = microtime(TRUE);
}

// --------------------------------------------------------------------
Expand Down Expand Up @@ -93,13 +93,10 @@ public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)

if ( ! isset($this->marker[$point2]))
{
$this->marker[$point2] = microtime();
$this->marker[$point2] = microtime(TRUE);
}

list($sm, $ss) = explode(' ', $this->marker[$point1]);
list($em, $es) = explode(' ', $this->marker[$point2]);

return number_format(($em + $es) - ($sm + $ss), $decimals);
return number_format($this->marker[$point2] - $this->marker[$point1], $decimals);
}

// --------------------------------------------------------------------
Expand All @@ -122,4 +119,4 @@ public function memory_usage()
}

/* End of file Benchmark.php */
/* Location: ./system/core/Benchmark.php */
/* Location: ./system/core/Benchmark.php */
16 changes: 8 additions & 8 deletions system/core/CodeIgniter.php
Expand Up @@ -275,20 +275,20 @@ function &get_instance()
{
$x = explode('/', $RTR->routes['404_override'], 2);
$class = $x[0];
$method = (isset($x[1]) ? $x[1] : 'index');
$method = isset($x[1]) ? $x[1] : 'index';
if ( ! class_exists($class))
{
if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
{
show_404("{$class}/{$method}");
show_404($class.'/'.$method);
}

include_once(APPPATH.'controllers/'.$class.'.php');
}
}
else
{
show_404("{$class}/{$method}");
show_404($class.'/'.$method);
}
}

Expand Down Expand Up @@ -337,12 +337,12 @@ function &get_instance()
{
$x = explode('/', $RTR->routes['404_override'], 2);
$class = $x[0];
$method = (isset($x[1]) ? $x[1] : 'index');
$method = isset($x[1]) ? $x[1] : 'index';
if ( ! class_exists($class))
{
if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
{
show_404("{$class}/{$method}");
show_404($class.'/'.$method);
}

include_once(APPPATH.'controllers/'.$class.'.php');
Expand All @@ -352,7 +352,7 @@ function &get_instance()
}
else
{
show_404("{$class}/{$method}");
show_404($class.'/'.$method);
}
}

Expand Down Expand Up @@ -393,10 +393,10 @@ function &get_instance()
* Close the DB connection if one exists
* ------------------------------------------------------
*/
if (class_exists('CI_DB') && isset($CI->db))
if (class_exists('CI_DB') && isset($CI->db) && ! $CI->db->pconnect)
{
$CI->db->close();
}

/* End of file CodeIgniter.php */
/* Location: ./system/core/CodeIgniter.php */
/* Location: ./system/core/CodeIgniter.php */
12 changes: 6 additions & 6 deletions system/core/Loader.php
Expand Up @@ -313,16 +313,16 @@ public function model($model, $name = '', $db_conn = FALSE)
*
* @param string the DB credentials
* @param bool whether to return the DB object
* @param bool whether to enable active record (this allows us to override the config setting)
* @param bool whether to enable query builder (this allows us to override the config setting)
* @return object
*/
public function database($params = '', $return = FALSE, $active_record = NULL)
public function database($params = '', $return = FALSE, $query_builder = NULL)
{
// Grab the super object
$CI =& get_instance();

// Do we even need to load the database class?
if (class_exists('CI_DB') && $return == FALSE && $active_record == NULL && isset($CI->db) && is_object($CI->db))
if (class_exists('CI_DB') && $return == FALSE && $query_builder == NULL && isset($CI->db) && is_object($CI->db))
{
return FALSE;
}
Expand All @@ -331,15 +331,15 @@ public function database($params = '', $return = FALSE, $active_record = NULL)

if ($return === TRUE)
{
return DB($params, $active_record);
return DB($params, $query_builder);
}

// Initialize the db variable. Needed to prevent
// reference errors with some configurations
$CI->db = '';

// Load the DB class
$CI->db =& DB($params, $active_record);
$CI->db =& DB($params, $query_builder);
}

// --------------------------------------------------------------------
Expand Down Expand Up @@ -1254,4 +1254,4 @@ protected function _ci_prep_filename($filename, $extension)
}

/* End of file Loader.php */
/* Location: ./system/core/Loader.php */
/* Location: ./system/core/Loader.php */
14 changes: 7 additions & 7 deletions system/core/Output.php
Expand Up @@ -43,37 +43,37 @@ class CI_Output {
*
* @var string
*/
protected $final_output;
public $final_output;
/**
* Cache expiration time
*
* @var int
*/
protected $cache_expiration = 0;
public $cache_expiration = 0;
/**
* List of server headers
*
* @var array
*/
protected $headers = array();
public $headers = array();
/**
* List of mime types
*
* @var array
*/
protected $mime_types = array();
public $mime_types = array();
/**
* Determines wether profiler is enabled
*
* @var book
*/
protected $enable_profiler = FALSE;
public $enable_profiler = FALSE;
/**
* Determines if output compression is enabled
*
* @var bool
*/
protected $_zlib_oc = FALSE;
protected $_zlib_oc = FALSE;
/**
* List of profiler sections
*
Expand All @@ -85,7 +85,7 @@ class CI_Output {
*
* @var bool
*/
protected $parse_exec_vars = TRUE;
public $parse_exec_vars = TRUE;

public function __construct()
{
Expand Down

0 comments on commit ba46361

Please sign in to comment.