Grima 2018-08
Whispering into Alma's ear
Public Member Functions | Public Attributes | List of all members
Grima Class Reference

Public Member Functions

  sessionInit ($force=false)
 
  sessionSave ($result)
 
  sessionDestroy ()
 
  __construct ()
 
  request ($method, $url, $URLparams, $QSparams, $body=null)
  general function for REST API calls More...
 
  get ($url, $URLparams, $QSparams)
  general function for GET (retrieve) API calls More...
 
  post ($url, $URLparams, $QSparams, $body)
  general function for POST (create) API calls More...
 
  put ($url, $URLparams, $QSparams, $body)
  general function for PUT (update) API calls More...
 
  delete ($url, $URLparams, $QSparams)
  general function for DELETE API calls More...
 
  checkForErrorMessage ($xml)
  checks for errorMessage tag, throws exceptions More...
 
Bib APIs
  getBib ($mms_id, $view='full', $expand='None')
  Retrieve Bib - retrieve a bib record from Alma. More...
 
  postBib ($bib)
  Create Record - adds a new bib record to Alma. More...
 
  putBib ($mms_id, $bib)
  Update Bib Record - updates the copy of the bib in Alma. More...
 
  deleteBib ($mms_id, $override='false')
  Delete Bib Record - deletes the bib record from Alma. More...
 
Holdings List APIs
  getHoldingsList ($mms_id)
  Retrieve Holdings list - download brief descriptions of holdings for the bib. More...
 
Holding APIs
  getHolding ($mms_id, $holding_id)
  Retrieve Holdings Record - retrieve holdings record from Alma. More...
 
  postHolding ($mms_id, $holding)
  Create holding record - add a new holdings record to a bib. More...
 
  putHolding ($mms_id, $holding_id, $holding)
  Update Holdings Record - replace the holdings record in Alma. More...
 
  deleteHolding ($mms_id, $holding_id, $override='false')
  Delete Holdings Record - delete the holdings record from Alma. More...
 
Item List APIs
  getItemList ($mms_id, $holding_id, $limit, $offset)
  Retrieve Items list - retrieve the items list from a holding or bib from Alma. More...
 
Item APIs
  getItem ($mms_id, $holding_id, $item_pid)
  Retrieve Item and print label information. More...
 
  getItemBC ($barcode)
  Retrieve Item and print label information (by barcode)) More...
 
  postItem ($mms_id, $holding_id, $item)
  Create Item - add a new item to a holding in Alma. More...
 
  putItem ($mms_id, $holding_id, $item_pid, $item)
  Update Item information - replace item record in Alma. More...
 
  deleteItem ($mms_id, $holding_id, $item_pid, $override="false", $holdings="retain")
  Withdraw Item - delete an item record from Alma. More...
 
Electronic APIs
  getElectronicPortfolio ($collection_id, $service_id, $portfolio_id)
  Retrieve Portfolio - retrieve a portfolio record from Alma. More...
 
  getElectronicPortfolioFromBib ($mms_id, $portfolio_id)
  Retrieve Portfolio - retrieve a portfolio record from Alma. More...
 
  postElectronicPortfolio ($collection_id, $service_id, $portfolio)
  Create Electronic Portfolio - add a new portfolio to Alma. More...
 
  postElectronicPortfolioOnBib ($mms_id, $portfolio, $update=true)
  Create Electronic Portfolio - add a new portfolio to Alma Bib. More...
 
  putElectronicPortfolioOnBib ($mms_id, $portfolio_id, $portfolio)
  Update Electronic Portfolio - update portfolio in Alma. More...
 
  deleteElectronicPortfolio ($collection_id, $service_id, $portfolio_id)
  Delete Electronic Portfolio - delete portfolio from Alma. More...
 
  getElectronicPortfoliosForService ($collection_id, $service_id, $limit, $offset)
  Retrieve Portfolios - retrieve a list of portfolios from Alma. More...
 
  getElectronicPortfoliosForBib ($mms_id, $limit, $offset)
  Retrieve Portfolios list (Bib) - retrieve a list of portfolios from Alma. More...
 
  getElectronicCollection ($collection_id)
  Retrieve Electronic Collection - retrieve a collection record from Alma. More...
 
  putElectronicCollection ($collection_id, $collection)
  Update Electronic Collection Record - updates the copy of the collection in Alma. More...
 
  getElectronicServices ($collection_id)
  Retrieve Electronic Services - retrieve a list of services from a collection in Alma. More...
 
Library APIs
  getLibrary ($libraryCode)
  Retrieve a Library - retrieve a Library from Alma. More...
 
  getAllLibraries ()
  Retrieve Libraries - retrieve all libraries. More...
 
  getAllLocations ($libraryCode)
  Retrieve Locations - retrieve all locations in a library. More...
 
Location APIs
  getLocation ($libraryCode, $locationCode)
  Retrieve Location - retrieve a Library Location from Alma. More...
 
Set APIs
  getSet ($set_id)
  Retrieve a Set - retrieve a Set from Alma. More...
 
  postSet ($set)
  Create a Set - add a new set to Alma. More...
 
  postSetManageMembers ($set_id, $id_type, $op, $set)
  Manage Members - modify sets in Alma. More...
 
  createSetFromImport ($job_instance_id, $population)
  Create a Set from an import job. More...
 
  deleteSet ($set_id)
  Delete a Set - delete a set (not its items) from Alma. More...
 
  getSetMembers ($set_id, $limit=10, $offset=0)
  get the members of a set, IF IT WORKS?!?! More...
 
Analytics APIs
  getAnalytics ($path, $filter, $limit=25, $token=null)
 
Job APIs
  postJob ($job_id, $op, $job)
  Submit a manual or scheduled job. More...
 

Public Attributes

  $server
 
  $apikey
 

Detailed Description

Definition at line 30 of file grima-lib.php.

Constructor & Destructor Documentation

◆ __construct()

Grima::__construct ( )

Definition at line 118 of file grima-lib.php.

119 {
120
121 $this->sessionInit();
122
123 $this->apikey =
124 isset($_REQUEST['apikey']) && $_REQUEST['apikey'] ? $_REQUEST['apikey'] : (
125 isset($_SESSION['apikey']) && $_SESSION['apikey'] ? $_SESSION['apikey'] : (
126 getenvWithFileFallbackAndDefault('apikey', '') ) );
127
128 $this->server =
129 isset($_REQUEST['server']) && $_REQUEST['server'] ? $_REQUEST['server'] : (
130 isset($_SESSION['server']) && $_SESSION['server'] ? $_SESSION['server'] : (
131 getenvWithFileFallbackAndDefault('server', '') ) );
132
133 if (strlen($this->server)==2) {
134 $this->server = "https://api-" . $this->server . ".hosted.exlibrisgroup.com";
135 }
136
137 if (!preg_match('!https://api-[a-z]*\.hosted\.exlibrisgroup\.com!', $this->server)) {
138 $this->server = "";
139 }
140
141 if ($this->apikey=='EDITME') {
142 $this->apikey = "";
143 }
144
145 if ($this->apikey && $this->server) {
146 $_SESSION['apikey'] = $this->apikey;
147 $_SESSION['server'] = $this->server;
148 }
149
150 session_write_close();
151
152 return false;
153 }
sessionInit($force=false)
Definition: grima-lib.php:37
$apikey
Definition: grima-lib.php:33
$server
Definition: grima-lib.php:32
getenvWithFileFallbackAndDefault( $env_name, $default=false)
Definition: grima-util.php:52

References $apikey, $server, getenvWithFileFallbackAndDefault(), and sessionInit().

Member Function Documentation

◆ checkForErrorMessage()

Grima::checkForErrorMessage (   $xml )

checks for errorMessage tag, throws exceptions

Parameters
DomDocument $xml

Definition at line 357 of file grima-lib.php.

358 {
359 if ($xml instanceOf DomDocument) {
360 $xpath = new DomXpath($xml);
361 $xpath->registerNamespace("err", "http://com/exlibris/urm/general/xmlbeans");
362 $error = $xpath->query('//err:errorMessage');
363 if ($error->length > 0) {
364 throw new Exception("Alma says: " . $error[0]->nodeValue);
365 }
366 }
367 }

Referenced by createSetFromImport(), deleteBib(), deleteElectronicPortfolio(), deleteHolding(), deleteItem(), deleteSet(), getAllLibraries(), getAllLocations(), getBib(), getElectronicCollection(), getElectronicPortfolio(), getElectronicPortfolioFromBib(), getElectronicPortfoliosForBib(), getElectronicPortfoliosForService(), getElectronicServices(), getHolding(), getHoldingsList(), getItem(), getItemBC(), getItemList(), getLibrary(), getLocation(), getSet(), getSetMembers(), postBib(), postElectronicPortfolio(), postElectronicPortfolioOnBib(), postHolding(), postItem(), postJob(), postSet(), postSetManageMembers(), putBib(), putElectronicCollection(), putElectronicPortfolioOnBib(), and putHolding().

◆ createSetFromImport()

Grima::createSetFromImport (   $job_instance_id,
  $population 
)

Create a Set from an import job.

Makes a call to the API: (API docs)

POST /almaws/v1/conf/sets
Parameters
string $job_instance_id ID of the import job
string $population ...
Returns
DomDocument Set object

Definition at line 1353 of file grima-lib.php.

1354 {
1355 // create blank set
1356
1357 $body = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>
1358<set>
1359 <name>Grima set from ' . $job_instance_id . '</name>
1360 <description>members of ' . $job_instance_id . '</description>
1361 <type desc="Itemized">ITEMIZED</type>
1362 <content desc="All Titles">BIB_MMS</content>
1363 <private desc="No">false</private>
1364</set>';
1365
1366 /*
1367 Content:
1368 BIB_MMS -- all titles
1369 ITEM
1370 PORTFOLIO
1371 IEPA
1372 FILE
1373 AUTHORITY_MMS
1374 IEP
1375 IEE
1376 IED
1377 IEC
1378 */
1379
1380 /*
1381 Population:
1382 */
1383
1384 $bodyxml = new DomDocument();
1385 $bodyxml->loadXML($body);
1386
1387 $ret = $this->post('/almaws/v1/conf/sets', array(), array('job_instance_id' => $job_instance_id, 'population' => $population), $bodyxml);
1388 $this->checkForErrorMessage($ret);
1389 return $ret;
1390
1391 }
post($url, $URLparams, $QSparams, $body)
general function for POST (create) API calls
Definition: grima-lib.php:314
checkForErrorMessage($xml)
checks for errorMessage tag, throws exceptions
Definition: grima-lib.php:357

References checkForErrorMessage(), and post().

◆ delete()

Grima::delete (   $url,
  $URLparams,
  $QSparams 
)

general function for DELETE API calls

Parameters
string $url - URL pattern string with parameters in {}
array $URLparams - URL parameters
array $QSparams - query string parameters
Returns
null|DomDocument - usually return nothing, but return the error document on error

Definition at line 346 of file grima-lib.php.

347 {
348 return $this->request("DELETE", $url, $URLparams, $QSparams, null);
349 }
request($method, $url, $URLparams, $QSparams, $body=null)
general function for REST API calls
Definition: grima-lib.php:171

References request().

◆ deleteBib()

Grima::deleteBib (   $mms_id,
  $override = 'false' 
)

Delete Bib Record - deletes the bib record from Alma.

Makes a call to the API: (API docs)

DELETE /almaws/v1/bibs/{mms_id}
Parameters
string $mms_id MMS ID of Alma Bib record to delete
string $override Optional. Default=false

Definition at line 469 of file grima-lib.php.

470 {
471 $ret = $this->delete(
472 '/almaws/v1/bibs/{mms_id}',
473 array('mms_id' => $mms_id),
474 array('override' => $override)
475 );
476 $this->checkForErrorMessage($ret);
477 }

References checkForErrorMessage().

◆ deleteElectronicPortfolio()

Grima::deleteElectronicPortfolio (   $collection_id,
  $service_id,
  $portfolio_id 
)

Delete Electronic Portfolio - delete portfolio from Alma.

Makes a call to the API: (API docs)

  DELETE /almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios/{portfolio_id}
Parameters
string $collection_id ID of collection
string $service_id ID of service
string $portfolio_id ID of portfolio

Definition at line 990 of file grima-lib.php.

991 {
992 $ret = $this->delete(
993 '/almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios/{portfolio_id}',
994 array('collection_id' => $collection_id, 'service_id' => $service_id, 'portfolio_id' => $portfolio_id),
995 array()
996 );
997 $this->checkForErrorMessage($ret);
998 }

References checkForErrorMessage().

◆ deleteHolding()

Grima::deleteHolding (   $mms_id,
  $holding_id,
  $override = 'false' 
)

Delete Holdings Record - delete the holdings record from Alma.

Makes a call to the API: (API docs)

DELETE /almaws/v1/bibs/{mms_id}/holdings/{holding_id}
Parameters
string $mms_id MMS ID of Alma Bib record
string $holding_id Holding ID of Holding record to delete from Alma
string $override Optional. Default=false

Definition at line 625 of file grima-lib.php.

626 {
627 $ret = $this->delete(
628 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}',
629 array(
630 'mms_id' => $mms_id,
631 'holding_id' => $holding_id
632 ),
633 array('override' => $override)
634 );
635 $this->checkForErrorMessage($ret);
636 }

References checkForErrorMessage().

◆ deleteItem()

Grima::deleteItem (   $mms_id,
  $holding_id,
  $item_pid,
  $override = "false",
  $holdings = "retain" 
)

Withdraw Item - delete an item record from Alma.

Makes a call to the API: (API docs)

DELETE /almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items/{item_pid}
Parameters
string $mms_id MMS ID of Bib record
string $holding_id Holding ID of holding record
string $item_pid Item ID of item record
string $override Override warnings? (false, true)
string $holdings How to handle holdings with inventory? (retain, delete or suppress)

Definition at line 813 of file grima-lib.php.

815 {
816 $ret = $this->delete(
817 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items/{item_pid}', array(
818 'mms_id' => $mms_id,
819 'holding_id' => $holding_id,
820 'item_pid' => $item_pid
821 ), array(
822 'override' => $override,
823 'holdings' => $holdings
824 )
825 );
826 $this->checkForErrorMessage($ret);
827 }

References checkForErrorMessage().

◆ deleteSet()

Grima::deleteSet (   $set_id )

Delete a Set - delete a set (not its items) from Alma.

Makes a call to the API: (API docs)

DELETE /almaws/v1/conf/sets/{set_id}
Parameters
string $set_id Set ID

Definition at line 1405 of file grima-lib.php.

1406 {
1407 $ret = $this->delete(
1408 '/almaws/v1/conf/sets/{set_id}',
1409 array(
1410 'set_id' => $set_id,
1411 ),
1412 array()
1413 );
1414 $this->checkForErrorMessage($ret);
1415 }

References checkForErrorMessage().

◆ get()

Grima::get (   $url,
  $URLparams,
  $QSparams 
)

general function for GET (retrieve) API calls

Parameters
string $url - URL pattern string with parameters in {}
array $URLparams - URL parameters
array $QSparams - query string parameters
Returns
DomDocument of requested record

Definition at line 298 of file grima-lib.php.

299 {
300 return $this->request("GET", $url, $URLparams, $QSparams, null);
301 }

References request().

◆ getAllLibraries()

Grima::getAllLibraries ( )

Retrieve Libraries - retrieve all libraries.

Makes a call to the API: (API docs)

GET /almaws/v1/conf/libraries
Returns
DomDocument Libraries object

Definition at line 1177 of file grima-lib.php.

1178 {
1179 $ret = $this->get(
1180 '/almaws/v1/conf/libraries',
1181 array(),
1182 array()
1183 );
1184 $this->checkForErrorMessage($ret);
1185 return $ret;
1186 }

References checkForErrorMessage().

◆ getAllLocations()

Grima::getAllLocations (   $libraryCode )

Retrieve Locations - retrieve all locations in a library.

Makes a call to the API: (API docs)

GET /almaws/v1/conf/libraries/{libraryCode}/locations
Returns
DomDocument Locations object

Definition at line 1200 of file grima-lib.php.

1201 {
1202 $ret = $this->get(
1203 '/almaws/v1/conf/libraries/{libraryCode}/locations',
1204 array('libraryCode' => $libraryCode),
1205 array()
1206 );
1207 $this->checkForErrorMessage($ret);
1208 return $ret;
1209 }

References checkForErrorMessage().

◆ getAnalytics()

Grima::getAnalytics (   $path,
  $filter,
  $limit = 25,
  $token = null 
)

Definition at line 1457 of file grima-lib.php.

1458 {
1459 return $this->get(
1460 '/almaws/v1/analytics/reports',
1461 array(),
1462 array('path' => urlencode($path), 'filter' => urlencode($filter),
1463 'limit' => $limit, 'token' => $token)
1464 );
1465 }

◆ getBib()

Grima::getBib (   $mms_id,
  $view = 'full',
  $expand = 'None' 
)

Retrieve Bib - retrieve a bib record from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/bibs/{mms_id}
Parameters
string $mms_id The Bib Record ID.
string $view Optional. Default=full
string $expand Optional. Default=None
Returns
DomDocument Bib object https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 394 of file grima-lib.php.

395 {
396 $ret = $this->get(
397 '/almaws/v1/bibs/{mms_id}',
398 array('mms_id' => $mms_id),
399 array('view' => $view, 'expand' => $expand)
400 );
401 $this->checkForErrorMessage($ret);
402 return $ret;
403 }

References checkForErrorMessage().

◆ getElectronicCollection()

Grima::getElectronicCollection (   $collection_id )

Retrieve Electronic Collection - retrieve a collection record from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/electronic/e-collections/{collection_id}
Parameters
string $collection_id ID of collection
Returns
DomDocument Electronic Collection object

Definition at line 1066 of file grima-lib.php.

1067 {
1068 $ret = $this->get(
1069 '/almaws/v1/electronic/e-collections/{collection_id}',
1070 array('collection_id' => $collection_id),
1071 array()
1072 );
1073 $this->checkForErrorMessage($ret);
1074 return $ret;
1075 }

References checkForErrorMessage().

◆ getElectronicPortfolio()

Grima::getElectronicPortfolio (   $collection_id,
  $service_id,
  $portfolio_id 
)

Retrieve Portfolio - retrieve a portfolio record from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios/{portfolio_id}
Parameters
string $collection_id ID of collection
string $service_id ID of service
string $portfolio_id ID of portfolio
Returns
DomDocument Electronic Portfolio object

Definition at line 857 of file grima-lib.php.

858 {
859 $ret = $this->get(
860 '/almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios/{portfolio_id}',
861 array('collection_id' => $collection_id, 'service_id' => $service_id, 'portfolio_id' => $portfolio_id),
862 array()
863 );
864 $this->checkForErrorMessage($ret);
865 return $ret;
866 }

References checkForErrorMessage().

◆ getElectronicPortfolioFromBib()

Grima::getElectronicPortfolioFromBib (   $mms_id,
  $portfolio_id 
)

Retrieve Portfolio - retrieve a portfolio record from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/bibs/{mms_id}/portfolios/{portfolio_id}

Parameters
string $mms_id ID of bib record
string $portfolio_id ID of portfolio
Returns
DomDocument Electronic Portfolio object

Definition at line 882 of file grima-lib.php.

883 {
884 $ret = $this->get(
885 '/almaws/v1/bibs/{mms_id}/portfolios/{portfolio_id}',
886 array('mms_id' => $mms_id, 'portfolio_id' => $portfolio_id),
887 array()
888 );
889 $this->checkForErrorMessage($ret);
890 return $ret;
891 }

References checkForErrorMessage().

◆ getElectronicPortfoliosForBib()

Grima::getElectronicPortfoliosForBib (   $mms_id,
  $limit,
  $offset 
)

Retrieve Portfolios list (Bib) - retrieve a list of portfolios from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/bibs/{mms_id}/portfolios
Parameters
string $mms_id ID of bib
string $limit Max number of portfolios to retrieve
string $offset Offset of the results
Returns
DomDocument Portfolios List object

Definition at line 1042 of file grima-lib.php.

1043 {
1044 $ret = $this->get(
1045 '/almaws/v1/bibs/{mms_id}/portfolios',
1046 array('mms_id' => $mms_id),
1047 array('limit' => $limit, $offset = $offset)
1048 );
1049 $this->checkForErrorMessage($ret);
1050 return $ret;
1051 }

References checkForErrorMessage().

◆ getElectronicPortfoliosForService()

Grima::getElectronicPortfoliosForService (   $collection_id,
  $service_id,
  $limit,
  $offset 
)

Retrieve Portfolios - retrieve a list of portfolios from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios
Parameters
string $collection_id ID of collection
string $service_id ID of service
string $limit Max number of portfolios to retrieve
string $offset Offset of the results
Returns
DomDocument Retrieve Portfolios object

Definition at line 1016 of file grima-lib.php.

1017 {
1018 $ret = $this->get(
1019 '/almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios',
1020 array('collection_id' => $collection_id, 'service_id' => $service_id),
1021 array('limit' => $limit, $offset = $offset)
1022 );
1023 $this->checkForErrorMessage($ret);
1024 return $ret;
1025 }

References checkForErrorMessage().

◆ getElectronicServices()

Grima::getElectronicServices (   $collection_id )

Retrieve Electronic Services - retrieve a list of services from a collection in Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/electronic/e-collections/{collection_id}/e-services
Parameters
string $collection_id ID of collection
Returns
DomDocument Services object

Definition at line 1117 of file grima-lib.php.

1118 {
1119 $ret = $this->get(
1120 '/almaws/v1/electronic/e-collections/{collection_id}/e-services',
1121 array('collection_id' => $collection_id),
1122 array()
1123 );
1124 $this->checkForErrorMessage($ret);
1125 return $ret;
1126 }

References checkForErrorMessage().

◆ getHolding()

Grima::getHolding (   $mms_id,
  $holding_id 
)

Retrieve Holdings Record - retrieve holdings record from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/bibs/{mms_id}/holdings/{holding_id}
Parameters
string $mms_id MMS ID of Alma Bib
string $holding_id Holdings ID of Alma Holding
Returns
DomDocument Holding object

Definition at line 544 of file grima-lib.php.

545 {
546 $ret = $this->get(
547 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}',
548 array(
549 'mms_id' => $mms_id,
550 'holding_id' => $holding_id
551 ),
552 array()
553 );
554 $this->checkForErrorMessage($ret);
555 return $ret;
556 }

References checkForErrorMessage().

◆ getHoldingsList()

Grima::getHoldingsList (   $mms_id )

Retrieve Holdings list - download brief descriptions of holdings for the bib.

Makes a call to the API: (API docs)

GET /almaws/v1/bibs/{mms_id}/holdings
Parameters
string $mms_id MMS ID of Alma Bib to gather holdings from
Returns
DomDocument Holdings List object

Definition at line 506 of file grima-lib.php.

507 {
508 $ret = $this->get(
509 '/almaws/v1/bibs/{mms_id}/holdings',
510 array('mms_id' => $mms_id),
511 array()
512 );
513 $this->checkForErrorMessage($ret);
514 return $ret;
515 }

References checkForErrorMessage().

◆ getItem()

Grima::getItem (   $mms_id,
  $holding_id,
  $item_pid 
)

Retrieve Item and print label information.

Makes a call to the API: (API docs)

GET /almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items/{item_pid}
Parameters
string $mms_id MMS ID of Alma Bib
string $holding_id Holding ID of Alma Holding
string $item_pid Item ID of Alma Holding

Definition at line 704 of file grima-lib.php.

705 {
706 $ret = $this->get(
707 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items/{item_pid}', array(
708 'mms_id' => $mms_id,
709 'holding_id' => $holding_id,
710 'item_pid' => $item_pid
711 ),
712 array()
713 );
714 $this->checkForErrorMessage($ret);
715 return $ret;
716 }

References checkForErrorMessage().

◆ getItemBC()

Grima::getItemBC (   $barcode )

Retrieve Item and print label information (by barcode))

Makes a call to the API: (API docs)

GET /almaws/v1/items?item_barcode={item_barcode}
Parameters
string $barcode Barcode of Alma item

Definition at line 730 of file grima-lib.php.

731 {
732 $ret = $this->get(
733 '/almaws/v1/items',
734 array(),
735 array(
736 'item_barcode' => $barcode,
737 )
738 );
739 $this->checkForErrorMessage($ret);
740 return $ret;
741 }

References checkForErrorMessage().

◆ getItemList()

Grima::getItemList (   $mms_id,
  $holding_id,
  $limit,
  $offset 
)

Retrieve Items list - retrieve the items list from a holding or bib from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items
Parameters
string $mms_id MMS ID of Alma bib
string $holding_id MMS ID of Alma holding
string $limit Max number of items to retrieve
string $offset Offset of the results returned
Returns
DomDocument Item List object

Definition at line 667 of file grima-lib.php.

668 {
669 $ret = $this->get(
670 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items', array('mms_id' => $mms_id, 'holding_id' => $holding_id),
671 array('limit' => $limit, 'offset' => $offset)
672 );
673 $this->checkForErrorMessage($ret);
674 return $ret;
675 }

References checkForErrorMessage().

◆ getLibrary()

Grima::getLibrary (   $libraryCode )

Retrieve a Library - retrieve a Library from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/conf/libraries/{libraryCode}
Parameters
string $libraryCode ID of the library to retrieve
Returns
DomDocument Library object

Definition at line 1154 of file grima-lib.php.

1155 {
1156 $ret = $this->get(
1157 '/almaws/v1/conf/libraries/{libraryCode}',
1158 array('libraryCode' => $libraryCode),
1159 array()
1160 );
1161 $this->checkForErrorMessage($ret);
1162 return $ret;
1163 }

References checkForErrorMessage().

◆ getLocation()

Grima::getLocation (   $libraryCode,
  $locationCode 
)

Retrieve Location - retrieve a Library Location from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/conf/libraries/{libraryCode}/locations/{locationCode}
Parameters
string $libraryCode ID of the library to retrieve
Returns
DomDocument Library object

Definition at line 1237 of file grima-lib.php.

1238 {
1239 $ret = $this->get(
1240 '/almaws/v1/conf/libraries/{libraryCode}/locations/{locationCode}',
1241 array(
1242 'libraryCode' => $libraryCode,
1243 'locationCode' => $locationCode,
1244 ),
1245 array()
1246 );
1247 $this->checkForErrorMessage($ret);
1248 return $ret;
1249 }

References checkForErrorMessage().

◆ getSet()

Grima::getSet (   $set_id )

Retrieve a Set - retrieve a Set from Alma.

Makes a call to the API: (API docs)

GET /almaws/v1/conf/sets/{set_id}
Parameters
string $set_id ID of the set to retrieve
Returns
DomDocument Set object

Definition at line 1277 of file grima-lib.php.

1278 {
1279 $ret = $this->get(
1280 '/almaws/v1/conf/sets/{set_id}',
1281 array('set_id' => $set_id),
1282 array()
1283 );
1284 $this->checkForErrorMessage($ret);
1285 return $ret;
1286 }

References checkForErrorMessage().

◆ getSetMembers()

Grima::getSetMembers (   $set_id,
  $limit = 10,
  $offset = 0 
)

get the members of a set, IF IT WORKS?!?!

Makes a call to the API: (API docs)

GET /almaws/v1/conf/sets/{set_id}/members
Parameters
string $set_id Set ID
number $limit How many to return at most (default 10)
number $offset Where to start from, for continuation (default 0, the beginning)

Definition at line 1431 of file grima-lib.php.

1432 {
1433 $ret = $this->get(
1434 '/almaws/v1/conf/sets/{set_id}/members',
1435 array('set_id' => $set_id),
1436 array('limit' => $limit, 'offset' => $offset)
1437 );
1438 $this->checkForErrorMessage($ret);
1439 return $ret;
1440 }

References checkForErrorMessage().

◆ post()

Grima::post (   $url,
  $URLparams,
  $QSparams,
  $body 
)

general function for POST (create) API calls

Parameters
string $url - URL pattern string with parameters in {}
array $URLparams - URL parameters
array $QSparams - query string parameters
DomDocument $body - object to add to Alma
Returns
DomDocument $body - object as it now appears in Alma

Definition at line 314 of file grima-lib.php.

315 {
316 return $this->request("POST", $url, $URLparams, $QSparams, $body);
317 }

References request().

Referenced by createSetFromImport(), postBib(), postElectronicPortfolio(), postElectronicPortfolioOnBib(), postHolding(), postItem(), postJob(), postSet(), and postSetManageMembers().

◆ postBib()

Grima::postBib (   $bib )

Create Record - adds a new bib record to Alma.

Makes a call to the API: (API docs)

POST /almaws/v1/bibs
https://developers.exlibrisgroup.com/alma/apis/bibs#Resources
Parameters
DomDocument $bib Bib object to add to Alma as new record
Returns
DomDocument Bib object as it now appears in Alma https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 418 of file grima-lib.php.

419 {
420 $ret = $this->post(
421 '/almaws/v1/bibs',
422 array(),
423 array(),
424 $bib
425 );
426 $this->checkForErrorMessage($ret);
427 return $ret;
428 }

References checkForErrorMessage(), and post().

◆ postElectronicPortfolio()

Grima::postElectronicPortfolio (   $collection_id,
  $service_id,
  $portfolio 
)

Create Electronic Portfolio - add a new portfolio to Alma.

Makes a call to the API: (API docs)

POST /almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios/
Parameters
string $collection_id ID of collection
string $service_id ID of service
string $portfolio A portfolio object to add to Alma
Returns
DomDocument Electronic Portfolio object as it appears in Alma

Definition at line 908 of file grima-lib.php.

909 {
910 $ret = $this->post(
911 '/almaws/v1/electronic/e-collections/{collection_id}/e-services/{service_id}/portfolios',
912 array('collection_id' => $collection_id, 'service_id' => $service_id),
913 array(),
914 $portfolio
915 );
916 $this->checkForErrorMessage($ret);
917 return $ret;
918 }

References checkForErrorMessage(), and post().

◆ postElectronicPortfolioOnBib()

Grima::postElectronicPortfolioOnBib (   $mms_id,
  $portfolio,
  $update = true 
)

Create Electronic Portfolio - add a new portfolio to Alma Bib.

Makes a call to the API: (API docs)

POST /almaws/v1/bibs/{mms_id}/portfolios/
Parameters
string $mms_id ID of bib
ElectronicPortfolio $portfolio portfolio to add
string $mms_id ID of bib
Returns
DomDocument Electronic Portfolio object as it appears in Alma

Definition at line 935 of file grima-lib.php.

936 {
937 $ret = $this->post(
938 '/almaws/v1/bibs/{mms_id}/portfolios/',
939 array('mms_id' => $mms_id),
940 array(),
941 $portfolio
942 );
943 $this->checkForErrorMessage($ret);
944 if ($update) {
945 $portfolio->loadXML($ret->saveXML());
946 }
947 return $ret;
948 }

References checkForErrorMessage(), and post().

◆ postHolding()

Grima::postHolding (   $mms_id,
  $holding 
)

Create holding record - add a new holdings record to a bib.

Makes a call to the API: (API docs)

POST /almaws/v1/bibs/{mms_id}/holdings
Parameters
string $mms_id MMS ID of bib record
DomDocument $holding Holding object to add to Alma as new record
Returns
DomDocument Holding object as it now appears in Alma https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 572 of file grima-lib.php.

573 {
574 $ret = $this->post(
575 '/almaws/v1/bibs/{mms_id}/holdings',
576 array('mms_id' => $mms_id),
577 array(),
578 $holding
579 );
580 $this->checkForErrorMessage($ret);
581 return $ret;
582 }

References checkForErrorMessage(), and post().

◆ postItem()

Grima::postItem (   $mms_id,
  $holding_id,
  $item 
)

Create Item - add a new item to a holding in Alma.

Makes a call to the API: (API docs)

POST /almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items
Parameters
string $mms_id - MMS ID of Bib record
string $holding_id - Holding ID of Holding record
DomDocument $item - Item object to add to Alma as new record
Returns
DomDocument Bib object as it now appears in Alma https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 758 of file grima-lib.php.

759 {
760 $ret = $this->post(
761 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items',
762 array('mms_id' => $mms_id, 'holding_id' => $holding_id),
763 array(),
764 $item
765 );
766 $this->checkForErrorMessage($ret);
767 return $ret;
768 }

References checkForErrorMessage(), and post().

◆ postJob()

Grima::postJob (   $job_id,
  $op,
  $job 
)

Submit a manual or scheduled job.

Makes a call to the API: (API docs)

POST /almaws/v1/conf/jobs/{job_id}
Parameters
string $job_id of job to run
op $op operation to perform
DomDocument $job job to run
Returns
DomDocument ??

Definition at line 1494 of file grima-lib.php.

1495 {
1496 $ret = $this->post(
1497 '/almaws/v1/conf/jobs/{job_id}',
1498 array('job_id' => $job_id),
1499 array('op' => $op),
1500 $job
1501 );
1502 $this->checkForErrorMessage($ret);
1503 return $ret;
1504 }

References checkForErrorMessage(), and post().

◆ postSet()

Grima::postSet (   $set )

Create a Set - add a new set to Alma.

Makes a call to the API: (API docs)

POST /almaws/v1/conf/sets
Returns
DomDocument Set object

Definition at line 1300 of file grima-lib.php.

1301 {
1302 $ret = $this->post(
1303 '/almaws/v1/conf/sets/',
1304 array(),
1305 array(),
1306 $set
1307 );
1308 $this->checkForErrorMessage($ret);
1309 return $ret;
1310 }

References checkForErrorMessage(), and post().

◆ postSetManageMembers()

Grima::postSetManageMembers (   $set_id,
  $id_type,
  $op,
  $set 
)

Manage Members - modify sets in Alma.

Makes a call to the API: (API docs)

POST /almaws/v1/conf/sets/{set_id}
Parameters
string $set_id ID of the set to retrieve
string $id_type type of identifier used to identify members
string $op operation to perform on the set
DomDocument $set to do the operation with
Returns
DomDocument Set object

Definition at line 1328 of file grima-lib.php.

1329 {
1330 $ret = $this->post(
1331 '/almaws/v1/conf/sets/{set_id}',
1332 array('set_id' => $set_id),
1333 array('id_type' => $id_type, 'op' => $op),
1334 $set
1335 );
1336 $this->checkForErrorMessage($ret);
1337 return $ret;
1338 }

References checkForErrorMessage(), and post().

◆ put()

Grima::put (   $url,
  $URLparams,
  $QSparams,
  $body 
)

general function for PUT (update) API calls

Parameters
string $url - URL pattern string with parameters in {}
array $URLparams - URL parameters
array $QSparams - query string parameters
DomDocument $body - record to update Alma record with
Returns
DomDocument - record as it now appears in Alma

Definition at line 330 of file grima-lib.php.

331 {
332 return $this->request("PUT", $url, $URLparams, $QSparams, $body);
333 }

References request().

Referenced by putBib(), putElectronicCollection(), putElectronicPortfolioOnBib(), putHolding(), and putItem().

◆ putBib()

Grima::putBib (   $mms_id,
  $bib 
)

Update Bib Record - updates the copy of the bib in Alma.

Makes a call to the API: (API docs)

PUT /almaws/v1/bibs/{mms_id}

Parameters
string $mms_id Alma Bib record to update
DomDocument $bib Bib to replace old record
Returns
DomDocument Bib object as it now appears in Alma https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 444 of file grima-lib.php.

445 {
446 $ret = $this->put(
447 '/almaws/v1/bibs/{mms_id}',
448 array('mms_id' => $mms_id),
449 array(),
450 $bib
451 );
452 $this->checkForErrorMessage($ret);
453 return $ret;
454 }
put($url, $URLparams, $QSparams, $body)
general function for PUT (update) API calls
Definition: grima-lib.php:330

References checkForErrorMessage(), and put().

◆ putElectronicCollection()

Grima::putElectronicCollection (   $collection_id,
  $collection 
)

Update Electronic Collection Record - updates the copy of the collection in Alma.

Makes a call to the API: (API docs)

PUT /almaws/v1/electronic/e-collections/{collection_id}

Parameters
string $collection_id Alma ElectronicCollection record to update
DomDocument $collection ElectronicCollection to replace old record
Returns
DomDocument ElectronicCollection object as it now appears in Alma https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 1091 of file grima-lib.php.

1092 {
1093 $ret = $this->put(
1094 '/almaws/v1/electronic/e-collections/{collection_id}',
1095 array('collection_id' => $collection_id),
1096 array(),
1097 $collection
1098 );
1099 $this->checkForErrorMessage($ret);
1100 return $ret;
1101 }

References checkForErrorMessage(), and put().

◆ putElectronicPortfolioOnBib()

Grima::putElectronicPortfolioOnBib (   $mms_id,
  $portfolio_id,
  $portfolio 
)

Update Electronic Portfolio - update portfolio in Alma.

Makes a call to the API: (API docs)

PUT /almaws/v1/bibs/{mms_id}/portfolios/{portfolio_id}
Parameters
string $mms_id ID of bibliographic record
string $portfolio_id ID of portfolio
Returns
DomDocument Electronic Portfolio object as it appears in Alma

Definition at line 964 of file grima-lib.php.

965 {
966 $ret = $this->put(
967 '/almaws/v1/bibs/{mms_id}/portfolios/{portfolio_id}',
968 array('mms_id' => $mms_id, 'portfolio_id' => $portfolio_id),
969 array(),
970 $portfolio
971 );
972 $this->checkForErrorMessage($ret);
973 return $ret;
974 }

References checkForErrorMessage(), and put().

◆ putHolding()

Grima::putHolding (   $mms_id,
  $holding_id,
  $holding 
)

Update Holdings Record - replace the holdings record in Alma.

Makes a call to the API: (API docs)

PUT /almaws/v1/bibs/{mms_id}/holdings/{holding_id}
Parameters
string $mms_id MMS ID of Bib
string $holding_id Holding ID of holding to replace
DomDocument $holding Holding object to add to Alma as new record
Returns
DomDocument Bib object as it now appears in Alma https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 599 of file grima-lib.php.

600 {
601 $ret = $this->put(
602 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}',
603 array('mms_id' => $mms_id, 'holding_id' => $holding_id),
604 array(),
605 $holding
606 );
607 $this->checkForErrorMessage($ret);
608 return $ret;
609 }

References checkForErrorMessage(), and put().

◆ putItem()

Grima::putItem (   $mms_id,
  $holding_id,
  $item_pid,
  $item 
)

Update Item information - replace item record in Alma.

Makes a call to the API: (API docs)

PUT /almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items/{item_pid}
Parameters
string $mms_id MMS ID of Bib record
string $holding_id Holding ID of Holding record
string $item_pid Item ID of Item record
DomDocument $item Item object to update record with in Alma
Returns
DomDocument Bib object as it now appears in Alma https://developers.exlibrisgroup.com/alma/apis/xsd/rest_bib.xsd?tags=GET

Definition at line 786 of file grima-lib.php.

787 {
788 $ret = $this->put(
789 '/almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items/{item_pid}',
790 array('mms_id' => $mms_id, 'holding_id' => $holding_id, 'item_pid' => $item_pid),
791 array(),
792 $item
793 );
794 return $ret;
795 }

References put().

◆ request()

Grima::request (   $method,
  $url,
  $URLparams,
  $QSparams,
  $body = null 
)

general function for REST API calls

Parameters
string $method - GET, POST, PUT, or DELETE
string $url - URL pattern string with parameters in {}
array $URLparams - URL parameters
array $QSparams - query string parameters
array $body - body content (xml)
Returns
DomDocument of requested record

Definition at line 171 of file grima-lib.php.

172 {
173 $headers = array(
174 'Authorization: apikey ' . urlencode($this->apikey),
175 "Accept: application/xml",
176 );
177
178 // Change "/almaws/v1/users/{user_id}" to "/almaws/v1/users/${URLparams['user_id']}"
179 foreach ($URLparams as $k => $v) {
180 if (!$v) {
181 throw new Exception("URL parameter $k is empty in $method $url");
182 }
183 $url = str_replace('{'.$k.'}', urlencode($v), $url);
184 }
185
186 // Include APIKey in url
187 $url = $this->server . $url . '?apikey=' . urlencode($this->apikey) . '&format=xml';
188
189 // Include query string parameters too
190 foreach ($QSparams as $k => $v) {
191 $url .= "&$k=" . urlencode($v);
192 }
193
194 // Include XML based body as well
195 // XXX: detect if JSON is more appropriate?
196 if ($body) {
197 $bodyxml = $body->saveXML();
198 $headers[] = 'Content-Type: application/xml';
199 }
200
201 $ch = curl_init();
202 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
203 curl_setopt($ch, CURLOPT_URL, $url);
204 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
205 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
206
207 $headerCapture = new HeaderCapture();
208 curl_setopt($ch, CURLOPT_HEADERFUNCTION, [&$headerCapture,"capture"]);
209
210 // ExLibris / Debian interoperability problem
211 // https://github.com/openssl/openssl/issues/7126
212 // error_log("OPENSSL_VERSION_NUMBER=" .dechex(OPENSSL_VERSION_NUMBER));
213 // 0x01000214f on reclaim
214 if (OPENSSL_VERSION_NUMBER >= 0x010101000) {
215 // debian 10 workaround until Ex Libris patches their servers
216 curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, "DEFAULT@SECLEVEL=1");
217 }
218
219
220 if (isset($bodyxml)) {
221 curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyxml);
222 }
223 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
224
225 /* XXX: DEBUG */
226 $today = date("Y-m-d-H_i_s");
227 $debug = fopen("/tmp/grima/debug/curl-$today.log", 'a+');
228 fwrite(
229 $debug, serialize(
230 [
231 "REQUEST_URI"=>isset($_SERVER["REQUEST_METHOD"])?($_SERVER["REQUEST_METHOD"]." ".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]):"cli",
232 "_REQUEST"=>$_REQUEST,
233 "request_body"=>$body,
234 ]
235 )
236 ."\n"
237 );
238
239 curl_setopt($ch, CURLOPT_VERBOSE, true);
240 curl_setopt($ch, CURLOPT_STDERR, $debug);
241 /* */
242
243 $response = curl_exec($ch);
244 // error_log( print_r($headerCapture,true) );
245 /* */
246 fwrite($debug, serialize(["response"=>$response])."\n\n");
247 fclose($debug);
248 /* */
249
250 $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
251 if (curl_errno($ch)) {
252 throw new Exception("Network error: " . curl_error($ch));
253 }
254 curl_close($ch);
255 if ($code == 204) {
256 return; // no body
257 }
258
259 $xml = new DOMDocument();
260 $xml->formatOutput = true;
261 try {
262 if (preg_match(',^application/json,', $headerCapture->headers['content-type'])) {
263 $array = json_decode($response, true);
264 $xml->loadXML('<?xml version="1.0"?' . '><json/>');
265 arrayToXml($array, $xml->documentElement);
266 } else if (!preg_match('/^</', $response)) {
267 $xml->loadXML(
268 '<?xml version="1.0"?' . '><html><body><h1>Not xml</h1><pre>'
269 . htmlspecialchars($response).
270 '</pre></body></html>'
271 );
272 } else {
273 $xml->loadXML($response);
274 }
275 } catch (Exception $e) {
276 throw new Exception("Malformed XML from Alma:\n$method $url -> $code\n$e");
277 }
278
279 $xml->rawText = $response;
280 $xml->httpCode = $code;
281 $xml->headers = $headerCapture->headers;
282 $xml->rawHeaders = $headerCapture->rawHeaders;
283
284 return $xml;
285 }
arrayToXml($array, &$xml)
Definition: grima-util.php:77

References arrayToXml().

Referenced by delete(), get(), post(), and put().

◆ sessionDestroy()

Grima::sessionDestroy ( )

Definition at line 95 of file grima-lib.php.

96 {
97 $session_module_name = getenvWithFileFallbackAndDefault(
98 'SESSION_MODULE', 'encrypted_cookie'
99 );
100 if ($session_module_name === "none") {
101 return;
102 }
103 $_SESSION = [];
104 if (ini_get("session.use_cookies")) {
105 $params = session_get_cookie_params();
106 $params['expires'] = time() - 42000;
107 unset($params['lifetime']);
108 setcookie(session_name(), '', $params);
109 }
110 $this->sessionInit(true);
111 $_SESSION = [];
112 session_destroy();
113 }

References getenvWithFileFallbackAndDefault(), and sessionInit().

◆ sessionInit()

Grima::sessionInit (   $force = false )

Definition at line 37 of file grima-lib.php.

38 {
39 // Session Module
40 $session_module_name = getenvWithFileFallbackAndDefault(
41 'SESSION_MODULE',
42 'encrypted_cookie'
43 );
44 if ($session_module_name=="none") {
45 return;
46 } else if ($session_module_name=="encrypted_cookie") {
47 $session_key = base64_decode(
49 'SESSION_KEY', "base64EncodedGrimaKeyOf32BytesTotallyRandom="
50 )
51 );
52 session_set_save_handler(new EncryptedCookieSession($session_key));
53 ini_set("session.use_cookies", false);
54 } else if ($session_module_name) {
55 $new_name = session_module_name($session_module_name);
56 if ($new_name != $session_module_name) {
57 session_name("grima_failsafe");
58 session_start();
59 return;
60 }
61 }
62 // Session Name
63 $session_name = getenvWithFileFallbackAndDefault('SESSION_NAME', 'grima');
64 session_name($session_name);
65 // Session Path
67 'SESSION_PATH', join_paths(sys_get_temp_dir(), 'grima')
68 );
69 if (session_module_name()==='files') {
70 @mkdir($session_path, 0700, true);
71 }
72 session_save_path($session_path);
73 // Session lifetime
74 session_set_cookie_params(365*24*60*60); // one year
75 ini_set('session.gc_maxlifetime', 525600*60); // of love
76 // Start session
77 session_start();
78 }
join_paths(... $paths)
Definition: grima-util.php:156

References getenvWithFileFallbackAndDefault(), and join_paths().

Referenced by __construct(), sessionDestroy(), and sessionSave().

◆ sessionSave()

Grima::sessionSave (   $result )

Definition at line 80 of file grima-lib.php.

81 {
82 $session_module_name = getenvWithFileFallbackAndDefault(
83 'SESSION_MODULE', 'encrypted_cookie'
84 );
85 if ($session_module_name === "none") {
86 return;
87 }
88 $this->sessionInit(true);
89 foreach ($result as $key => $value) {
90 $_SESSION[$key] = $value;
91 }
92 session_write_close();
93 }

References getenvWithFileFallbackAndDefault(), and sessionInit().

Member Data Documentation

◆ $apikey

Grima::$apikey

Definition at line 33 of file grima-lib.php.

Referenced by __construct().

◆ $server

Grima::$server

Definition at line 32 of file grima-lib.php.

Referenced by __construct().


The documentation for this class was generated from the following file: