Пример #1
0
 public function testProducerFirst()
 {
     $app = new Core\App();
     $app->link('database', Core\Database::connect());
     $app->link('cachemanager', Core\Cache::init());
     $app->link('success', true);
     Core\Sharer::share('app', $app);
     $test = Core\Sharer::get();
     if ($test['app']->success == true) {
         $this->assertTrue(true);
     } else {
         $this->assertTrue(false);
     }
     $this->assertTrue(true);
     return 'first';
 }
Пример #2
0
|--------------------------------------------------------------------------
|
| Connect the database for only once. Save the planet.
|
*/
$app->link('database', Core\Database::connect());
/*
|--------------------------------------------------------------------------
| Starting the Caching Engine
|--------------------------------------------------------------------------
|
| This is our favourite part. Minimize the resource usage, maximize our
| capabilities.
|
*/
$app->link('cachemanager', Core\Cache::init());
/*
|--------------------------------------------------------------------------
| Share the Singleton $app with the Template Files
|--------------------------------------------------------------------------
|
| Eliminate complexity, get the job done.
|
*/
Core\Sharer::share('app', $app);
/*
|--------------------------------------------------------------------------
| Dispatch the Router
|--------------------------------------------------------------------------
|
| Ta Da! We can see something now!