public function __construct()
 {
     if (!function_exists('pcntl_fork')) {
         trigger_error('pcntl extension not loaded!', E_USER_ERROR);
     }
     $this->_log = Config::getLogger();
     $this->_client = new Client();
 }
Example #2
0
 public function login($machineid = null, $secret = null)
 {
     if ($machineid == null) {
         $machineid = Config::get('machineid');
     }
     if ($secret == null) {
         $secret = Config::get('secret');
     }
     return $this->_conn->call('/auth/', 'POST', 'machineid=' . urlencode($machineid) . '&secret=' . urlencode($secret));
 }
 public function execute($options, $arguments)
 {
     $logger = Config::getLogger();
     $pm = new ProcessManager();
     $poudriere = new Poudriere();
     foreach ($poudriere->getAllJails() as $jail) {
         if ($jail->getQueue() === null) {
             $logger->warning('Ignoring Jail ' . $jail->getJailname() . ' because Queue is not defined');
         } else {
             $logger->info('Adding Jail ' . $jail->getJailname() . ' to Queue ' . $jail->getQueue());
             $pm->addJail($jail);
         }
     }
     $pm->run();
 }
 public function execute($options, $arguments, $app)
 {
     $manifest = Config::get('manifest');
     if ($manifest === false) {
         $this->writeln('Manifest URL not defined');
         return 1;
     }
     $this->writeln('Checking for updates ...');
     try {
         $manager = new UpdateManager(Manifest::loadFile($manifest));
         if (Config::get('pubkeyhash') !== false) {
             $manager->setPublicKeyHash(Config::get('pubkeyhash'));
         }
     } catch (FileException $e) {
         $this->writeln('Unable to search for updates');
         return 1;
     }
     if ($manager->update($app->version, true)) {
         $this->writeln('Updated to latest version');
     } else {
         $this->writeln('Already up-to-date');
     }
     return 0;
 }
Example #5
0
 public function __construct($client, $jail)
 {
     $this->_client = $client;
     $this->_jail = $jail;
     $this->_log = Config::getLogger();
 }