/mnt/monguz/vufind-instances/6.1.2/module/VuFind/src/VuFind/ILS/Driver/Aleph.php
{
if ($this->debug_enabled) {
$this->debug("URL: '$url'");
}
$result = null;
try {
$client = $this->httpService->createClient($url);
$client->setOptions(['timeout' => $this->config['Catalog']['timeout']
?? 30]); // to avoid timeout in original getMyFines
$client->setMethod($method);
if ($body != null) {
$client->setRawBody($body);
}
$result = $client->send();
} catch (\Exception $e) {
throw new ILSException($e->getMessage());
}
if (!$result->isSuccess()) {
throw new ILSException('HTTP error');
}
$answer = $result->getBody();
if ($this->debug_enabled) {
$this->debug("url: $url response: $answer");
}
$answer = str_replace('xmlns=', 'ns=', $answer);
if (strpos($answer, '<') !== false) {
$result = simplexml_load_string($answer);
}
if (!$result) {
if ($this->debug_enabled) {
$this->debug("XML is not valid, URL: $url");
}
throw new ILSException(
"XML is not valid, URL: $url method: $method answer: $answer."
);
}
return $result;
}
/mnt/monguz/vufind-instances/6.1.2/module/VuFind/src/VuFind/ILS/Driver/Aleph.php
/**
* Perform an OAI request.
*
* @param string $id The record id
* @param string $prefix OAI metadata prefix ('marc21' / 'oai_dc')
*
* @return SimpleXMLElement
*/
public function doOAIRequest($id, $prefix = 'marc21')
{
$result = "";
if (isset($this->config['util']['oai_getrecord_url'])) {
if (strpos($id, 'opac') !== false) {
$url = $this->config['util']['oai_getrecord_url'];
$url = preg_replace('/[0-9]{9}/', strpos($url, 'OAI-script')
? preg_replace('/^[0]+/', '', preg_replace('/^.*([0-9]{9})$/',
'$1', $id)) : preg_replace('/^.*([0-9]{9})$/', '$1', $id), $url);
if (is_bool(strpos($url, 'metadataPrefix='.$prefix)))
$url = preg_replace('/(metadataPrefix=)[^&]+/', '$1'.$prefix, $url);
$result = $this->doHTTPRequest($url);
$replyCode = (string) $result->{'reply-code'};
if ($replyCode != "0000") {
$replyText = (string) $result->{'reply-text'};
if (isset($result->{'error'})) {
$errorMsg = (string) $result->{'error'};
$result = $errorMsg;
}
else if ($result->xpath("//header[@status='deleted']")) {
$errorMsg = 'Deleted';
$result = $errorMsg;
}
$this->logError(
"OAI request failed", [
'url' => $url, 'reply-code' => $replyCode,
'reply-message' => $replyText,
'error-message' => isset($errorMsg) ? $errorMsg : ""
]
);
// $ex = new AlephRestfulException($replyText, $replyCode);
// $ex->setXmlResponse($result);
/mnt/monguz/vufind-instances/6.1.2/module/VuFind/src/VuFind/ILS/Driver/Aleph.php
$userLang = $tls[0];
}
}
else {
$userLang = 'eng';
}
return $userLang;
}
/**
* Get the XML representation of a record.
*
* @param string $id The record id
*
* @return string
*/
public function getMARCXMLString($id)
{
$result = $this->doOAIRequest($id);
if ((is_object($result)) && (get_class($result) === 'SimpleXMLElement')
&& (!isset($result->error))) {
$result->registerXPathNamespace("marc", "http://www.loc.gov/MARC21/slim");
$result = $result->xpath('//GetRecord/record/metadata/marc:record');
if (is_array($result) && count($result) < 1)
$result = new \SimpleXMLElement('<record></record>');
else {
if (isset($this->config['Catalog']['hidden_marc_fields'])) {
foreach ($this->config['Catalog']['hidden_marc_fields'] as $fxpath) {
$hmfs = $result[0]->xpath($fxpath);
if (count($hmfs) > 0) {
foreach ($hmfs as $hmf) {
$dom = dom_import_simplexml($hmf);
$dom->parentNode->removeChild($dom);
}
}
}
}
}
}
/mnt/monguz/vufind-instances/6.1.2/themes/bootstrap3elte/templates/RecordTab/staffviewmarc.phtml
<?php
// Set page title.
$this->headTitle($this->translate('MARC View') . ': ' . $this->driver->getBreadcrumb());
?>
<?php if ($this->ils()): ?><?=\VuFind\XSLT\Processor::process('record-marc.xsl', $this->ils()->getDriver()->getMARCXMLString($this->driver->getUniqueID()))?><? endif; ?>
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php
$__vars = $this->vars()->getArrayCopy();
if (array_key_exists('this', $__vars)) {
unset($__vars['this']);
}
extract($__vars);
unset($__vars); // remove $__vars from local scope
$this->__content = '';
while ($this->__template = array_pop($this->__templates)) {
$this->__file = $this->resolver($this->__template);
if (! $this->__file) {
throw new Exception\RuntimeException(sprintf(
'%s: Unable to render template "%s"; resolver could not resolve to a file',
__METHOD__,
$this->__template
));
}
try {
ob_start();
$includeReturn = include $this->__file;
$this->__content = ob_get_clean();
} catch (\Throwable $ex) {
ob_end_clean();
throw $ex;
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
ob_end_clean();
throw $ex;
}
if ($includeReturn === false && empty($this->__content)) {
throw new Exception\UnexpectedValueException(sprintf(
'%s: Unable to render template "%s"; file include failed',
__METHOD__,
$this->__file
));
}
}
$this->setVars(array_pop($this->__varsCache));
if ($this->__filterChain instanceof FilterChain) {
/mnt/monguz/vufind-instances/6.1.2/module/VuFind/src/VuFind/View/Helper/Root/Record.php
);
$link .= $this->getView()->plugin('searchTabs')
->getCurrentHiddenFilterParams($this->driver->getSourceIdentifier());
return $link;
}
/**
* Render the contents of the specified record tab.
*
* @param \VuFind\RecordTab\TabInterface $tab Tab to display
*
* @return string
*/
public function getTab(\VuFind\RecordTab\TabInterface $tab)
{
$context = ['driver' => $this->driver, 'tab' => $tab];
$classParts = explode('\\', get_class($tab));
$template = 'RecordTab/' . strtolower(array_pop($classParts)) . '.phtml';
$oldContext = $this->contextHelper->apply($context);
$html = $this->view->render($template);
$this->contextHelper->restore($oldContext);
return $html;
}
/**
* Render a toolbar for use on the record view.
*
* @return string
*/
public function getToolbar()
{
return $this->renderTemplate('toolbar.phtml');
}
/**
* Render a search result for the specified view mode.
*
* @param string $view View mode to use.
*
* @return string
/mnt/monguz/vufind-instances/6.1.2/themes/bootstrap3elte/templates/record/view.phtml
if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) {
$tabClasses[] = 'active';
}
$tabClasses[] = 'initiallyActive';
$this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>';
$activeTabObj = $obj;
}
if (!$obj->isVisible()) { $tabClasses[] = 'hidden'; }
if (!$obj->supportsAjax()) { $tabClasses[] = 'noajax'; }
?>
<li class="<?=implode(' ', $tabClasses)?>" data-tab="<?=$tabName?>"<?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)):?> data-background<?php endif ?>>
<a href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"><?=$this->transEsc($desc)?></a>
</li>
<?php endforeach; ?>
</ul>
<div class="tab-content">
<?php if (!$this->loadInitialTabWithAjax || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?>
<div class="tab-pane active <?=$this->escapeHtmlAttr($this->activeTab) ?>-tab">
<?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?=$this->driver->supportsCoinsOpenURL()?'<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>':''?>
</div>
<div class="<?=$this->layoutClass('sidebar')?>">
<?php foreach ($sidebarList as $current): ?>
<?=$this->related()->render($current)?>
<?php endforeach; ?>
</div>
</div>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?>
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php
$__vars = $this->vars()->getArrayCopy();
if (array_key_exists('this', $__vars)) {
unset($__vars['this']);
}
extract($__vars);
unset($__vars); // remove $__vars from local scope
$this->__content = '';
while ($this->__template = array_pop($this->__templates)) {
$this->__file = $this->resolver($this->__template);
if (! $this->__file) {
throw new Exception\RuntimeException(sprintf(
'%s: Unable to render template "%s"; resolver could not resolve to a file',
__METHOD__,
$this->__template
));
}
try {
ob_start();
$includeReturn = include $this->__file;
$this->__content = ob_get_clean();
} catch (\Throwable $ex) {
ob_end_clean();
throw $ex;
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
ob_end_clean();
throw $ex;
}
if ($includeReturn === false && empty($this->__content)) {
throw new Exception\UnexpectedValueException(sprintf(
'%s: Unable to render template "%s"; file include failed',
__METHOD__,
$this->__file
));
}
}
$this->setVars(array_pop($this->__varsCache));
if ($this->__filterChain instanceof FilterChain) {
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-view/src/View.php
// If EVENT_RENDERER or EVENT_RENDERER_POST changed the model, make sure
// we use this new model instead of the current $model
$model = $event->getModel();
// If we have children, render them first, but only if:
// a) the renderer does not implement TreeRendererInterface, or
// b) it does, but canRenderTrees() returns false
if ($model->hasChildren()
&& (! $renderer instanceof TreeRendererInterface
|| ! $renderer->canRenderTrees())
) {
$this->renderChildren($model);
}
// Reset the model, in case it has changed, and set the renderer
$event->setModel($model);
$event->setRenderer($renderer);
$rendered = $renderer->render($model);
// If this is a child model, return the rendered content; do not
// invoke the response strategy.
$options = $model->getOptions();
if (array_key_exists('has_parent', $options) && $options['has_parent']) {
return $rendered;
}
$event->setResult($rendered);
$event->setName(ViewEvent::EVENT_RESPONSE);
$events->triggerEvent($event);
}
/**
* Loop through children, rendering each
*
* @param Model $model
* @throws Exception\DomainException
* @return void
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-view/src/View.php
$event->setName(ViewEvent::EVENT_RESPONSE);
$events->triggerEvent($event);
}
/**
* Loop through children, rendering each
*
* @param Model $model
* @throws Exception\DomainException
* @return void
*/
protected function renderChildren(Model $model)
{
foreach ($model as $child) {
if ($child->terminate()) {
throw new Exception\DomainException('Inconsistent state; child view model is marked as terminal');
}
$child->setOption('has_parent', true);
$result = $this->render($child);
$child->setOption('has_parent', null);
$capture = $child->captureTo();
if (! empty($capture)) {
if ($child->isAppend()) {
$oldResult = $model->{$capture};
$model->setVariable($capture, $oldResult . $result);
} else {
$model->setVariable($capture, $result);
}
}
}
}
/**
* Create and return ViewEvent used by render()
*
* @return ViewEvent
*/
protected function getEvent()
{
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-view/src/View.php
__METHOD__
));
}
$event->setRenderer($renderer);
$event->setName(ViewEvent::EVENT_RENDERER_POST);
$events->triggerEvent($event);
// If EVENT_RENDERER or EVENT_RENDERER_POST changed the model, make sure
// we use this new model instead of the current $model
$model = $event->getModel();
// If we have children, render them first, but only if:
// a) the renderer does not implement TreeRendererInterface, or
// b) it does, but canRenderTrees() returns false
if ($model->hasChildren()
&& (! $renderer instanceof TreeRendererInterface
|| ! $renderer->canRenderTrees())
) {
$this->renderChildren($model);
}
// Reset the model, in case it has changed, and set the renderer
$event->setModel($model);
$event->setRenderer($renderer);
$rendered = $renderer->render($model);
// If this is a child model, return the rendered content; do not
// invoke the response strategy.
$options = $model->getOptions();
if (array_key_exists('has_parent', $options) && $options['has_parent']) {
return $rendered;
}
$event->setResult($rendered);
$event->setName(ViewEvent::EVENT_RESPONSE);
$events->triggerEvent($event);
}
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php
if ($result instanceof Response) {
return $result;
}
// Martial arguments
$request = $e->getRequest();
$response = $e->getResponse();
$viewModel = $e->getViewModel();
if (! $viewModel instanceof ViewModel) {
return;
}
$view = $this->view;
$view->setRequest($request);
$view->setResponse($response);
$caughtException = null;
try {
$view->render($viewModel);
} catch (\Throwable $ex) {
$caughtException = $ex;
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
$caughtException = $ex;
}
if ($caughtException !== null) {
if ($e->getName() === MvcEvent::EVENT_RENDER_ERROR) {
throw $caughtException;
}
$application = $e->getApplication();
$events = $application->getEventManager();
$e->setError(Application::ERROR_EXCEPTION);
$e->setParam('exception', $caughtException);
$e->setName(MvcEvent::EVENT_RENDER_ERROR);
$events->triggerEvent($e);
}
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-eventmanager/src/EventManager.php
}
if ($this->sharedManager) {
foreach ($this->sharedManager->getListeners($this->identifiers, $name) as $priority => $listeners) {
$listOfListenersByPriority[$priority][] = $listeners;
}
}
// Sort by priority in reverse order
krsort($listOfListenersByPriority);
// Initial value of stop propagation flag should be false
$event->stopPropagation(false);
// Execute listeners
$responses = new ResponseCollection();
foreach ($listOfListenersByPriority as $listOfListeners) {
foreach ($listOfListeners as $listeners) {
foreach ($listeners as $listener) {
$response = $listener($event);
$responses->push($response);
// If the event was asked to stop propagating, do so
if ($event->propagationIsStopped()) {
$responses->setStopped(true);
return $responses;
}
// If the result causes our validation callback to return true,
// stop propagation
if ($callback && $callback($response)) {
$responses->setStopped(true);
return $responses;
}
}
}
}
return $responses;
}
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-eventmanager/src/EventManager.php
$event = clone $this->eventPrototype;
$event->setName($eventName);
if ($target !== null) {
$event->setTarget($target);
}
if ($argv) {
$event->setParams($argv);
}
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function triggerEvent(EventInterface $event)
{
return $this->triggerListeners($event);
}
/**
* @inheritDoc
*/
public function triggerEventUntil(callable $callback, EventInterface $event)
{
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function attach($eventName, callable $listener, $priority = 1)
{
if (! is_string($eventName)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a string for the event; received %s',
__METHOD__,
(is_object($eventName) ? get_class($eventName) : gettype($eventName))
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-mvc/src/Application.php
return $this->completeRequest($event);
}
/**
* Complete the request
*
* Triggers "render" and "finish" events, and returns response from
* event object.
*
* @param MvcEvent $event
* @return Application
*/
protected function completeRequest(MvcEvent $event)
{
$events = $this->events;
$event->setTarget($this);
$event->setName(MvcEvent::EVENT_RENDER);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
$event->setName(MvcEvent::EVENT_FINISH);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
return $this;
}
}
/mnt/monguz/vufind-instances/6.1.2/vendor/zendframework/zend-mvc/src/Application.php
// Trigger dispatch event
$event->setName(MvcEvent::EVENT_DISPATCH);
$event->stopPropagation(false); // Clear before triggering
$result = $events->triggerEventUntil($shortCircuit, $event);
// Complete response
$response = $result->last();
if ($response instanceof ResponseInterface) {
$event->setName(MvcEvent::EVENT_FINISH);
$event->setTarget($this);
$event->setResponse($response);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
$this->response = $response;
return $this;
}
$response = $this->response;
$event->setResponse($response);
return $this->completeRequest($event);
}
/**
* Complete the request
*
* Triggers "render" and "finish" events, and returns response from
* event object.
*
* @param MvcEvent $event
* @return Application
*/
protected function completeRequest(MvcEvent $event)
{
$events = $this->events;
$event->setTarget($this);
$event->setName(MvcEvent::EVENT_RENDER);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
/mnt/monguz/vufind-instances/eles/public/index.php
// Ensure vendor/ is on include_path; some PEAR components may not load correctly
// otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling
// from the shared PEAR directory instead of the local copy):
$pathParts = [];
$pathParts[] = APPLICATION_PATH . '/vendor';
$pathParts[] = get_include_path();
set_include_path(implode(PATH_SEPARATOR, $pathParts));
// Composer autoloading
if (file_exists('vendor/autoload.php')) {
$loader = include 'vendor/autoload.php';
}
if (!class_exists('Zend\Loader\AutoloaderFactory')) {
throw new RuntimeException('Unable to load Zend Framework autoloader.');
}
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();