Skip to content

Commit

Permalink
Directory restructuring for 0.20 release to make room for plug-ins.
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisJordan committed Mar 25, 2009
1 parent 91adf53 commit 7a99efe
Show file tree
Hide file tree
Showing 171 changed files with 40 additions and 29 deletions.
16 changes: 10 additions & 6 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ abstract class RecessConf {

public static $recessDir = '';

public static $pluginsDir = '';

public static $appsDir = '';

public static $dataDir = '';

public static $useTurboSpeed = false;

public static $cacheProviders = array();
Expand All @@ -60,17 +64,19 @@ static function init() {

$_ENV['dir.recess'] = self::$recessDir;
$_ENV['dir.apps'] = self::$appsDir;
$_ENV['dir.temp'] = self::$dataDir . 'temp/';
$_ENV['dir.test'] = self::$recessDir . 'test/';
$_ENV['dir.temp'] = self::$recessDir . 'temp/';
$_ENV['dir.lib'] = self::$recessDir . 'lib/';

if(!isset($_ENV['url.content'])) {
$_ENV['url.content'] = $_ENV['url.base'] . 'content/';
}

date_default_timezone_set(self::$defaultTimeZone);

require_once($_ENV['dir.lib'] . 'recess/lang/Library.class.php');
Library::addClassPath($_ENV['dir.lib']);
require_once($_ENV['dir.recess'] . 'recess/lang/Library.class.php');
Library::addClassPath(self::$appsDir);
Library::addClassPath(self::$pluginsDir);
Library::addClassPath(self::$recessDir);

if(self::$useTurboSpeed) {
Library::$useNamedRuns = true;
Expand All @@ -84,8 +90,6 @@ static function init() {
Library::init();
Library::beginNamedRun('recess');

Library::addClassPath(self::$appsDir);

Library::import('recess.framework.Application');
foreach(self::$applications as $key => $app) {
if(!Library::classExists($app)) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 17 additions & 10 deletions recess-conf.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?php if(isset($bootstrapped)) unset($bootstrapped); else exit;
/**
* Welcome to Recess Let's have some fun.
*
* Recess is full-stack, PHP application development framework.
* For tutorials, documentation, bug reports, feature suggestions
* head over to:
/*
* Welcome to the Recess PHP Framework. Let's have some fun!
*
* For tutorials, documentation, bug reports, feature suggestions:
* http://www.recessframework.org/
*
* Enjoy! -Kris Jordan (http://www.krisjordan.com)
* Join the Recess developer community:
* + IRC: irc.freenode.net #recess
* + Mailing List: http://groups.google.com/group/recess-framework
* + Github: http://github.com/recess/recess/
* + Forum: http://www.recessframework.org/
* + Twitter: http://twitter.com/RecessFramework
*
* Enjoy! -Kris (http://twitter.com/KrisJordan)
*/

// RecessConf::DEVELOPMENT or RecessConf::PRODUCTION
Expand All @@ -22,18 +26,21 @@
RecessConf::$defaultTimeZone = 'America/New_York';

RecessConf::$defaultDatabase
= array( //'sqlite:' . $_ENV['dir.bootstrap'] . 'recess/sqlite/default.db'
= array( //'sqlite:' . $_ENV['dir.bootstrap'] . 'data/sqlite/default.db'
//'mysql:host=localhost;dbname=DBNAME', 'USER', 'PASS'
);

RecessConf::$namedDatabases
= array( // 'nameFoo' => array('sqlite:' . $_ENV['dir.bootstrap'] . 'recess/sqlite/default.db')
= array( // 'nameFoo' => array('sqlite:' . $_ENV['dir.bootstrap'] . 'data/sqlite/default.db')
// 'nameBar' => array('mysql:host=localhost;dbname=recess', 'username', 'password')
);

// Paths to the recess and apps directories
// Paths to the recess, plugins, and apps directories
RecessConf::$recessDir = $_ENV['dir.bootstrap'] . 'recess/';
RecessConf::$pluginsDir = $_ENV['dir.bootstrap'] . 'plugins/';
RecessConf::$appsDir = $_ENV['dir.bootstrap'] . 'apps/';
RecessConf::$dataDir = $_ENV['dir.bootstrap'] . 'data/';


// Cache providers are only enabled during DEPLOYMENT mode.
// Always use at least the Sqlite cache.
Expand Down
1 change: 1 addition & 0 deletions recess/recess/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public function __construct() {

$this->name = 'Recess Tools';

$this->viewsDir = $_ENV['dir.lib'] . 'recess/apps/tools/views/';
$this->viewsDir = $_ENV['dir.recess'] . 'recess/apps/tools/views/';

$this->codeTemplatesDir = $_ENV['dir.lib'] . 'recess/apps/tools/templates/';
$this->codeTemplatesDir = $_ENV['dir.recess'] . 'recess/apps/tools/templates/';

$this->modelsPrefix = 'recess.apps.tools.models.';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function generateModel($app) {

$app = new $app;
if(strpos($app->modelsPrefix,'recess.apps.') !== false) {
$base = $_ENV['dir.lib'];
$base = $_ENV['dir.recess'];
} else {
$base = $_ENV['dir.apps'];
}
Expand Down Expand Up @@ -286,7 +286,7 @@ public function generateModel($app) {
public function generateScaffolding($app, $model) {
$app = new $app;
if(strpos($app->controllersPrefix,'recess.apps.') !== false) {
$base = $_ENV['dir.lib'];
$base = $_ENV['dir.recess'];
} else {
$base = $_ENV['dir.apps'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function checkTables() {

protected function checkIndex() {
$this->recursiveIndex($_ENV['dir.apps']);
$this->recursiveIndex($_ENV['dir.lib']);
$this->recursiveIndex($_ENV['dir.recess']);
}

/** !Route GET */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function getControllerFor(Request &$request, array $applications, RtNode
throw new RecessResponseException('METHOD not supported, supported METHODs are: ' . implode(',', $routeResult->acceptableMethods), ResponseCodes::HTTP_METHOD_NOT_ALLOWED, get_defined_vars());
}
} else {
print_r($routes);exit;
throw new RecessResponseException('Resource does not exist.', ResponseCodes::HTTP_NOT_FOUND, get_defined_vars());
}

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.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
require_once($_ENV['dir.lib'] . 'recess/diagnostics/Diagnostics.class.php');
require_once($_ENV['dir.lib'] . 'recess/cache/Cache.class.php');
require_once($_ENV['dir.recess'] . 'recess/diagnostics/Diagnostics.class.php');
require_once($_ENV['dir.recess'] . 'recess/cache/Cache.class.php');

/**
* Library is an important low level utility in Recess used to make importing class files
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions recess/test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
$_ENV['url.base'] = str_replace('AllTests.php', '', $_SERVER['PHP_SELF']);

$_ENV['dir.recess'] = $_ENV['dir.bootstrap'] . 'recess/';
$_ENV['dir.plugins'] = $_ENV['dir.bootstrap'] . 'plugins/';
$_ENV['dir.apps'] = $_ENV['dir.bootstrap'] . 'apps/';
$_ENV['dir.test'] = $_ENV['dir.recess'] . 'test/';
$_ENV['dir.temp'] = $_ENV['dir.recess'] . 'temp/';
$_ENV['dir.lib'] = $_ENV['dir.recess'] . 'lib/';
$_ENV['dir.test'] = $_ENV['dir.bootstrap'] . 'data/test/';
$_ENV['dir.temp'] = $_ENV['dir.bootstrap'] . 'data/temp/';
$_ENV['url.content'] = $_ENV['url.base'] . 'content/';

require_once($_ENV['dir.lib'] . 'recess/lang/Library.class.php');
Library::addClassPath($_ENV['dir.lib']);
require_once($_ENV['dir.recess'] . 'recess/lang/Library.class.php');
Library::addClassPath($_ENV['dir.recess']);

?>

0 comments on commit 7a99efe

Please sign in to comment.