Пример #1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     // send Z-Push version and user agent to ZCP >7.2.0
     if ($this->checkMapiExtVersion('7.2.0')) {
         $this->session = mapi_logon_zarafa(USERNAME, PASSWORD, SERVER, CERTIFICATE, CERTIFICATE_PASSWORD, 0, self::VERSION, self::NAME . " " . self::VERSION);
     } else {
         $this->session = mapi_logon_zarafa(USERNAME, PASSWORD, SERVER, CERTIFICATE, CERTIFICATE_PASSWORD, 0);
     }
     if (mapi_last_hresult()) {
         $this->Terminate(sprintf("Kopano: login failed with error code: 0x%08X", mapi_last_hresult()));
     }
     $this->mainUser = USERNAME;
     $this->targetStore = HIDDEN_FOLDERSTORE;
     $this->defaultstore = $this->openMessageStore($this->mainUser);
     $this->store = $this->openMessageStore(HIDDEN_FOLDERSTORE);
     $this->folderCache = array();
     $this->storeCache = array();
     $this->mapiprops = array("chunktype" => "PT_STRING8:PSETID_Appointment:0x6822", "chunkCRC" => "PT_STRING8:PSETID_Appointment:0x8208", "createtime" => "PT_SYSTIME:PSETID_Appointment:0x820d", "updatetime" => "PT_SYSTIME:PSETID_Appointment:0x820e", "reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503", "isrecurring" => "PT_BOOLEAN:PSETID_Appointment:0x8223", "busystatus" => "PT_LONG:PSETID_Appointment:0x8205");
     $this->mapiprops = getPropIdsFromStrings($this->store, $this->mapiprops);
 }
Пример #2
0
//base folder
define('APP_ENV', $_SERVER["APP_ENV"]);
set_include_path('/zserver/php/lib/corelib/' . PATH_SEPARATOR . get_include_path());
set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH . '/Lib');
define('GEN_DIR', 'Zing/Packages/Generator');
define('CAS_DIR', 'Apache/Cassandra');
define('SES_DIR', 'Zing/Packages/Session');
define('XCACHE_DIR', 'Zing/Packages/Xcache');
define('LIB_PACKAGES_DIR', 'Zing/Packages');
define('STDPROFILE_DIR', 'Zing/Packages/stdprofile');
define('EXPROFILE_DIR', 'Zing/Packages/exprofile');
$GLOBALS['THRIFT_ROOT'] = 'Apache/Thrift';
$GLOBALS['GENERATOR_ROOT'] = GEN_DIR;
$GLOBALS['CASSANDRA_ROOT'] = CAS_DIR;
$GLOBALS['SESSION_ROOT'] = SES_DIR;
$GLOBALS['HBASE_ROOT'] = HBASE_DIR;
$GLOBALS['XCACHE_ROOT'] = XCACHE_DIR;
$GLOBALS['LIB_PACKAGES_ROOT'] = LIB_PACKAGES_DIR;
$GLOBALS['STDPROFILE_ROOT'] = STDPROFILE_DIR;
$GLOBALS['EXPROFILE_ROOT'] = EXPROFILE_DIR;
require_once $GLOBALS['THRIFT_ROOT'] . '/Thrift.php';
require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';
require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';
require_once $GLOBALS['THRIFT_ROOT'] . '/transport/THttpClient.php';
require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TBufferedTransport.php';
require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TFramedTransport.php';
require_once "Zend/Loader.php";
require_once BASE_PATH . "/SyncWorker.php";
Zend_Loader::registerAutoload();
$sync_worker = new SyncWorker('./' . APP_ENV . '.global.ini', APP_ENV);
$sync_worker->run();