當前位置: 首頁>>代碼示例>>PHP>>正文


PHP base::get_sxml_structure方法代碼示例

本文整理匯總了PHP中base::get_sxml_structure方法的典型用法代碼示例。如果您正苦於以下問題:PHP base::get_sxml_structure方法的具體用法?PHP base::get_sxml_structure怎麽用?PHP base::get_sxml_structure使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在base的用法示例。


在下文中一共展示了base::get_sxml_structure方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: apply

 /**
  * {@inheritdoc}
  */
 public function apply(base $databox, Application $app)
 {
     $sql = 'TRUNCATE metadatas';
     $stmt = $databox->get_connection()->prepare($sql);
     $stmt->execute();
     $stmt->closeCursor();
     $sql = 'TRUNCATE metadatas_structure';
     $stmt = $databox->get_connection()->prepare($sql);
     $stmt->execute();
     $stmt->closeCursor();
     $sql = 'TRUNCATE technical_datas';
     $stmt = $databox->get_connection()->prepare($sql);
     $stmt->execute();
     $stmt->closeCursor();
     $phrasea_maps = ['pdftext' => 'Phraseanet:pdftext', 'tf-archivedate' => 'Phraseanet:tf-archivedate', 'tf-atime' => 'Phraseanet:tf-atime', 'tf-chgdocdate' => 'Phraseanet:tf-chgdocdate', 'tf-ctime' => 'Phraseanet:tf-ctime', 'tf-editdate' => 'Phraseanet:tf-editdate', 'tf-mtime' => 'Phraseanet:tf-mtime', 'tf-parentdir' => 'Phraseanet:tf-parentdir', 'tf-bits' => 'Phraseanet:tf-bits', 'tf-channels' => 'Phraseanet:tf-channels', 'tf-extension' => 'Phraseanet:tf-extension', 'tf-filename' => 'Phraseanet:tf-filename', 'tf-filepath' => 'Phraseanet:tf-filepath', 'tf-height' => 'Phraseanet:tf-height', 'tf-mimetype' => 'Phraseanet:tf-mimetype', 'tf-recordid' => 'Phraseanet:tf-recordid', 'tf-size' => 'Phraseanet:tf-size', 'tf-width' => 'Phraseanet:tf-width'];
     $sxe = $databox->get_sxml_structure();
     $dom_struct = $databox->get_dom_structure();
     $xp_struct = $databox->get_xpath_structure();
     foreach ($sxe->description->children() as $fname => $field) {
         $src = trim(isset($field['src']) ? $field['src'] : '');
         if (array_key_exists($src, $phrasea_maps)) {
             $src = $phrasea_maps[$src];
         }
         $nodes = $xp_struct->query('/record/description/' . $fname);
         if ($nodes->length > 0) {
             $node = $nodes->item(0);
             $node->setAttribute('src', $src);
             $node->removeAttribute('meta_id');
         }
     }
     $databox->saveStructure($dom_struct);
     $databox->feed_meta_fields();
     $databox->delete_data_from_cache(databox::CACHE_STRUCTURE);
     $databox->delete_data_from_cache(databox::CACHE_META_STRUCT);
     $conn = $app->getApplicationBox()->get_connection();
     $sql = 'DELETE FROM `task2` WHERE class="readmeta"';
     $stmt = $conn->prepare($sql);
     $stmt->execute();
     $stmt->closeCursor();
     unset($stmt);
     return true;
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:45,代碼來源:320alpha4a.php

示例2: apply

 /**
  * {@inheritdoc}
  */
 public function apply(base $databox, Application $app)
 {
     $sxe = $databox->get_sxml_structure();
     if ($sxe !== false) {
         foreach ($sxe->statbits->bit as $sb) {
             $bit = (int) $sb["n"];
             if ($bit < 4 && $bit > 31) {
                 continue;
             }
             $name = (string) $sb;
             $labelOff = (string) $sb['labelOff'];
             $labelOn = (string) $sb['labelOn'];
             $this->status[$bit]["labeloff"] = $labelOff ?: 'no-' . $name;
             $this->status[$bit]["labelon"] = $labelOn ?: 'ok-' . $name;
         }
     }
     $dom = new \DOMDocument();
     $dom->loadXML($sxe->asXML());
     $databox->saveStructure($dom);
     return true;
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:24,代碼來源:380alpha9a.php


注:本文中的base::get_sxml_structure方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。