/**
  * Command logic
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $org_repo = new Organization(App::getInstance()->resolve(Request::class));
     $org_collection = $org_repo->all();
     foreach ($org_collection as $org) {
         $this->updateOtrs($org, $output);
     }
 }
Esempio n. 2
0
 /**
  * Make a request and retrieve the json response
  *
  * @param $endpoint
  * @param array $params
  *
  * @return array
  * @throws \Exception
  */
 public function get($endpoint, $params = [])
 {
     $url = $this->buildEndpoint($endpoint, $params);
     $result = $this->client->get($url);
     if ($result->getStatusCode() != 200) {
         App::getInstance()->getLogger()->addDebug($url . ' ' . $result->getStatusCode() . ': ' . $result->getBody());
         /**
          * @todo create an new exception
          */
         throw new \Exception('Error during the request...');
     }
     App::getInstance()->getLogger()->addDebug($url . ' ' . $result->getStatusCode() . ': ' . $result->getBody());
     $result = json_decode($result->getBody(), true);
     if (!$result['success']) {
         return [];
     }
     return $result['data'];
 }
Esempio n. 3
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
/**
 * Load all constants...
 */
$dotenv = new Dotenv\Dotenv(__DIR__ . '/../');
$dotenv->load();
/**
 * Start application
 */
$app = \Sync\App::start(new \Lscms\IoC\IoC(), new Symfony\Component\Console\Application(), Sync\Support\Database::getInstance());