/**
  * Instantiates TeleporterContainer and register default teleporters
  *
  * @return TeleporterContainer
  */
 public static function load()
 {
     $container = new static();
     $container['stream-teleporter'] = $container->share(function () {
         return StreamTeleporter::create();
     });
     $container['local-teleporter'] = $container->share(function () {
         return LocalTeleporter::create();
     });
     $container['guzzle-teleporter'] = $container->share(function () {
         return GuzzleTeleporter::create();
     });
     return $container;
 }
Пример #2
0
 /**
  * Instantiates TeleporterContainer and register default teleporters
  *
  * @return TeleporterContainer
  */
 public static function load()
 {
     $container = new static();
     $container['stream-teleporter'] = $container->share(function () {
         return StreamTeleporter::create();
     });
     $container['local-teleporter'] = $container->share(function () {
         return LocalTeleporter::create();
     });
     if (class_exists('Guzzle\\Http\\Client')) {
         $container['guzzle-teleporter'] = $container->share(function () {
             return GuzzleTeleporter::create();
         });
     }
     return $container;
 }
Пример #3
0
 /**
  * Instantiates TeleporterContainer and register default teleporters
  *
  * @return TeleporterContainer
  */
 public static function load()
 {
     $container = new static();
     $container->factories['stream-teleporter'] = function () {
         return StreamTeleporter::create();
     };
     $container->factories['local-teleporter'] = function () {
         return LocalTeleporter::create();
     };
     if (class_exists('GuzzleHttp\\Client')) {
         $container->factories['guzzle-teleporter'] = function () {
             return new GuzzleTeleporter(null, new GuzzleReaderFactory(), new ResourceLocator());
         };
     } elseif (class_exists('Guzzle\\Http\\Client')) {
         $container->factories['guzzle-teleporter'] = function () {
             return new GuzzleTeleporter();
         };
     }
     return $container;
 }
 /**
  * @covers Alchemy\Zippy\Resource\Teleporter\LocalTeleporter::create
  */
 public function testCreate()
 {
     $this->assertInstanceOf('Alchemy\\Zippy\\Resource\\Teleporter\\LocalTeleporter', LocalTeleporter::create());
 }