Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tidying
  • Loading branch information
Olivier Laviale committed Oct 29, 2014
1 parent 5dc6f35 commit cf4b3fa
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
@@ -1,4 +1,6 @@
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
build/ export-ignore
tests/ export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
2 changes: 1 addition & 1 deletion assets/icanboogie.js
Expand Up @@ -255,4 +255,4 @@ Element.Properties.dataset = {

return dataset
}
}
}
2 changes: 1 addition & 1 deletion assets/icanboogie.md
Expand Up @@ -34,4 +34,4 @@ Encodes the specified pattern and args as an API route.

### Returns:

(string) A API route.
(string) A API route.
27 changes: 0 additions & 27 deletions bootstrap.php
Expand Up @@ -55,33 +55,6 @@
defined('ICanBoogie\AUTOCONFIG_PATHNAME')
or define('ICanBoogie\AUTOCONFIG_PATHNAME', dirname(__DIR__) . DIRECTORY_SEPARATOR . 'auto-config.php');

/**
* Returns the auto-config.
*
* The path of the auto-config is defined by the {@link AUTOCONFIG_PATHNAME} constant.
*/
function get_autoconfig()
{
static $autoconfig;

if ($autoconfig === null)
{
if (!file_exists(AUTOCONFIG_PATHNAME))
{
trigger_error("The auto-config file has not been generated. Check the `script` section of your composer.json file. https://github.com/ICanBoogie/ICanBoogie#generating-the-auto-config-file", E_USER_ERROR);
}

$autoconfig = require AUTOCONFIG_PATHNAME;

foreach ($autoconfig['filters'] as $filter)
{
call_user_func_array($filter, [ &$autoconfig ]);
}
}

return $autoconfig;
}

register_shutdown_function('ICanBoogie\Debug::shutdown_handler');

require_once ROOT . 'patches.php';
27 changes: 27 additions & 0 deletions helpers.php
Expand Up @@ -15,6 +15,33 @@
* Core
*/

/**
* Returns the auto-config.
*
* The path of the auto-config is defined by the {@link AUTOCONFIG_PATHNAME} constant.
*/
function get_autoconfig()
{
static $autoconfig;

if ($autoconfig === null)
{
if (!file_exists(AUTOCONFIG_PATHNAME))
{
trigger_error("The auto-config file has not been generated. Check the `script` section of your composer.json file. https://github.com/ICanBoogie/ICanBoogie#generating-the-auto-config-file", E_USER_ERROR);
}

$autoconfig = require AUTOCONFIG_PATHNAME;

foreach ($autoconfig['filters'] as $filter)
{
call_user_func_array($filter, [ &$autoconfig ]);
}
}

return $autoconfig;
}

/**
* Instantiates a {@link Core} instance with the auto-config and boots it.
*
Expand Down
1 change: 0 additions & 1 deletion tests/CoreTest.php
Expand Up @@ -87,4 +87,3 @@ public function test_set_timezone()
$this->assertEquals('Europe/Madrid', (string) self::$core->timezone);
}
}

1 change: 0 additions & 1 deletion tests/bootstrap.php
Expand Up @@ -28,4 +28,3 @@
]));

$core->boot();

0 comments on commit cf4b3fa

Please sign in to comment.