Example #1
0
 public function __construct($_key = null)
 {
     if (!VBox::isExist('Page') && isset($_POST['page_id'])) {
         include_once ENGINE_PATH . 'class/classPage.php';
         $page = new Page($_POST['page_id']);
         $this->lstrings = $page->getLocalStrings();
     }
     $this->db = VBox::get('ConstData')->getConst('langsDb');
     /*
             //#1 for NameApi API  
             
             $array_keys = array(
                         '0b38c46364a919ef3ba2887081286c82-user1', //italiano
                         'bda2473939f5755ff0fbeabdbc033946-user1', //garbagecat76
                         'a950795667d63b9e3d37bcd31f7657b1-user1', //Andrew / andrewtest@rambler.ru / 5w25j3x8
                         'f8284e714c1539a8ebb06ddbb6409ffd-user1', //Svaran
             );
     
             shuffle($array_keys);
             $this->key = $array_keys[0];   
     
             if(isset($_key)){
                 $this->key = $_key;    
             }        
          
             $context = Context::builder()
             ->apiKey($this->key)
             ->priority(Priority::REALTIME())
             //->textCase(TextCase::TITLE_CASE())
             ->build();
     
             if (!isset(self::$service)) {
                 self::$service = new Services\ServiceFactory($context);    
             }            
     
             // ping API service
             $pinger = self::$service->systemServices()->pinger();
             $this->connected = $pinger->ping();   
             //#1 end 
     */
 }