コード例 #1
0
ファイル: stack.php プロジェクト: LupusMichaelis/horn
 public function __construct()
 {
     parent::__construct('Object');
     $this->providers[] = function () {
         return new h\stack();
     };
 }
コード例 #2
0
ファイル: escaper.php プロジェクト: LupusMichaelis/horn
 public function __construct($message = 'Escaper')
 {
     parent::__construct($message);
     $this->providers[] = function () {
         return new test_escaper(h\string('UTF-8'));
     };
 }
コード例 #3
0
ファイル: date.php プロジェクト: LupusMichaelis/horn
 public function __construct()
 {
     parent::__construct('Date');
     $this->providers[] = function () {
         return new h\collection();
     };
 }
コード例 #4
0
ファイル: sql.php プロジェクト: LupusMichaelis/horn
 public function __construct()
 {
     parent::__construct('Database');
     $dbcon = new \mysqli('localhost', 'test', 'test', 'test');
     $this->providers[] = function () use($dbcon) {
         // I know, this is unsecure
         $forge = new h\sql\forge($dbcon);
         return $forge;
     };
 }
コード例 #5
0
ファイル: object.php プロジェクト: LupusMichaelis/horn
 public function __construct($message = 'Object')
 {
     parent::__construct($message);
     $this->providers[] = function () {
         return new thing_public();
     };
     $this->providers[] = function () {
         return new thing_of();
     };
 }
コード例 #6
0
ファイル: uri_factory.php プロジェクト: LupusMichaelis/horn
 public function __construct($message = 'URL Factory')
 {
     parent::__construct($message);
     $factory = new h\uri\factory();
     $factory->do_register_factory(h\string('a'), new tested_uri_factory($factory));
     $this->providers[] = function () use($factory) {
         $uri = $factory->create(h\string('a:b'));
         return $uri;
     };
 }
コード例 #7
0
ファイル: time.php プロジェクト: LupusMichaelis/horn
 public function __construct($message = 'Time')
 {
     parent::__construct($message);
     //$this->providers[] = function () { return new h\time ; };
     $this->providers[] = function () {
         return h\today();
     };
     $this->providers[] = function () {
         return h\tomorrow();
     };
     $this->providers[] = function () {
         return h\yesterday();
     };
 }