public function __construct($arg = null)
 {
     if (self::$_server === null) {
         $xs = XS::getLastXS();
         if ($xs === null) {
             throw new XSException('An XS instance should be created before using ' . __CLASS__);
         }
         self::$_server = $xs->getScwsServer();
         self::$_server->setTimeout(0);
         self::$_charset = $xs->getDefaultCharset();
         if (!defined('SCWS_MULTI_NONE')) {
             define('SCWS_MULTI_NONE', 0);
             define('SCWS_MULTI_SHORT', 1);
             define('SCWS_MULTI_DUALITY', 2);
             define('SCWS_MULTI_ZMAIN', 4);
             define('SCWS_MULTI_ZALL', 8);
         }
         if (!defined('SCWS_XDICT_XDB')) {
             define('SCWS_XDICT_XDB', 1);
             define('SCWS_XDICT_MEM', 2);
             define('SCWS_XDICT_TXT', 4);
         }
     }
     if ($arg !== null && $arg !== '') {
         $this->setMulti($arg);
     }
 }
Exemplo n.º 2
0
 public function testLastXS()
 {
     $lastXS = XS::getLastXS();
     $this->assertEquals($this->xs2, $lastXS);
     $this->assertNotEquals($this->xs1, $lastXS);
 }