Skip to content

Commit

Permalink
Major directory restructuring done for simpler installation process.
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisJordan committed Nov 28, 2008
1 parent 6c98232 commit eebb58b
Show file tree
Hide file tree
Showing 320 changed files with 79 additions and 111 deletions.
File renamed without changes.
23 changes: 23 additions & 0 deletions TestRunner.php
@@ -0,0 +1,23 @@
<?php
// Pre-release test runner. This will become a plug-in.

require_once('recess/lib/simpletest/autorun.php');
require_once('recess/lib/simpletest/mock_objects.php');
require_once('recess/lib/simpletest/unit_tester.php');
require_once('recess/lib/recess/Recess.php');

class AllTests extends TestSuite {
function __construct() {
$this->TestSuite('All Tests');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/lang/InflectorTest.class.php');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/lang/RecessClassTest.class.php');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/framework/routing/RoutingNodeTest.class.php');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/sources/db/sql/SelectSqlBuilderTest.class.php');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/sources/db/pdo/PdoDataSetTest.class.php');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/sources/db/pdo/SqlitePdoDataSourceTest.class.php');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/lang/RecessReflectionClassTest.class.php');
$this->addFile(dirname(__FILE__) . '/recess/test/lib/recess/sources/db/orm/ModelTest.class.php');
}
}

?>
1 change: 1 addition & 0 deletions apps/.htaccess
@@ -0,0 +1 @@
deny from all
7 changes: 2 additions & 5 deletions public/bootstrap.php → bootstrap.php
Expand Up @@ -4,14 +4,12 @@
*
* @author Kris Jordan
*/
require_once('../lib/recess/Recess.php');

$file = str_replace('\\','/',__FILE__);
$_ENV['dir.public'] = substr($file, 0, strrpos(str_replace('\\','/',$file) ,'/') + 1);
$_ENV['dir.base'] = substr($_ENV['dir.public'], 0, strrpos($_ENV['dir.public'] ,'/', -2) + 1);
$_ENV['dir.documentRoot'] = substr($file, 0, strrpos(str_replace('\\','/',$file) ,'/') + 1);
$_ENV['url.base'] = str_replace('bootstrap.php', '', $_SERVER['PHP_SELF']);
unset($file);

$bootstrapped = true;
require_once('./recess-config.php');

Library::import('recess.diagnostics.Diagnostics');
Expand All @@ -21,5 +19,4 @@
Library::import('recess.framework.Coordinator');
Library::import('recess.http.Environment');
Coordinator::main(Environment::getRawRequest(), Config::$policy, Config::$applications, Config::getRouter(), Config::$plugins);

?>
File renamed without changes
File renamed without changes
File renamed without changes.
42 changes: 0 additions & 42 deletions public/StdClass.php

This file was deleted.

23 changes: 0 additions & 23 deletions public/TestRunner.php

This file was deleted.

3 changes: 0 additions & 3 deletions public/phpinfo.php

This file was deleted.

69 changes: 34 additions & 35 deletions public/recess-config.php → recess-config.php
@@ -1,50 +1,56 @@
<?php if(!isset($_ENV['dir.base'])) exit;
<?php if(isset($bootstrapped)) unset($bootstrapped); else exit;

/* BEGIN RECESS APPS CONFIGURATION SETTINGS */
/* RECESS FRAMEWORK CONFIGURATION SETTINGS */

Config::$mode = Config::DEVELOPMENT;
Config::$mode = Config::DEVELOPMENT; // Config::PRODUCTION

Config::$useTurboSpeed = false; // I wanna go FAST!
// Paths to the recess and apps directories
Config::$recessDir = $_ENV['dir.documentRoot'] . 'recess/';
Config::$appsDir = $_ENV['dir.documentRoot'] . 'apps/';

Config::$defaultTimeZone = 'America/New_York';

Config::$defaultDataSource
= array( // 'sqlite:' . $_ENV['dir.recess'] . '/data/default.db'
'mysql:host=localhost;dbname=recess', 'recess', 'recess'
);

Config::$cacheProviders
= array( // 'Apc',
// 'Memcache',
// 'Disk'
);

Config::$useTurboSpeed = false; // I wanna go FAST!

Config::$applications
= array( 'recess.apps.ide.RecessIdeApplication',
'blog.BlogApplication'
);

//Config::$plugins
// = array( 'lib.recess.framework.plugins.ContentCaching'
// = array( 'recess.framework.plugins.ContentCaching'
// );

Config::$defaultDataSource
= array( // 'sqlite:' . $_ENV['dir.base'] . '/data/default.db'
'mysql:host=localhost;dbname=recess', 'recess', 'recess'
);


//Config::$namedDataSources
// = array( 'name' => array('dsn'),
// 'name' => array('dsn','user','pass','options')
// );

Config::$settings
= array( 'dir.temp' => $_ENV['dir.base'] . 'temp/',
'dir.test' => $_ENV['dir.base'] . 'test/',
'dir.apps' => $_ENV['dir.base'] . 'apps/'
);

/* END OF BASIC CONFIGURATION SETTINGS */

abstract class Config {

const DEVELOPMENT = 0;
const DEPLOYMENT = 1;
const PRODUCTION = 1;

public static $mode = self::PRODUCTION;

public static $mode = self::DEPLOYMENT;
public static $recessDir = '';

public static $appsDir = '';

public static $useTurboSpeed = false;

Expand All @@ -60,9 +66,18 @@ abstract class Config {

public static $settings = array();

public static $defaultTimeZone = 'America/New_York';

public static $policy;

static function init() {
$_ENV['dir.recess'] = self::$recessDir;
$_ENV['dir.apps'] = self::$appsDir;
$_ENV['dir.test'] = self::$recessDir . 'test/';
$_ENV['dir.temp'] = self::$recessDir . 'temp/';

date_default_timezone_set(self::$defaultTimeZone);

if(self::$useTurboSpeed) {
Library::$useNamedRuns = true;
$cacheProvidersReversed = array_reverse(self::$cacheProviders);
Expand All @@ -72,28 +87,12 @@ static function init() {
}
}

if(isset(self::$settings['dir.temp'])) {
$_ENV['dir.temp'] = self::$settings['dir.temp'];
} else {
$_ENV['dir.temp'] = $_ENV['dir.base'] . 'temp/';
}

if(!isset(self::$settings['dir.test'])) {
$_ENV['dir.test'] = self::$settings['dir.test'];
} else {
$_ENV['dir.test'] = $_ENV['dir.base'] . 'test/';
}

if(!isset(self::$settings['dir.apps'])) {
$_ENV['dir.apps'] = self::$settings['dir.apps'];
} else {
$_ENV['dir.apps'] = $_ENV['dir.base'] . 'apps/';
}
require_once(self::$recessDir . 'lib/recess/Recess.php');

Library::init();
Library::beginNamedRun('recess');

Library::addClassPath(self::$settings['dir.apps']);
Library::addClassPath(self::$appsDir);

// TODO: GET RID OF THIS
Library::import('recess.framework.Application');
Expand Down
1 change: 1 addition & 0 deletions recess/lib/.htaccess
@@ -0,0 +1 @@
deny from all
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -5,7 +5,7 @@
*
* @author Kris Jordan
*/
abstract class RecessClass extends StdClass {
abstract class RecessClass {

protected static $descriptors = array();

Expand Down Expand Up @@ -39,7 +39,9 @@ final function __call($name, $arguments) {
$object = $attachedMethod->object;
$method = $attachedMethod->method;
array_unshift($arguments, $this);
return call_user_method_array($method, $object, $arguments);
$reflectedMethod = new ReflectionMethod($object, $method);
return $reflectedMethod->invokeArgs($object, $arguments);
// return call_user_func_array($method, $object, $arguments);
} else {
throw new RecessException('"' . get_class($this) . '" class does not contain a method or an attached method named "' . $name . '".', get_defined_vars());
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -43,7 +43,11 @@ function getTables() {
* @return array(string) Column names sorted alphabetically.
*/
function getColumns($table) {
$results = $this->pdo->query('SHOW COLUMNS FROM ' . $table . ';');
try {
$results = $this->pdo->query('SHOW COLUMNS FROM ' . $table . ';');
} catch(Exception $e) {
return array();
}

$columns = array();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit eebb58b

Please sign in to comment.