コード例 #1
0
ファイル: Maestrano.php プロジェクト: maestrano/maestrano-php
 /**
  * Method to fetch config from the dev-platform
  * @param $configFile String: dev-platform configuration file
  */
 public static function autoConfigure($configFile = null)
 {
     Maestrano_Config_Client::with('dev-platform')->configure($configFile);
     Maestrano_Config_Client::with('dev-platform')->loadMarketplacesConfig();
 }
コード例 #2
0
 public function testLoadMultipleMarketplaces()
 {
     $fromServer = json_decode('[
         {
           "marketplace": "maestrano-uat",
           "environment": "local",
           "app": {
             "host": "http://php-demoapp.maestrano.io"
           },
           "api": {
             "id": "e30ac587-54ee-429d-92ff-66efdd1abf32",
             "key": "6z3KsJaDfyFZ3VNTxIVzEg"
           }
         },
         {
           "marketplace": "maestrano-prod",
           "environment": "local",
           "app": {
             "host": "http://php-demoapp.maestrano.io"
           },
           "api": {
             "id": "e30ac587-54ee-429d-92ff-66efdd1abf32",
             "key": "6z3KsJaDfyFZ3VNTxIVzEg"
           }
         }
       ]', true);
     Maestrano_Config_Client::loadMultipleMarketplaces($fromServer);
     $this->assertEquals(Maestrano::with('maestrano-uat')->param('environment'), 'local');
     $this->assertEquals(Maestrano::with('maestrano-prod')->param('environment'), 'local');
 }