本文整理汇总了PHP中Record::unserializeFromString方法的典型用法代码示例。如果您正苦于以下问题:PHP Record::unserializeFromString方法的具体用法?PHP Record::unserializeFromString怎么用?PHP Record::unserializeFromString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record::unserializeFromString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_facic_title
/**
* Smarty {facic_title} function plugin
*
* Type: function<br>
* Name: facic_title<br>
* Input:<br>
* - title (required) - array of title of the facic data
* Purpose: Print the Title name relateda one collection of facic
* @author Domingos Teruel <domingos.teruel@terra.com.br>
* @param array
* @param Smarty
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_facic_title($params, &$smarty)
{
global $BVS_CONF, $configurator, $isisBroker, $FACIC_TAG_NAME;
$xmlparameters = "<parameters>\n";
$xmlparameters .= "<database>" . $configurator->getPath2title() . "</database>\n";
//Used when has search
$xmlparameters .= "<search>I={$params['title']}</search>\n";
$xmlparameters .= "<from>1</from>\n";
$xmlparameters .= "<count>1</count>\n";
$xmlparameters .= "<gizmo>GIZMO_XML</gizmo>\n";
$xmlparameters .= "<xml_header>yes</xml_header>\n";
$xmlparameters .= "<reverse>Off</reverse>\n";
$xmlparameters .= "</parameters>\n";
if (isset($_REQUEST["title"]) && $_REQUEST["title"] != "") {
$rawxml = $isisBroker->search($xmlparameters);
} else {
user_error("Pesquisa Invalida, Sem Título para pesquisar");
}
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
$recordList = null;
$i = 0;
while ($posicion1 > 0) {
$elemento = substr($rawxml, $posicion1, $posicion2 - $posicion1 + 9);
$record = new Record();
$record->unserializeFromString($elemento);
$tempField = $record->campos;
$tempRecord = array();
while (list($key, $val) = each($tempField)) {
if (array_key_exists($tempField[$key]->tag, $tempRecord)) {
$varTemp = $tempRecord[$tempField[$key]->tag];
$tempRecord[$tempField[$key]->tag] = array_merge($varTemp, $tempField[$key]->contenido);
} else {
$tempRecord += array($tempField[$key]->tag => $tempField[$key]->contenido);
}
}
$tempRecord += array("mfn" => $record->getMfn());
ksort($tempRecord);
$recordList[] = $tempRecord;
//array_push($recordList,$tempRecord);
$tempRecord = null;
$rawxml = substr($rawxml, $posicion2 + 1);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
}
return $recordList[0][100];
}
示例2: setIndex
function setIndex()
{
global $configurator, $isisBroker, $MASK_TAG_NAME;
$xmlparameters = "<parameters>\n";
$xmlparameters .= "<database>" . $configurator->getPath2Mask() . "</database>\n";
$xmlparameters .= "<from>A</from>\n";
$xmlparameters .= "<to>ZZZZZZ</to>\n";
$xmlparameters .= "<posting>All</posting>\n";
$xmlparameters .= "<count>20</count>\n";
$xmlparameters .= "<reverse>Off</reverse>\n";
$xmlparameters .= "</parameters>";
$rawxml = $isisBroker->index($xmlparameters);
$posicion1 = strpos($rawxml, "<term");
$posicion2 = strpos($rawxml, "</term>");
$recordList = null;
$i = 0;
while ($posicion1 > 0) {
$elemento = substr($rawxml, $posicion1, $posicion2 - $posicion1 + 9);
$record = new Record();
$record->unserializeFromString($elemento);
$tempField = $record->campos;
$tempRecord = array();
while (list($key, $val) = each($tempField)) {
if (array_key_exists($tempField[$key]->tag, $tempRecord)) {
$varTemp = $tempRecord[$tempField[$key]->tag];
$tempRecord[$tempField[$key]->tag] = array_merge($varTemp, $tempField[$key]->contenido);
} else {
$tempRecord += array($tempField[$key]->tag => $tempField[$key]->contenido);
}
}
$tempRecord += array("mfn" => $record->getMfn());
ksort($tempRecord);
$recordList[] = $tempRecord;
//array_push($recordList,$tempRecord);
$tempRecord = null;
$rawxml = substr($rawxml, $posicion2 + 1);
$posicion1 = strpos($rawxml, "<term");
$posicion2 = strpos($rawxml, "</term>");
}
return $recordList;
}
示例3: setAllHoldings
function setAllHoldings()
{
global $BVS_CONF, $configurator, $isisBroker, $HOLDING_TAG_NAME;
$xmlparameters = "<parameters>\n";
$xmlparameters .= "<database>" . $configurator->getPath2Holdings() . "</database>\n";
$xmlparameters .= "<gizmo>GIZMO_XML</gizmo>\n";
$xmlparameters .= "<xml_header>yes</xml_header>\n";
$xmlparameters .= "<reverse>Off</reverse>\n";
$xmlparameters .= "</parameters>\n";
$rawxml = $isisBroker->listar($xmlparameters);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
$recordList = null;
$i = 0;
while ($posicion1 > 0) {
$elemento = substr($rawxml, $posicion1, $posicion2 - $posicion1 + 9);
$record = new Record();
$record->unserializeFromString($elemento);
$tempField = $record->campos;
$tempRecord = array();
while (list($key, $val) = each($tempField)) {
if (array_key_exists($tempField[$key]->tag, $tempRecord)) {
$varTemp = $tempRecord[$tempField[$key]->tag];
$tempRecord[$tempField[$key]->tag] = array_merge($varTemp, $tempField[$key]->contenido);
} else {
$tempRecord += array($tempField[$key]->tag => $tempField[$key]->contenido);
}
}
$tempRecord += array("mfn" => $record->getMfn());
ksort($tempRecord);
$recordList[] = $tempRecord;
$tempRecord = null;
$rawxml = substr($rawxml, $posicion2 + 1);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
}
return $recordList;
}
示例4: setRecords
function setRecords()
{
global $BVS_CONF, $configurator, $isisBroker, $USERS_TAG_NAME;
$xmlparameters = "<parameters>\n";
$xmlparameters .= "<database>" . $configurator->getPath2Users() . "</database>\n";
if (isset($_REQUEST["searchExpr"]) && $_REQUEST["searchExpr"] != "") {
if (isset($_GET['indexes']) && $_GET['indexes'] != "") {
$xmlparameters .= "<search>{$_GET["indexes"]}={$_REQUEST["searchExpr"]}</search>\n";
} else {
$xmlparameters .= "<search>{$_REQUEST["searchExpr"]}</search>\n";
}
} else {
$xmlparameters .= "<search>\$</search>\n";
}
if (isset($_GET['startIndex']) && $_GET['startIndex'] > 0) {
$xmlparameters .= "<from>{$_GET['startIndex']}</from>\n";
} else {
$xmlparameters .= "<from>1</from>\n";
}
$xmlparameters .= "<to>99999</to>\n";
if (isset($_GET["results"]) && $_GET["results"] != "") {
$xmlparameters .= "<count>{$_GET['results']}</count>\n";
} else {
$xmlparameters .= "<count>1</count>\n";
}
if (isset($_GET['fieldsort']) && $_GET['fieldsort'] != "") {
$xmlparameters .= "<fieldsort>{$_GET['fieldsort']}</fieldsort>\n";
}
$xmlparameters .= "<gizmo>GIZMO_XML</gizmo>\n";
$xmlparameters .= "<xml_header>yes</xml_header>\n";
$xmlparameters .= "<reverse>Off</reverse>\n";
$xmlparameters .= "</parameters>\n";
$rawxml = $isisBroker->search($xmlparameters);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
$recordList = null;
$i = 0;
while ($posicion1 > 0) {
$elemento = substr($rawxml, $posicion1, $posicion2 - $posicion1 + 9);
$record = new Record();
$record->unserializeFromString($elemento);
$tempField = $record->campos;
$tempRecord = array();
while (list($key, $val) = each($tempField)) {
if (array_key_exists($tempField[$key]->tag, $tempRecord)) {
$varTemp = $tempRecord[$tempField[$key]->tag];
$tempRecord[$tempField[$key]->tag] = array_merge($varTemp, utf8_decode($tempField[$key]->contenido));
} else {
$tempRecord += array($tempField[$key]->tag => utf8_decode($tempField[$key]->contenido));
}
}
$tempRecord += array("mfn" => $record->getMfn());
ksort($tempRecord);
$recordList[] = $tempRecord;
$tempRecord = null;
$rawxml = substr($rawxml, $posicion2 + 1);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
}
$this->setTotalRecords($recordList[0][1002]);
return $recordList;
}
示例5: totalCepal
function totalCepal()
{
global $BVS_CONF, $configurator, $isisBroker, $CEPAL_TAG_NAME;
$xmlparameters = "<parameters>\n";
$xmlparameters .= "<database>" . $configurator->getPath2Cepal() . "</database>\n";
$xmlparameters .= "<search>\$</search>\n";
$xmlparameters .= "<from>1</from>\n";
$xmlparameters .= "<to>99999</to>\n";
$xmlparameters .= "<count>1</count>\n";
$xmlparameters .= "<gizmo>GIZMO_XML</gizmo>\n";
$xmlparameters .= "<xml_header>yes</xml_header>\n";
$xmlparameters .= "<reverse>Off</reverse>\n";
$xmlparameters .= "</parameters>\n";
$rawxml = $isisBroker->search($xmlparameters);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
$recordList = null;
$i = 0;
while ($posicion1 > 0) {
$elemento = substr($rawxml, $posicion1, $posicion2 - $posicion1 + 9);
$record = new Record();
$record->unserializeFromString($elemento);
$tempField = $record->campos;
$tempRecord = array();
while (list($key, $val) = each($tempField)) {
if (array_key_exists($tempField[$key]->tag, $tempRecord)) {
$varTemp = $tempRecord[$tempField[$key]->tag];
$tempRecord[$tempField[$key]->tag] = array_merge($varTemp, utf8_decode($tempField[$key]->contenido));
} else {
$tempRecord += array($tempField[$key]->tag => utf8_decode($tempField[$key]->contenido));
}
}
$tempRecord += array("mfn" => $record->getMfn());
ksort($tempRecord);
$recordList[] = $tempRecord;
$tempRecord = null;
$rawxml = substr($rawxml, $posicion2 + 1);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
}
return $recordList[0][1002];
}
示例6: lastTitlePlusData
function lastTitlePlusData()
{
global $BVS_CONF, $configurator, $isisBroker, $TITLEPLUS_TAG_NAME;
$xmlparameters = "<parameters>\n";
$xmlparameters .= "<database>" . $configurator->getPath2titlePlus() . "</database>\n";
//Used when has search
if (isset($_REQUEST["title"]) && $_REQUEST["title"] != "") {
$xmlparameters .= "<from>{$_REQUEST["title"]}=</from>\n";
}
$xmlparameters .= "<fieldsort>920</fieldsort>\n";
$xmlparameters .= "<gizmo>GIZMO_XML</gizmo>\n";
$xmlparameters .= "<xml_header>yes</xml_header>\n";
$xmlparameters .= "<reverse>Off</reverse>\n";
$xmlparameters .= "</parameters>\n";
if (isset($_REQUEST["title"]) && $_REQUEST["title"] != "") {
$rawxml = $isisBroker->keyrange_mfnrange($xmlparameters);
} else {
user_error("Pesquisa Invalida, Sem Título para pesquisar");
}
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
$recordList = null;
$i = 0;
while ($posicion1 > 0) {
$elemento = substr($rawxml, $posicion1, $posicion2 - $posicion1 + 9);
$record = new Record();
$record->unserializeFromString($elemento);
$tempField = $record->campos;
$tempRecord = array();
while (list($key, $val) = each($tempField)) {
if (array_key_exists($tempField[$key]->tag, $tempRecord)) {
$varTemp = $tempRecord[$tempField[$key]->tag];
$tempRecord[$tempField[$key]->tag] = array_merge($varTemp, $tempField[$key]->contenido);
} else {
$tempRecord += array($tempField[$key]->tag => $tempField[$key]->contenido);
}
}
$tempRecord += array("mfn" => $record->getMfn());
ksort($tempRecord);
$recordList[] = $tempRecord;
$tempRecord = null;
$rawxml = substr($rawxml, $posicion2 + 1);
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
}
$tempList = array();
$lastRecord = array();
while (list($key, $val) = each($recordList)) {
if ($recordList[$key][920] >= prev($recordList[$key][920])) {
$lastRecord = $recordList[$key];
}
}
return $lastRecord;
}
示例7: makeRecords
/**
* Funcao que monta o XML que e enviado ao Wxis-Modules
* @return XML
*/
function makeRecords($database)
{
global $BVS_CONF, $configurator, $isisBroker, $FACIC_TAG_NAME;
$xmlparameters = "<parameters>\n";
if (isset($database) && !preg_match("=/=", $database)) {
switch ($database) {
case 'facic':
$xmlparameters .= "<database>" . $configurator->getPath2Facic() . "</database>\n";
break;
case 'title':
$xmlparameters .= "<database>" . $configurator->getPath2Title() . "</database>\n";
break;
case 'titleplus':
$xmlparameters .= "<database>" . $configurator->getPath2Titleplus() . "</database>\n";
break;
case 'holding':
$xmlparameters .= "<database>" . $configurator->getPath2Holdings() . "</database>\n";
break;
case 'temp_facic':
$xmlparameters .= "<database>" . $configurator->getPath2TempFacic() . "</database>\n";
break;
}
}
//Used when has search
if (isset($_REQUEST["title"]) && $_REQUEST["title"] != "") {
$xmlparameters .= "<search>TIT={$_REQUEST["title"]}</search>\n";
} elseif (isset($_REQUEST["searchExpr"]) && $_REQUEST["searchExpr"] != "") {
if (isset($_REQUEST['indexes']) && $_REQUEST['indexes'] != "") {
$xmlparameters .= "<search>{$_REQUEST["indexes"]}={$_REQUEST["searchExpr"]}</search>\n";
} else {
$xmlparameters .= "<search>{$_REQUEST["searchExpr"]}</search>\n";
}
} else {
$xmlparameters .= "<search>\$</search>\n";
}
if (isset($_REQUEST['startIndex']) && $_REQUEST['startIndex'] > 0) {
$xmlparameters .= "<from>{$_REQUEST['startIndex']}</from>\n";
} else {
$xmlparameters .= "<from>1</from>\n";
}
$xmlparameters .= "<to>99999</to>\n";
if (isset($_REQUEST["results"]) && $_REQUEST["results"] != "") {
$xmlparameters .= "<count>{$_REQUEST['results']}</count>\n";
} else {
$xmlparameters .= "<count>1</count>\n";
}
if (isset($_REQUEST['fieldsort']) && $_REQUEST['fieldsort'] != "") {
$xmlparameters .= "<fieldsort>{$_REQUEST['fieldsort']}</fieldsort>\n";
}
$xmlparameters .= "<gizmo>GIZMO_XML</gizmo>\n";
$xmlparameters .= "<xml_header>yes</xml_header>\n";
$xmlparameters .= "<reverse>On</reverse>\n";
$xmlparameters .= "</parameters>\n";
if (isset($_REQUEST['title']) && $_REQUEST['title'] != "") {
$rawxml = $isisBroker->IsisSearchSort($xmlparameters);
} else {
$rawxml = $isisBroker->search($xmlparameters);
}
$posicion1 = strpos($rawxml, "<record");
$posicion2 = strpos($rawxml, "</record>");
$recordList = null;
$i = 0;
while ($posicion1 > 0) {
$elemento = substr($rawxml, $posicion1, $posicion2 - $posicion1 + 9);
$record = new Record();
$record->unserializeFromString($elemento);
$tempField = $record->campos;
$tempRecord = array();
if ($_REQUEST['debug'] == 'yes') {
echo "tempField \n";
var_dump($tempField);
}
while (list($key, $val) = each($tempField)) {
if (array_key_exists($tempField[$key]->tag, $tempRecord)) {
$varTemp = $tempRecord[$tempField[$key]->tag];
if (is_array($varTemp)) {
if (is_array($val->contenido)) {
$tempRecord[$tempField[$key]->tag] = array_merge($varTemp, $tempField[$key]->contenido);
} else {
array_push($tempRecord[$tempField[$key]->tag], $val->contenido);
}
} else {
$tempRecord[$tempField[$key]->tag] = array($varTemp, $val->contenido);
}
} else {
$tempRecord += array($tempField[$key]->tag => $tempField[$key]->contenido);
}
}
$tempRecord += array("mfn" => $record->getMfn());
ksort($tempRecord);
if ($_REQUEST['debug'] == 'yes') {
echo "tempRecord \n";
var_dump($tempRecord);
}
$recordList[] = $tempRecord;
$tempRecord = null;
//.........这里部分代码省略.........