Skip to content

Commit

Permalink
Merge branch 'dev' of http://github.com/ceeram-infinitas/infinitas in…
Browse files Browse the repository at this point in the history
…to dev
  • Loading branch information
dogmatic69 committed Jun 20, 2012
2 parents 68f01ce + da70165 commit 469b44b
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 8 deletions.
73 changes: 69 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,81 @@ language: php

php:
- 5.3
- 5.4

env:
- CAKE_VERSION=2.2

before_script:
- git clone --depth 1 git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
- cd .. && git clone git://github.com/cakephp/cakephp && cd cakephp && git checkout $CAKE_VERSION
- cd .. && ln -s cakephp/lib lib
- cd infinitas
- chmod -R 777 ./tmp
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE infinitas_test;'; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE infinitas_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA infinitas_test;' -U postgres -d infinitas_test; fi"
- set +H
- echo "<?php
class DATABASE_CONFIG {
private \$identities = array(
'mysql' => array(
'datasource' => 'Database/Mysql',
'host' => '0.0.0.0',
'login' => 'travis'
),
'pgsql' => array(
'datasource' => 'Database/Postgres',
'host' => '127.0.0.1',
'login' => 'postgres',
'database' => 'infinitas_test',
'schema' => array(
'default' => 'public',
'test' => 'infinitas_test',
)
),
'sqlite' => array(
'datasource' => 'Database/Sqlite',
'database' => array(
'default' => ':memory:',
'test' => ':memory:',
),
)
);
public \$default = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'infinitas',
'prefix' => ''
);
public \$test = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'infinitas_test',
'prefix' => ''
);
public function __construct() {
\$db = 'mysql';
if (!empty(\$_SERVER['DB'])) {
\$db = \$_SERVER['DB'];
}
foreach (array('default', 'test') as \$source) {
\$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
if (is_array(\$config['database'])) {
\$config['database'] = \$config['database'][\$source];
}
if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
\$config['schema'] = \$config['schema'][\$source];
}
\$this->{\$source} = \$config;
}
}
}" > Config/database.php

script:
- for plugin in `ls ./infinitas/Core`; do ./lib/Cake/Console/cake test -app ./infinitas $plugin 'All' $plugin 'Tests'; done
- ./lib/Cake/Console/cake test core Utility/Hash

notifications:
irc: "irc.freenode.org#infinitas"
false
10 changes: 6 additions & 4 deletions Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public function __construct($request = null, $response = null) {
parent::__construct($request, $response);
return;
}

$this->__setupConfig();
$event = EventCore::trigger($this, 'requireComponentsToLoad');

Expand Down Expand Up @@ -283,7 +283,7 @@ public function beforeFilter() {
}

$this->__callBacks[__FUNCTION__] = true;

$this->prettyModelName = prettyName($this->modelClass);
if(!empty($this->Session) && !$this->Session->read('ip_address')){
$this->Session->write('ip_address', $this->request->clientIp());
Expand Down Expand Up @@ -521,6 +521,8 @@ private function __loadAsset($data, $method){
* @return Full output string of view contents
*/
public function render($view = null, $layout = null) {
var_dump(Debugger::trace());
exit;
if(($this->request->action == 'admin_edit' || $this->request->action == 'admin_add')) {
$viewPath = App::pluginPath($this->plugin) . 'View' . DS . $this->viewPath . DS . $this->request->action . '.ctp';
if(!file_exists($viewPath)) {
Expand Down Expand Up @@ -756,11 +758,11 @@ public function invokeComponentAction($request, $e = null) {
if($e instanceof MissingActionException) {
$e = null;
}

if(empty($e)) {
$e = $request->params['pass'];
}

return $this->{$component}->dispatchMethod($action, $e);
}
}
Expand Down

0 comments on commit 469b44b

Please sign in to comment.