PHPackages                             multnomah-county-it/libilsws - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. multnomah-county-it/libilsws

ActiveLibrary[API Development](/categories/api)

multnomah-county-it/libilsws
============================

PHP package to support use of the SirsiDynix Symphony Web Services API (ILSWS)

v2.0.5(1mo ago)46571GPL-3.0-or-laterPHPPHP &gt;=5.6.0CI passing

Since Sep 10Pushed 1w ago2 watchersCompare

[ Source](https://github.com/multnomah-county-it/libilsws)[ Packagist](https://packagist.org/packages/multnomah-county-it/libilsws)[ RSS](/packages/multnomah-county-it-libilsws/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (10)Versions (43)Used By (0)

LibILSWS
========

[](#libilsws)

PHP package to support use of the SirsiDynix Symphony Web Services API (ILSWS) for patron functions

John Houser

---

Design Goals
============

[](#design-goals)

- Validate all inputs to public functions
- Produce clean, clear error messages
- Prevent or replace SirsiDynix error messages (which are sometimes obscure) as much as possible
- Provide easy, high-level functions for creating, modifying, searching for, and authenticating patrons
- Provide code examples for all functions
- Support easy reconfiguration without code changes to mirror changes to the Symphony configuration
- Support patron registrations or updates of any valid Symphony patron field without code changes
- Allow easy adaptation by other libraries

---

Public Functions
================

[](#public-functions)

Low-level
---------

[](#low-level)

These functions can be used with any valid ILSWS access point. They will throw exceptions on error.

- `connect()`
- `sendGet($url, $token, $params)`
- `sendQuery($url, $token, $queryJson, $queryType)`
- `validate($parameter, $value, $rule)`

---

Convenience Functions
---------------------

[](#convenience-functions)

These functions correspond with ILSWS access points, but they validate all inputs and will throw exceptions if presented with inappropriate inputs.

- `authenticatePatron($token, $patronId, $password)`
- `changeBarcode($token, $patronKey, $patronId, $options)`
    Options array may include: `role`, `clientId`
- `changeItemLibrary($token, $itemKey, $library)`
- `changePatronPassword($token, $json, $options)`
    Options array may include: `role`, `clientId`
- `deletePatron($token, $patronKey)`
- `describeBib($token)`
- `describeItem($token)`
- `describePatron($token)`
- `getExpiration($days)`
- `getPolicy($token, $policyKey)`
- `searchPatron($token, $index, $search, $params)`
- `searchPatronAltId($token, $altId, $count)`
- `searchPatronId($token, $patronId, $count)`
- `transitItem($token, $itemKey, $newLibrary, $workingLibrary)`
- `untransitItem($token, $itemId)`
- `updatePatronActivity($token, $patronId)`

---

High-level
----------

[](#high-level)

These functions offer functionality not directly supported by ILSWS by performing multiple queries or by combining, manipulating or evaluating data from the Symphony system.

- `addPatronCustomInfo($token, $patronKey, $key, $data)`
- `authenticatePatronId($token, $patronId, $password)`
- `checkDuplicate($token, $index1, $search1, $index2, $search2)`
- `delPatronCustomInfo($token, $patronKey, $key)`
- `emailTemplate($patron, $to, $from, $subject, $template)`
- `getBib($token, $bibKey, $fieldList)`
- `getBibCircInfo($token, $bibKey)`
- `getBibMarc($token, $bibKey)`
- `getCallNumber($token, $callKey, $fieldList)`
- `getCatalogIndexes($token)`
- `getHold($token, $holdKey)`
- `getItem($token, $itemKey, $fieldList)`
- `getItemCircInfo($token, $itemKey)`
- `getLibraryPagingList($token, $libraryKey)`
- `getPatronAttributes($token, $patronKey)`
- `getPatronCheckouts($token, $patronKey, $includeFields)`
- `getPatronCustomInfo($token, $patronKey, $key, $data)`
- `getPatronIndexes($token)`
- `modPatronCustomInfo($token, $patronKey, $key, $data)`
- `prepareSearch($terms)`
- `registerPatron($patron, $token, $addrNum, $options)`
    Options array may include: `role`, `clientId`, `template`, `subject`
- `resetPatronPassword($token, $patronId, $url, $email)`
    Optional: `email`
- `searchAuthenticate($token, $index, $search, $password)`
- `searchBib($token, $index, $value, $params)`
    Params array may include: `q`, `ct`, `rw`, `j`, `includeFields`
- `updatePatron($patron, $token, $patronKey, $addrNum)`
- `updatePatronActiveId($token, $patronKey, $patronId, $option)`
    Option may be: `a`, `i`, `d`
- `updatePhoneList($phoneList, $token, $patronKey, $options)`
    Options array may include: `role`, `clientId`

---

Date and Telephone Number Formats
---------------------------------

[](#date-and-telephone-number-formats)

For the convenience of developers, the code library accepts dates in the following formats, wherever a date is accepted as a parameter: YYYYMMDD, YYYY-MM-DD, YYYY/MM/DD, MM-DD-YYYY, or MM/DD/YYYY.

The validation rules for telephone numbers are currently set to expect a string of digits with no punctuation. However, it would be easy to modify the validation rules at the top of any public function to accept punctuation in telephone numbers.

---

Examples
--------

[](#examples)

### Initialize and Connect to ILSWS

[](#initialize-and-connect-to-ilsws)

```
require_once 'vendor/autoload.php';

// Initialize and load configuration from YAML configuration file
$ilsws = new Libilsws\Libilsws('./libilsws.yaml');

// Connect to ILSWS with configuration loaded from YAML file
$token = $ilsws->connect();

```

### Search for a Patron

[](#search-for-a-patron)

```
/**
 * Valid incoming params are:
 * ct            = number of results to return,
 * rw            = row to start on (so you can page through results),
 * j             = boolean AND or OR to use with multiple search terms, and
 * includeFields = fields to return in result.
 */

$index = 'EMAIL';
$search = 'john.houser@multco.us';

// Prepare search parameters, including fields to return
$options = [
    'rw' => 1,
    'ct' => 10,
    'j' => 'AND',
    'includeFields' => 'key,barcode']
    ];

// Run search
$response = $ilsws->searchPatron($token, $index, $search, $options);

```

### Get Patron Attributes

[](#get-patron-attributes)

```
$response = $ilsws->getPatronAttributes($token, $patronKey);

```

### Register New Patron

[](#register-new-patron)

```
/**
 * The order of the fields doesn't matter. Not all of these are actually required.
 * See the YAML configuration file to determine which fields are required. If an
 * email template name is included in the options array, an email will be sent to the
 * patron. Actual template files must include a language extension (for example .en for
 * English. The system will look for template that matches the patrons language
 * preference. If one is found, it will use that, otherwise it will attempt to
 * find and use an English template.
 */
$patron = [
    'birth_date' => '1962-03-07',
    'city_state' => 'Portland, OR',
    'county' => '0_MULT',
    'email' => 'johnchouser@gmail.com',
    'first_name' => 'Bogus',
    'friends_notices' => 'YES',
    'home_library' => 'CEN',
    'language' => 'ENGLISH',
    'last_name' => 'Bogart',
    'library_news' => 'YES',
    'middle_name' => 'T',
    'notice_type' => 'PHONE',
    'patron_id' => '21168045918653',
    'postal_code' => '97209',
    'street' => '925 NW Hoyt St Apt 406',
    'telephone' => '215-534-6821',
    'sms_phone' => [
        'number' => '215-534-6821',
        'countryCode' => 'US',
        'bills'       => true,
        'general'     => true,
        'holds'       => true,
        'manual'      => true,
        'overdues'    => true,
        ],
    ];

$addr_num = 1;

$options = [];
$options['role'] = 'STAFF';
$options['clientId'] = 'StaffClient';
$options['template'] = 'template.html.twig';
$options['subject'] = 'Welcome to the library!';

$response = $ilsws->register_patron($patron, $token, $addr_num, $options);

```

### Update Patron Record

[](#update-patron-record)

```
// Define patron array
$patron = [
    'first_name' => 'John',
    'middle_name' => 'Rad',
    'last_name' => 'Houser',
    'birth_date' => '1972-03-10',
    'home_library' => 'CEN',
    'county' => '0_MULT',
    'notice_type' => 'PHONE',
    'library_news' => 'YES',
    'friends_notices' => 'YES',
    'online_update' => 'YES',
    'street' => '925 NW Hoyt St Apt 606',
    'city_state' => 'Portland, OR',
    'patron_id' => '21168045918653',
    'postal_code' => '97208',
    'email' => 'john.houser@multco.us',
    'telephone' => '215-544-6941',
    'sms_phone' => [
        'number' => '215-544-6941',
        'countryCode => 'US',
        'bills'       => true,
        'general'     => true,
        'holds'       => true,
        'manual'      => true,
        'overdues'    => true,
        ],
    ];

$addrNum = 1;
$patronKey = '782339';

// Update the patron record
$response = $ilsws->updatePatron($patron, $token, $patronKey, $addrNum);

```

### Search for bibliographic records

[](#search-for-bibliographic-records)

```
/**
 * Convert UTF-8 characters with accents to ASCII and strip unwanted characters and
 * boolean operators from search terms
 */
$search = $ilsws->prepare_search($search);

// Prepare search parameters and choose fields to return
$params = [
    'ct'            => '50',
    'rw'            => '1',
    'j'             => 'AND',
    'includeFields' => 'author,title,bib{650_a,856_u},callList{callNumber,itemList{barcode,currentLocation}}'
    ];

// Run search
$response = $ilsws->searchBib($token, $index, $search, $params);

```

Notes on the includeFields parameter:

- To include MARC data by tag, add a bib item. For example, to get the 650 tag, subfield a, add: `bib{650_a}`
- To get a call number or any item from the item record, you must include a callList item. For example, add `callList{callNumber}`
- To get any field from the item record, you must include an itemList entry within the callList item. For example, to get a barcode, add `callList{itemList{barcode}}`

More Information
----------------

[](#more-information)

See the libilsws.yaml.sample file for field definitions and documentation of the YAML configuration options.

For a complete set of code examples see the example scripts in the `test` directory.

**Warning:** the test scripts may make real changes to the configured Symphony system. **Do not use on a production system without carefully reviewing what they do!**

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance96

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Recently: every ~67 days

Total

41

Last Release

32d ago

Major Versions

v1.4.4 → v2.02025-07-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/97397ecdcf744a490aff26213b0d22235f0b53ea86cc1c9728e5133b9b31dac3?d=identicon)[john-c-houser](/maintainers/john-c-houser)

---

Top Contributors

[![john-c-houser](https://avatars.githubusercontent.com/u/90853393?v=4)](https://github.com/john-c-houser "john-c-houser (468 commits)")[![Greg-Boggs](https://avatars.githubusercontent.com/u/653450?v=4)](https://github.com/Greg-Boggs "Greg-Boggs (5 commits)")[![gregb-multco](https://avatars.githubusercontent.com/u/186323186?v=4)](https://github.com/gregb-multco "gregb-multco (2 commits)")

---

Tags

apiilswslibraryphp-librarysirsidynixsymphonyweb-services

### Embed Badge

![Health badge](/badges/multnomah-county-it-libilsws/health.svg)

```
[![Health](https://phpackages.com/badges/multnomah-county-it-libilsws/health.svg)](https://phpackages.com/packages/multnomah-county-it-libilsws)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.8M211](/packages/simplesamlphp-simplesamlphp)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k16.8k](/packages/prestashop-prestashop)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
