Пример #1
0
 /**
  * @param string $apiUrl
  * @param null $apiKey
  */
 public function __construct($apiUrl, $apiKey = null)
 {
     $this->color = new Color();
     $this->apiUrl = $apiUrl;
     // skip while unit tests
     if (defined('RESULTS_DIR')) {
         $this->resultsDir = CKANMNGR_RESULTS_DIR;
         echo $this->color->magenta("API URL:") . ' ' . $this->color->bold($apiUrl) . PHP_EOL . PHP_EOL;
         //            letting user cancel (Ctrl+C) script if noticed wrong api url
         sleep(3);
     }
     $this->setCkan(new CkanClient($apiUrl, $apiKey));
 }