Example #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';
 }
Example #2
0
|--------------------------------------------------------------------------
|
| Damn Stupid Simple uses the Singleton to simplify coordinations, while
| maintaining only one instantiation of a class.
|
*/
$app = new Core\App();
/*
|--------------------------------------------------------------------------
| Linking to the Database Connector
|--------------------------------------------------------------------------
|
| 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
|--------------------------------------------------------------------------
|