PHPackages                             uwdoem/person - 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. uwdoem/person

ActiveLibrary[API Development](/categories/api)

uwdoem/person
=============

Client library for the University of Washington Person and Student Web Services

1.5.1(8y ago)21.2k2[2 issues](https://github.com/UWEnrollmentManagement/Person/issues)[1 PRs](https://github.com/UWEnrollmentManagement/Person/pulls)1PHPCI failing

Since Aug 18Pushed 6y ago4 watchersCompare

[ Source](https://github.com/UWEnrollmentManagement/Person)[ Packagist](https://packagist.org/packages/uwdoem/person)[ RSS](/packages/uwdoem-person/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (27)Used By (1)

[![Build Status](https://camo.githubusercontent.com/fe7839bd3466e22f3406571020cdc382636bda70e80dc19f40a67a8d728b2213/68747470733a2f2f7472617669732d63692e6f72672f5557456e726f6c6c6d656e744d616e6167656d656e742f506572736f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/UWEnrollmentManagement/Person)[![Code Climate](https://camo.githubusercontent.com/f73aa5684368c30e80bd78628b8fe4ef103833cd7621f2bcaa7d9d797a65a794/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f5557456e726f6c6c6d656e744d616e6167656d656e742f506572736f6e2f6261646765732f6770612e737667)](https://codeclimate.com/github/UWEnrollmentManagement/Person)[![Test Coverage](https://camo.githubusercontent.com/0b562ff8f22ef01a0d9f8b87d7f2fd3d96cd268fe8a51e716514b8c2c99a3f83/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f5557456e726f6c6c6d656e744d616e6167656d656e742f506572736f6e2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/UWEnrollmentManagement/Person/coverage)[![Latest Stable Version](https://camo.githubusercontent.com/42758ebfabb3163fd7eba97dbad344bed6d3146de6f7af34781b35107e51a1b2/68747470733a2f2f706f7365722e707567782e6f72672f7577646f656d2f706572736f6e2f762f737461626c65)](https://packagist.org/packages/uwdoem/person)

UWDOEM/Person
=============

[](#uwdoemperson)

Smoothly poll the University of Washington's [Person Web Service](https://wiki.cac.washington.edu/display/pws/Person+Web+Service) (PWS) and [Student Web Service](https://wiki.cac.washington.edu/display/SWS/Student+Web+Service) (SWS) to aggregate data on a given affiliate, using X.509 certificate authentication.

For example:

```
    // Intialize the required settings
    define('UW_WS_BASE_PATH', '/path/to/my/private.key');
    define('UW_WS_SSL_KEY_PATH', '/path/to/my/private.key');
    define('UW_WS_SSL_CERT_PATH', '/path/to/my/public_cert.pem');
    define('UW_WS_SSL_KEY_PASSWD', 'myprivatekeypassword');  // Can be blank for no password: ''
    define('UW_WS_VERBOSE', false);  // (Optional) Whether to include verbose cURL messages in error messages.

    /* Query the web services */
    $student = Student::fromStudentNumber("1033334");

    echo $student->getAttr("RegisteredFirstMiddleName");
    // "JAMES AVERAGE"

    echo $student->getAttr("UWNetID");
    // "javerage"

    /* Retrieve registration for James Average*/
    $registrations = $student->registrationSearch("2009", "summer");
    echo $registrations[0]["CurriculumAbbreviation"];  // "TRAIN"
    echo $registrations[0]["CourseNumber"];  // "100"

    /* Retrieve employee information from the web services */
    $employee = Employee::fromUWNetID("jschilz");

    echo $employee->getAttr("Department1");
    // "Student Financial Aid Office"

    echo $employee->getAttr("Title1");
    // "Web Developer"

```

Notice
------

[](#notice)

This is *not* an official library, endorsed or supported by any party who manages or owns information accessed via PWS or SWS. This library is *not* endorsed or supported by the University of Washington Department of Enrollment Management.

Installation
------------

[](#installation)

This library is published on packagist. To install using Composer, add the `"uwdoem/person": "1.*"` line to your "require" dependencies:

```
{
    "require": {
        "uwdoem/person": "1.*"
    }
}

```

Of course it is possible to use *Person* without Composer by downloading it directly, but use of Composer to manage packages is highly recommended. See [Composer](https://getcomposer.org/) for more information.

Use
---

[](#use)

This client library provides four data-container classes: `Person`, `Student`, `Employee`, and `Alumni`.

If you have not already done so, follow PWS's instructions on [getting access to PWS](https://wiki.cac.washington.edu/display/pws/Getting+Access+to+PWS). A similar set of steps will allow you to [gain access to SWS](https://wiki.cac.washington.edu/display/SWS/Getting+Access+to+SWS). You'll need to place both the private private key you created and also the university-signed certificate on your web server, with read-accessibility for your web-server process.

Before querying the web services, you must first initialize the connection by calling `::createInstance`:

```
    // Intialize the required settings
    define('UW_WS_BASE_PATH', '/path/to/my/private.key');
    define('UW_WS_SSL_KEY_PATH', '/path/to/my/private.key');
    define('UW_WS_SSL_CERT_PATH', '/path/to/my/public_cert.pem');
    define('UW_WS_SSL_KEY_PASSWD', 'myprivatekeypassword');  // Can be blank for no password: ''
    define('UW_WS_VERBOSE', false);  // (Optional) Whether to include verbose cURL messages in error messages.

```

The terms `UW_WS_SSL_KEY_PATH` and `UW_WS_SSL_CERT_PATH` correspond to the absolute locations of your private key and university-signed certificate. The `UW_WS_SSL_KEY_PASSWD` corresponds to the string which unlocks your private key; if your key does not have a password then use a blank string, eg: `''`.

The term `UW_WS_BASE_PATH` corresponds to the base URL shared by UW web services. Currently this is either `"https://ws.admin.washington.edu/"` for the production-access web services, or `"https://wseval.s.uw.edu/"` for the testing/development-access web services.

You may now issue queries against the web service:

```
    // Queries PWS/SWS for a student with StudentNumber "1033334".
    $student = Student::fromStudentNumber("1033334");

    // If no such student was found, then $student is null
    if ($student != null) {
        echo $student->getAttr("RegisteredFirstMiddleName");
    }

```

In the case above, there does exist a student with StudentNumber "1033334": one of the university's notional test students. So this script will output "JAMES AVERAGE".

The following methods may be used to query the database:

```
    // Available to Person, and all subclasses of Person
    $person = Person::fromUWNetID($uwnetid);
    $person = Person::fromUWRegID($uwregid);
    $person = Person::fromIdentifier("uwregid", $uwregid);
    $person = Person::fromIdentifier("uwnetid", $uwnetid);
    $person = Person::fromIdentifier("employee_id", $employeeid);
    $person = Person::fromIdentifier("student_number", $studentnumber);
    $person = Person::fromIdentifier("student_system_key", $studentsystemkey);
    $person = Person::fromIdentifier("development_id", $developmentid);

    // Available only to Student
    $student = Student::fromStudentNumber($studentnumber);
    $registrations = $student->registrationSearch($year, $quarter, [$extraSearchTerms]);

    // Available only to Employee
    $employee = Employee::fromEmployeeID($employeeid);

    // Available only to Alumni
    $alumni = Alumni::fromDevelopmentID($developmentid);

```

You can cast between classes each of the container classes' `::fromPerson` method:

```
    $person = Person::fromUWNetID($uwnetid);

    // Cast the Person object into a Student
    $person = Student::fromPerson($person);

```

The `::hasAffiliation` method can tell you whether a given person is a student, employee, and/or alumni:

```
    $person = Person::fromUWNetID($uwnetid);

    // The ::hasAffiliation method check is useful, but not required:
    if ($person->hasAffiliation("employee") {
        $person = Employee::fromPerson($person);
    }

```

Use `::getAttr` to retrieve an attribute from a person:

```
    $person = Person::fromUWNetID($uwnetid);
    $displayName = $person->getAttr("DisplayName");

    $person = Student::fromPerson($person);
    $academicDepartment = $person->getAttr("Department1");

```

The `Student::registrationSearch` method returns an array of [Registration Resources](https://wiki.cac.washington.edu/display/SWS/Registration+Resource+V5), in associative array format:

```
   $student = Student::fromStudentNumber("1033334");
   $registrations = $student->registrationSearch("2009", "summer");

   foreach ($registrations as $registration) {
       echo $registration["CurriculumAbbreviation"];
       echo $registration["CourseNumber"];
   }

```

You can include optional parameters in your registration search, per the [Registration Search Resource spec](https://wiki.cac.washington.edu/display/SWS/Registration+Search+Resource+v5):

```
    $student = Student::fromStudentNumber("1033334");
    $registrations = $student->registrationSearch("2009", "summer", ["is_active" => "true"]);

```

Exposed Attributes
------------------

[](#exposed-attributes)

The container classes expose the following attributes, corresponding to those described in [this PWS glossary](https://wiki.cac.washington.edu/display/pws/PWS+Attribute+Glossary):

```
    Exposed by all classes:
        "DisplayName"
        "IsTestEntity"
        "RegisteredFirstMiddleName"
        "RegisteredName"
        "RegisteredSurname"
        "UIDNumber"
        "UWNetID"
        "UWRegID"
        "WhitepagesPublish"

    Exposed only by Employee:
        "EmployeeID"
        "Address1"
        "Address2"
        "Department1"
        "Department2"
        "Email1"
        "Email2"
        "Fax"
        "Name"
        "Phone1"
        "Phone2"
        "PublishInDirectory"
        "Title1"
        "Title2"
        "TouchDial"
        "VoiceMail"

    Exposed only by Student:
        "StudentNumber"
        "StudentSystemKey"
        "Class"
        "Department1"
        "Department2"
        "Department3"
        "Email"
        "Name"
        "Phone"
        "PublishInDirectory"

    Exposed by Student, when SWS access is enabled:
        "RegID"
        "FirstName"
        "LastName"
        "StudentName"
        "EmployeeID"
        "BirthDate"
        "Gender"
        "DirectoryRelease"
        "LocalAddress"
            "Line1"
            "Line2"
            "City"
            "State"
            "Zip"
            "Country"
            "PostalCode"
        "PermanentAddress"
            "Line1"
            "Line2"
            "City"
            "State"
            "Zip"
            "Country"
            "PostalCode"
        "LocalPhone"
        "PermanentPhone"
        "Veteran"
            "Code"
            "Description"
        "LastEnrolled"
            "Href"
            "Year"
            "Quarter"
        "Notices"[]
            "RegID"
            "Href"
        "PersonFinancial"[]
            "RegID"
            "Href"
        "Resident"
        "VisaType"
        "TestScore"[]
            "RegID"
            "Href"

    Exposed only by Alumni:
        "DevelopmentID"

```

Troubleshooting
---------------

[](#troubleshooting)

This library *will* throw warnings and exceptions when it recognizes an error. Turn on error reporting to see these. For errors involving *cURL*, *SSL*, and or script execution halts/no output, see [UWEnrollmentManagement/Connection](https://github.com/UWEnrollmentManagement/Connection) troubleshooting.

Compatibility
-------------

[](#compatibility)

- Person Web Service v1
- Student Web Service v5

Requirements
------------

[](#requirements)

- PHP 7.0
- uwdoem/connection 3.\*

Todo
----

[](#todo)

See GitHub [issue tracker](https://github.com/UWEnrollmentManagement/Person/issues/).

Getting Involved
----------------

[](#getting-involved)

Feel free to open pull requests or issues. [GitHub](https://github.com/UWEnrollmentManagement/Person) is the canonical location of this project.

Here's the general sequence of events for code contribution:

1. Open an issue in the [issue tracker](https://github.com/UWEnrollmentManagement/Person/issues/).
2. In any order:

- Submit a pull request with a **failing** test that demonstrates the issue/feature.
- Get acknowledgement/concurrence.

3. Revise your pull request to pass the test in (2). Include documentation, if appropriate.

PSR-2 compliance is enforced by [CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) in Travis.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 95.3% 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 ~134 days

Total

26

Last Release

3101d ago

Major Versions

0.3.4 → 1.0.02015-12-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b43989ce7a387c05c59282788d15171a28abf61e02614a7a005cb19ef8da2b4?d=identicon)[JASchilz](/maintainers/JASchilz)

![](https://www.gravatar.com/avatar/290ab676b0d7a71324f5e5b1cd29b339cd379449c10bb721fd3f7d7d6b7571f1?d=identicon)[BonPacific](/maintainers/BonPacific)

![](https://www.gravatar.com/avatar/df9465816cfe9d8b479d9b7de09a7a3b8b8e493d4316b3143179bfaf4b8d53c4?d=identicon)[wizzah](/maintainers/wizzah)

---

Top Contributors

[![JASchilz](https://avatars.githubusercontent.com/u/6137968?v=4)](https://github.com/JASchilz "JASchilz (122 commits)")[![BonPacific](https://avatars.githubusercontent.com/u/3277713?v=4)](https://github.com/BonPacific "BonPacific (5 commits)")[![bonifacp](https://avatars.githubusercontent.com/u/30813483?v=4)](https://github.com/bonifacp "bonifacp (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/uwdoem-person/health.svg)

```
[![Health](https://phpackages.com/badges/uwdoem-person/health.svg)](https://phpackages.com/packages/uwdoem-person)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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