当前位置: 首页>>代码示例>>PHP>>正文


PHP Errors::LogSynchroStep方法代码示例

本文整理汇总了PHP中Errors::LogSynchroStep方法的典型用法代码示例。如果您正苦于以下问题:PHP Errors::LogSynchroStep方法的具体用法?PHP Errors::LogSynchroStep怎么用?PHP Errors::LogSynchroStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Errors的用法示例。


在下文中一共展示了Errors::LogSynchroStep方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: VerifyOffers

 /**
  * Verifies offers
  * @return int[]
  */
 public static function VerifyOffers()
 {
     $list = array();
     $xml = new XMLReader();
     $domdoc = new DOMDocument();
     $xml->open(WebServiceVirgo::TMP_XML_OFELIST_FILE);
     Errors::LogSynchroStep('Offers - VerifyOffers() - step 1');
     $xml->read();
     while ($xml->name) {
         if ($xml->name == 'Oferta') {
             $node = simplexml_import_dom($domdoc->importNode($xml->expand(), true));
             $list[] = (int) $node["ID"];
         }
         $xml->read();
     }
     Errors::LogSynchroStep('Offers - VerifyOffers() - step 2');
     $db = DataBase::GetDbInstance();
     $query = "SELECT DISTINCT(id) FROM #S#offers o";
     $result = $db->ExecuteQuery($query);
     $ofrs = new Offers();
     //delete wrong offers
     $localOffs = array();
     $flippedList = array_flip($list);
     while ($row = $db->FetchArray($result)) {
         if (!isset($flippedList[$row[0]])) {
             $ofrs->DeleteOffer($row[0]);
         } else {
             $localOffs[] = $row[0];
         }
     }
     //detect missing offers
     $braki = array();
     $flippedLocalOffs = array_flip($localOffs);
     foreach ($list as $id) {
         if (!isset($flippedLocalOffs[$id])) {
             $braki[] = $id;
         }
     }
     Errors::LogSynchroStep('Offers - VerifyOffers() - step 3');
     return $braki;
 }
开发者ID:uirapuru,项目名称:virgoapi,代码行数:45,代码来源:offers.class.php

示例2: GetOffersPartial

 /**
  * Get a list of offers to be added or remove. Write the offers to the database.
  * @param boolean $archive
  * @param string &$log
  * @param array &$count_arr
  * @return null|int|array
  * @throws Exception 
  */
 private function GetOffersPartial($archive, &$log, &$count_arr)
 {
     Errors::LogSynchroStep('WebServiceVirgo - GetOffersPartial() start...');
     if (!$this->WS()) {
         Errors::LogSynchroStep('WebServiceVirgo - NO WEBSERVICE');
         return null;
     }
     try {
         $log .= "archive=" . (int) $archive . "\n";
         $time_start = microtime_float();
         if ($this->_sid == "") {
             return;
         }
         $params = array('sid' => $this->_sid);
         if ($archive) {
             $result = $this->WS()->getSC()->__soapCall("GetOffersArchive", array($params));
             $buf = $result->GetOffersArchiveResult->OffersZip;
             $status = $result->GetOffersArchiveResult->Status;
             $msg = $result->GetOffersArchiveResult->Message;
         } else {
             $result = $this->WS()->getSC()->__soapCall("GetOffers", array($params));
             $buf = $result->GetOffersResult->OffersZip;
             $status = $result->GetOffersResult->Status;
             $msg = $result->GetOffersResult->Message;
         }
         $time_end = microtime_float();
         $time = $time_end - $time_start;
         if ($this->_DEBUG) {
             echo "SOAP Call execution time: {$time} seconds<br>";
         }
         if ($status != 0) {
             throw new Exception($msg);
         }
         $zip_file = $archive ? self::TMP_ZIP_ARCH_FILE : self::TMP_ZIP_FILE;
         $f = fopen($zip_file, "w");
         fwrite($f, $buf);
         fclose($f);
         $time_end2 = microtime_float();
         $time = $time_end2 - $time_end;
         if ($this->_DEBUG) {
             echo "Save ZIP execution time: {$time} seconds<br>";
         }
         //unzip XML file with offers
         $contents = "";
         $zip = new ZipArchive();
         if ($zip->open($zip_file)) {
             $fp = $zip->getStream('xml.xml');
             if (!$fp) {
                 exit("failed reading xml file (" . getcwd() . "), probably invalid permissions to folder\n");
             }
             $contents = '';
             while (!feof($fp)) {
                 $contents .= fread($fp, 1024);
             }
             fclose($fp);
             $zip->close();
             $xml_file = $archive ? self::TMP_XML_OFE_ARCH_FILE : self::TMP_XML_OFE_FILE;
             file_put_contents($xml_file, $contents);
             if (file_exists($zip_file)) {
                 unlink($zip_file);
             }
         }
         $time_end3 = microtime_float();
         $time = $time_end3 - $time_end2;
         if ($this->_DEBUG) {
             echo "Save XML execution time: {$time} seconds<br>";
         }
         $times = array("read_props" => 0, "save" => 0, "del_props" => 0, "rooms" => 0, "del_offers" => 0, "rooms_del" => 0, "photos" => 0);
         $prevOfferId = "0";
         $content = file_get_contents($xml_file);
         //$content = preg_replace("/<UwagiOpis>([^\<\>]*)\<\/UwagiOpis>/m", "<UwagiOpis><![CDATA[$1]]></UwagiOpis>", $content);
         //$content = preg_replace("/<UwagiNieruchomosc>([^\<\>]*)\<\/UwagiNieruchomosc>/m", "<UwagiNieruchomosc><![CDATA[$1]]></UwagiNieruchomosc>", $content);
         $fp = fopen($xml_file, 'w');
         fwrite($fp, $content);
         fclose($fp);
         //open and read XML file
         $xml2 = new XMLReader();
         $xml2->open($xml_file);
         $domdoc = new DOMDocument();
         $ids_do_usuniecia_dodania = array();
         $all_agents_ids = array();
         $all_dept_ids = array();
         $blokuj_agentow = true;
         $blokuj_oddzialy = true;
         $time_end4 = microtime_float();
         $time = $time_end4 - $time_end3;
         if ($this->_DEBUG) {
             echo "Load XML execution time: {$time} seconds<br>";
         }
         $xml2->read();
         while ($xml2->name) {
             //Departments
//.........这里部分代码省略.........
开发者ID:uirapuru,项目名称:virgoapi,代码行数:101,代码来源:webservice.class.php

示例3: GetOffersList

 /**
  * Get list of actual offer on web site.
  * @param bool $skipLogin Skips WS login procedure.
  * @return string
  */
 public function GetOffersList($skipLogin = false)
 {
     try {
         if (!$skipLogin) {
             WebServiceVirgo::WS()->LoginEx();
         }
         $ret = WebServiceVirgo::WS()->GetOffersList();
         if (!$skipLogin) {
             WebServiceVirgo::WS()->Logout();
         }
         Errors::LogSynchroStep('VirgoApi - GetOffersList() - done');
         return $ret;
     } catch (Exception $ex) {
         Errors::LogError("VirgoAPI:GetOfferList", $ex->getMessage());
         return "ERROR";
     }
 }
开发者ID:uirapuru,项目名称:virgoapi,代码行数:22,代码来源:virgoapi.class.php


注:本文中的Errors::LogSynchroStep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。