-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.require_fallback.php
40 lines (30 loc) · 1.07 KB
/
index.require_fallback.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
## Access Application From Anywhere any Time
#
namespace Poirot
{
use IOC;
use Poirot as P;
use Poirot\Ioc\Container;
if (! defined('FALLBACK_REQUIRED_POIROT') )
// Only Access From Fallback Call Inside Poirot Skeleton
die();
( !defined('PHP_VERSION_ID') or PHP_VERSION_ID < 50306 )
&& exit('Needs at least PHP5.3; your current php version is ' . phpversion() . '.');
// Application Consistencies and AutoLoad:
// as separated file to used from 3rd party applications
require_once __DIR__.'/index.consist.php';
## start application:
#
$servicesConf = P\Std\Type\StdString::safeJoin(DS, PT_DIR_CONFIG, 'services');
if ( false === $config = \Poirot\Config\load($servicesConf) )
throw new \Exception(sprintf(
'Cant Load IoC Services from config (%s)'
, $servicesConf
));
$IoC = new Container( new Container\BuildContainer($config) );
IOC::GiveIoC($IoC);
/** @var P\Application\Sapi $application */
$application = IOC::Sapi();
return $application;
}