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


PHP umiHierarchy::ignoreSiteMap方法代码示例

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


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

示例1: import_do

 public function import_do()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     $id = getRequest('param0');
     $objects = umiObjectsCollection::getInstance();
     $settings = $objects->getObject($id);
     if (!$settings instanceof umiObject) {
         throw new publicException(getLabel("exchange-err-settings_notfound"));
     }
     $importFile = $settings->file;
     if (!$importFile instanceof umiFile || $importFile->getIsBroken()) {
         throw new publicException(getLabel("exchange-err-importfile"));
     }
     $format_id = $settings->format;
     $importFormat = $objects->getObject($format_id);
     if (!$importFormat instanceof umiObject) {
         throw new publicException(getLabel("exchange-err-format_undefined"));
     }
     $suffix = $importFormat->sid;
     $import_offset = (int) getSession("import_offset_" . $id);
     $blockSize = mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") ? mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") : 25;
     $splitter = umiImportSplitter::get($suffix);
     $splitter->load($importFile->getFilePath(), $blockSize, $import_offset);
     $doc = $splitter->getDocument();
     $dump = $splitter->translate($doc);
     $oldIgnoreSiteMap = umiHierarchy::$ignoreSiteMap;
     umiHierarchy::$ignoreSiteMap = true;
     $importer = new xmlImporter();
     $importer->loadXmlString($dump);
     $elements = $settings->elements;
     if (is_array($elements) && count($elements)) {
         $importer->setDestinationElement($elements[0]);
     }
     $importer->setIgnoreParentGroups($splitter->ignoreParentGroups);
     $importer->setAutoGuideCreation($splitter->autoGuideCreation);
     $importer->setRenameFiles($splitter->getRenameFiles());
     $importer->execute();
     umiHierarchy::$ignoreSiteMap = $oldIgnoreSiteMap;
     $_SESSION["import_offset_" . $id] = $splitter->getOffset();
     if ($splitter->getIsComplete()) {
         unset($_SESSION["import_offset_" . $id]);
     }
     $data = array("attribute:complete" => (int) $splitter->getIsComplete(), "attribute:created" => $importer->created_elements, "attribute:updated" => $importer->updated_elements, "attribute:deleted" => $importer->deleted_elements, "attribute:errors" => $importer->import_errors, "nodes:log" => $importer->getImportLog());
     $this->setData($data);
     return $this->doData();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:47,代码来源:__import.php

示例2: importCommerceML

 protected function importCommerceML()
 {
     $file_name = getRequest('filename');
     $file_path = self::$importDirectory . $file_name;
     if (!is_file($file_path)) {
         return "failure\nFile {$file_path} not exists.";
     }
     $import_offset = (int) getSession("1c_import_offset");
     $blockSize = (int) mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit");
     if ($blockSize < 0) {
         $blockSize = 25;
     }
     $splitterName = (string) mainConfiguration::getInstance()->get("modules", "exchange.commerceML.splitter");
     if (!trim(strlen($splitterName))) {
         $splitterName = "commerceML2";
     }
     $splitter = umiImportSplitter::get($splitterName);
     $splitter->load($file_path, $blockSize, $import_offset);
     $doc = $splitter->getDocument();
     $xml = $splitter->translate($doc);
     $oldIgnoreSiteMap = umiHierarchy::$ignoreSiteMap;
     umiHierarchy::$ignoreSiteMap = true;
     $importer = new xmlImporter();
     $importer->loadXmlString($xml);
     $importer->setIgnoreParentGroups($splitter->ignoreParentGroups);
     $importer->setAutoGuideCreation($splitter->autoGuideCreation);
     $importer->setRenameFiles($splitter->getRenameFiles());
     $importer->execute();
     umiHierarchy::$ignoreSiteMap = $oldIgnoreSiteMap;
     $_SESSION['1c_import_offset'] = $splitter->getOffset();
     if ($splitter->getIsComplete()) {
         $_SESSION['1c_import_offset'] = 0;
         return "success\nComplete. Imported elements: " . $splitter->getOffset();
     }
     return "progress\nImported elements: " . $splitter->getOffset();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:36,代码来源:__auto.php


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