コード例 #1
0
ファイル: joopoa.helper.php プロジェクト: LMSeXT/com_joopoa
 /**
  * Retorna a biblioteca SAWEE Client.
  */
 public static function getSaweeWSClientLib()
 {
     $basedir = JPATH_JOOPOA_LIBRARIES . DS . 'SAWEE_ws_client' . DS;
     $sawee_lib_client_path_lib = $basedir . 'lib' . DS;
     $sawee_lib_client = 'sawee_ws_client.php';
     $sawee_lib_client_path = $sawee_lib_client_path_lib . $sawee_lib_client;
     require $sawee_lib_client_path;
     //Constroe a configuração par auso no singleton do SAWEE_WS_Client
     $config = array();
     $config['BaseDir'] = $sawee_lib_client_path_lib;
     $params = JComponentHelper::getParams('com_joopoa');
     //TODO CONFIGURAR WS HOST E WS PATH conforme obtido no Componente
     // em versões futuras deverão ser feitas verificações se a configuração
     // já foi realizada.
     $config['Host'] = $params->getParam('host_sawee');
     $config['Path'] = $params->getParam('path_sw_sawee');
     // Trantando a exception como manda o Joomla melhora a depuração.
     try {
         $sawee = SAWEE_WS_Client::getInstance($config);
     } catch (Exception $e) {
         jexit($e);
     }
     return $sawee;
 }
コード例 #2
0
 public static function discardInstance($config)
 {
     if (JDEBUG) {
         dump($config, "Config");
     }
     if (!empty(self::$instance)) {
         self::$instance = null;
     }
     return self::$instance;
 }