Beispiel #1
0
 public function run()
 {
     $options = $this->getOptions();
     $proxy = isset($options['proxy']) ? $options['proxy'] : null;
     $connection = new Player_Connect($proxy);
     $validate = new Player_Validate();
     $activation = $validate->getActivation();
     if ($this->getInstall()) {
         if ($this->getDownload()) {
             $this->setPlay();
         } else {
             $this->setDownload($connection);
             $status = Player_Debug::getStatus();
             $this->layout->refresh = 5;
             $this->layout->msg = $status['msg'];
             $this->layout->status = $status['status'];
         }
     } else {
         $this->layout->status = 'Sign in for activate';
         $this->layout->code = $activation;
         $this->setInstall($connection, $validate);
     }
     $this->setScreen();
 }
Beispiel #2
0
 public function getConfig()
 {
     $status = Player_Flags::getFlag('status');
     $player = Player_Flags::getFlag('player');
     $label = Player_Flags::getFlag('label');
     $files = Player_Flags::getFlag('files');
     $path = Player_Flags::getFlag('path');
     $url = Player_Flags::getFlag('url');
     $file = Player_File::getFile($this->getConfigFile());
     $config = Player_Convert::getXML($file, $label['config']);
     $loop = Player_Debug::getStatus();
     if (isset($config[$status['active']])) {
         if (intval($config[$status['active']]) == 1) {
             $params = array($player['id'] => $config[$player['id']]);
             $this->loadConnection($this->getEnvironment(), $url['last'], $params);
             if (!isset($config[$status['download']])) {
                 $config[$status['download']] = 0;
             }
             if ($config[$status['download']] == 0 and $loop['loop'] > 0) {
                 Player_Debug::setDebug('Download stopped. Already downloading via browser.');
                 Player_Debug::saveLog($path['config'] . $files['log']['file']);
                 return false;
             }
             return $this->_options = $config;
         } else {
             Player_Debug::setStatus('Download not finished. Please active the player.');
             Player_Debug::setDebug('Download stopped. The player must be activated.');
             Player_Debug::saveLog($path['config'] . $files['log']['file']);
         }
     }
     return false;
 }