ubc / ltcommons
UBC LT Commons
0.1.1
2016-04-22 07:53 UTC
Requires
- php: >=5.3.9 <7
- doctrine/collections: ~1.2
- guzzlehttp/guzzle: 5.0.*
- jms/serializer: ~1.1.0
- pear-pear.php.net/xml_rpc: 1.5.5
- symfony/config: 2.8.4
- symfony/filesystem: 2.8.4
Requires (Dev)
- phpunit/phpunit: 4.3.*
This package is not auto-updated.
Last update: 2025-01-01 16:22:02 UTC
README
Install
composer require ubc/ltcommons
Usage
Plain PHP
require 'vendor/autoload.php'; // Bootstrap the JMS custom annotations for Object to Json mapping \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace( 'JMS\Serializer\Annotation', dirname(__FILE__).'/vendor/jms/serializer/src' ); $base_url = 'http://sisapi.example.com'; $username = 'service_username'; $password = 'service_password'; $providerFactory = new DataProviderFactory(); $providerFactory->addProvider(new SISDataProvider( $base_url, new GuzzleClient(), new HttpBasic($username, $password), new JMSSerializer() )); $service = new DepartmentCodeService($providerFactory); $codes = $service->getDepartmentCodes(); $student = $service->getStudentById('12345678');
Using with Symfony 2
Please checkout LtCommons bundle
Run Tests
composer install
vendor/bin/phpunit