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


PHP Publisher::setPostarchiving方法代碼示例

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


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

示例1: urlencode

 function __construct($query, $request_type = 'issn', $sr_api_key = '')
 {
     $query_string = 'versions=all&' . $request_type . '=' . urlencode($query);
     if ($sr_api_key) {
         $query_string .= '&ak=' . $sr_api_key;
     }
     $client = new Zend_HTTP_Client();
     $client->setUri('http://www.sherpa.ac.uk/romeo/api29.php?' . $query_string);
     $response = $client->request();
     if ($response->getStatus() == 200) {
         $sr = $response->getBody();
         $sr_xml = new DOMDocument();
         $sr_xml->loadXML($sr);
         $this->num_hits = $sr_xml->getElementsByTagName('numhits')->item(0)->nodeValue;
         $this->issn = $sr_xml->getElementsByTagName('issn')->item(0)->nodeValue;
         $this->jtitle = $sr_xml->getElementsByTagName('jtitle')->item(0)->nodeValue;
         $pubs = $sr_xml->getElementsByTagName('publisher');
         for ($i = 0; $i < $pubs->length; $i++) {
             $id = $pubs->item($i)->getAttribute('id');
             $name = $pubs->item($i)->getElementsByTagName('name')->item(0)->nodeValue;
             $p = new Publisher($id, $name);
             $p->setPrearchiving($pubs->item($i)->getElementsByTagName('prearchiving')->item(0)->nodeValue);
             $p->setPostarchiving($pubs->item($i)->getElementsByTagName('postarchiving')->item(0)->nodeValue);
             $p->setPdfarchiving($pubs->item($i)->getElementsByTagName('pdfarchiving')->item(0)->nodeValue);
             $prerestrictions_xml = $pubs->item($i)->getElementsByTagName('prerestriction');
             $prerestrictions = array();
             for ($j = 0; $j < $prerestrictions_xml->length; $j++) {
                 $prerestrictions[] = strip_tags(trim($prerestrictions_xml->item($j)->nodeValue));
             }
             $p->setPrerestrictions($prerestrictions);
             $postrestrictions_xml = $pubs->item($i)->getElementsByTagName('postrestriction');
             $postrestrictions = array();
             for ($j = 0; $j < $postrestrictions_xml->length; $j++) {
                 $postrestrictions[] = strip_tags(trim($postrestrictions_xml->item($j)->textContent));
             }
             $p->setPostrestrictions($postrestrictions);
             $pdfrestrictions_xml = $pubs->item($i)->getElementsByTagName('pdfrestriction');
             $pdfrestrictions = array();
             for ($j = 0; $j < $pdfrestrictions_xml->length; $j++) {
                 $pdfrestrictions[] = strip_tags(trim($pdfrestrictions_xml->item($j)->nodeValue));
             }
             $p->setPdfrestrictions($pdfrestrictions);
             $conditions_xml = $pubs->item($i)->getElementsByTagName('condition');
             $conditions = array();
             for ($j = 0; $j < $conditions_xml->length; $j++) {
                 $conditions[] = $conditions_xml->item($j)->nodeValue;
             }
             $p->setConditions($conditions);
             $this->publishers[$id] = $p;
         }
     }
 }
開發者ID:rshanrath,項目名稱:zotero-sherparomeo,代碼行數:52,代碼來源:SherpaRomeo.php


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