Skip to content

Commit

Permalink
adjustments to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
isocroft committed Jul 5, 2017
1 parent a56df2f commit 0948e15
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ _Thanks to **Micheal Akpobome**, **Shuaib Afegbua**, **Abraham Yusuf**, **Dimgba

>Before you attempt to startup Jollof, please ensure you machine meets the below requirements
* Have the PHP executable (php.exe, php.dmg) file path exposed in the environmental variable _PATH_
* Have the PHP executable (binary) file path exposed in the environmental variable _PATH_

* Have PHP v5.3.8 and above installed and also enable all PHP extension below marked as **required**

Expand Down
2 changes: 1 addition & 1 deletion documentation/getting-started/app-lifecycle.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h2 class=""><i class="ink-icon">§</i><b>Routes Setup</b></h2>
Subsquently, all application routes are loaded up and stored in a routes table from where the current route is determined. Each defined route have several properties that go along with it. These properties serve as some form of filters for them and when any filter fails, request handling is terminated in an fatal error.
</p>
<p>
The properties include the <b class="bg-primary">verb</b>, the <b class="bg-primary">models</b>, the <b class="bg-primary">params</b> and the <b class="bg-primary">ajax</b> property. The <kbd>verb</kbd> property serves to dictate the HTTP method that will be used for accessing the route (e.g PUT, GET, HEAD, POST, DELETE). The <kbd>models</kbd> property is an array of model classes to to be instatiated for use in the controller. The <kbd>params</kbd> property is an array of route parameter names and the regular expressions used to validate them. Finally, the <kbd>ajax</kbd> property is a flag to dictate when the route is to be accessed via <i class="text-success">AJAX</i> or not.
The properties include the <b class="bg-primary">verb</b> property, the <b class="bg-primary">inject</b> property, the <b class="bg-primary">params</b> property and the <b class="bg-primary">ajax</b> property. The <kbd>verb</kbd> property serves to dictate the HTTP method that will be used for accessing the route (e.g PUT, GET, HEAD, POST, DELETE). The <kbd>inject</kbd> property is an array of injected dependencies (class objects) for use in the controller. The <kbd>params</kbd> property is an array of route parameter names and the regular expressions used to validate them. Finally, the <kbd>ajax</kbd> property is a flag to dictate when the route is to be accessed via <i class="text-success">AJAX</i> or not.
</p>
<p>
Routes are created using the <samp class="bg-warning">::bind( ... );</samp> method of the <kbd>Router</kbd> component. See <a href="../apis/components.html#router">Router Component reference</a> for more details.
Expand Down
10 changes: 6 additions & 4 deletions jollof
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,25 @@
*
*/

require_once 'system/boot.php';
require_once 'app.php';

$model_path = __DIR__ . '/models/';
# require_once __DIR__ . '/system/routes/setup.php';

$migrations_path = __DIR__ . '/storage/migrations/';
$model_path = __DIR__ . '/models/';

$ctrl_path = __DIR__ . '/controllers/';

$views_path = __DIR__ . '/views/';

$migrations_path = __DIR__ . '/storage/migrations/';

$tests_path = __DIR__ . '/system/tests/';

$route_path = __DIR__ . '/system/routes/setup.php';

$class_maps_path = __DIR__ . '/system/base/';

$args = $_SERVER['argv'];
$args = $_SERVER['argv'];

$promptList = NULL;

Expand Down
2 changes: 1 addition & 1 deletion packages/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require":{
"php": ">=5.3.0"
"php": ">=5.3.8"
},
"require-dev": {
"mockery/mockery":"0.9.*",
Expand Down
10 changes: 7 additions & 3 deletions system/base/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,16 @@ function fix_integer_overflow($size) {
}

if(! function_exists('index_of') ){
function index_of($str, $seed, $radix = -1){
function index_of($str, $seed, $radix = -1){
$mixed = FALSE;
if($radix == -1){
$mixed = strpos($str, $seed);
if(!empty($seed)){
$mixed = strpos($str, $seed);
}
}else if($radix > -1){
$mixed = strpos($str, $seed, $radix);
if(!empty($seed)){
$mixed = strpos($str, $seed, $radix);
}
}

return (gettype($mixed) === 'integer')? $mixed : -1;
Expand Down
31 changes: 20 additions & 11 deletions system/base/providers/Core/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function __construct(){

$this->jheaders = new JollofSecureHeaders();

$this->os = \get_os();
$this->os = get_os();
}

$this->instances = array();
Expand Down Expand Up @@ -284,18 +284,24 @@ public function initHTTPResolver(){

$request = $this->getInstance('Request');

$session = $this->getInstance('Session');
$session = $this->getInstance('Session')->getDriver();

if($router->getMethod() == 'GET'
$resolved = $this->resolver->handleCurrentRoute($router, $system, $auth);

if($request->getMethod() === 'GET'
&& !$request->ajaxRequest()){

$session->getDriver()->write(
'previousRoute',
$router->getCurrentRouteUrl()
);
$rl = $router->getCurrentRouteUrl();

if($session->read('previousRoute') !== $rl){
$session->write(
'previousRoute',
$rl
);
}
}

return $this->resolver->handleCurrentRoute($router, $system, $auth);
return $resolved;

}

Expand Down Expand Up @@ -421,8 +427,11 @@ public function registerCoreComponents(){
/*
* set up config for Content-Security-Policy HTTP response headers
*/
if(!$this->inCLIMode()){

$this->jheaders->installConfig($this->envservice->getConfig("app_security"));
$this->jheaders->installConfig($this->envservice->getConfig("app_security"));

}

/*
* Setup all Singletons for the application
Expand All @@ -438,7 +447,7 @@ public function registerCoreComponents(){
$this->instances['System'] = System::createInstance($this->getInstance('Config'));
$this->instances['Session'] = Session::createInstance($this->envservice->getConfig('app_session'));
$this->instances['Request'] = Request::createInstance($this->envservice->getConfig('app_uploads'), $this->getInstance('Session'));
$this->instances['Response'] = Response::createInstance($this->jheaders->getSourceNonces());
$this->instances['Response'] = Response::createInstance($this->inCLIMode()? array() : $this->jheaders->getSourceNonces());
$this->instances['Router'] = Router::createInstance($this->getInstance('Request'), $this->getInstance('Response'));
$this->instances['Cache'] = Cache::createInstance($this->envservice->getConfig('app_cache'));
$this->instances['Validator'] = Validator::createInstance();
Expand All @@ -448,7 +457,7 @@ public function registerCoreComponents(){
$this->instances['Comms'] = Comms::createInstance($this->envservice->getConfig('app_mails'), $this->envservice->getConfig('app_connection'), $this->envservice->getConfig('app_messaging'));
$this->instances['TextStream'] = TextStream::createInstance();

if(File::exists($dotenv)){
if(file_exists($dotenv)){

$this->dbservice->connect($dotenv);
}
Expand Down

0 comments on commit 0948e15

Please sign in to comment.