{"id":21426097,"url":"https://github.com/bcdh/laravel-exist-db-client","last_synced_at":"2025-07-14T10:30:37.061Z","repository":{"id":56950570,"uuid":"56503499","full_name":"BCDH/Laravel-eXist-db-Client","owner":"BCDH","description":"A Laravel 5 package that abstracts out the XML RPC calls for eXist-db","archived":false,"fork":false,"pushed_at":"2016-11-29T17:25:24.000Z","size":33,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-24T12:26:46.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BCDH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-18T11:50:00.000Z","updated_at":"2019-08-20T05:47:33.000Z","dependencies_parsed_at":"2022-08-21T03:40:19.982Z","dependency_job_id":null,"html_url":"https://github.com/BCDH/Laravel-eXist-db-Client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2FLaravel-eXist-db-Client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2FLaravel-eXist-db-Client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2FLaravel-eXist-db-Client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2FLaravel-eXist-db-Client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BCDH","download_url":"https://codeload.github.com/BCDH/Laravel-eXist-db-Client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225970065,"owners_count":17553391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T21:39:56.208Z","updated_at":"2024-11-22T21:39:56.668Z","avatar_url":"https://github.com/BCDH.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"eXist-db Client for Laravel 5\n=================================\n\nA Laravel 5 package that abstracts out the XML RPC calls for [eXist-db](http://exist-db.org/exist/apps/homepage/index.html). Based on [php-eXist-db-Client](https://github.com/CuAnnan/php-eXist-db-Client).\n\n##  Requirements:\n\n- Laravel 5\n- PHP 5.5 or PHP 7\n- PEAR 1.10\n```bash\nsudo apt-get install php-pear\nsudo pear channel-update pear.php.net\n```\n- PHP XSLT extension\n```bash\nsudo apt-get install php5-xsl\n```\n\n## Installing\n\n####1. Add the service provider to your config/app.php:\n\n    BCDH\\ExistDbClient\\ExistDbServiceProvider::class\n\n####2. Publish your configuration file:\n    \n    php artisan vendor:publish\n    \n####3. Edit your connection credentials in `config/exist-db.php`\n\n    [\n        'protocol'  =\u003e \"http\",\n        'user'      =\u003e \"admin\",\n        'password'  =\u003e \"admin\",\n        'host'      =\u003e \"localhost\",\n        'port'      =\u003e 8080,\n        'path'      =\u003e \"/exist/xmlrpc/\",\n    ]\n    \n\n## Usage \n\n\n```php\nuse BCDH\\ExistDbClient\\ExistDbClient;\n\n$connection = new ExistDbClient();\n\n$stmt = $connection-\u003eprepareQuery('for $someNode in collection(\"/SomeCollection\")/someNodeName[./somePredicateAttribute=$someValueToBeBound] return $someNode');\n$stmt-\u003esetSimpleXMLReturnType();\n$stmt-\u003ebindVariable('someValueToBeBound', '5');\n\n$resultPool = $stmt-\u003eexecute();\n$result = $resultPool-\u003egetAllResults();\n\nforeach($result as $xml) {    \n    var_dump($xml-\u003esomePredicateAttribute);\n}\n```\n\n## Return types\n\n- Query::setStringReturnType()\n    result is instance of [DOMElement](http://php.net/manual/en/class.domelement.php)\n\n- Query::setSimpleXMLReturnType()\n    result is instance of [SimpleXMLElement](http://php.net/manual/en/class.simplexmlelement.php)\n\n- Query::setDomXMLReturnType()\n    result is string\n\n#### Get result field\n\n- DomXmlResult\n```php\n$document = $result-\u003egetDocument();\n$title = $doc-\u003egetElementsByTagName('TITLE')-\u003eitem(0)-\u003enodeValue;\n```\n\n- SimpleXML\n```php\n$document = $result-\u003egetDocument();\n$title = $doc-\u003eTITLE;\n```\n\n#### Get result attribute\n\n- DomXmlResult\n```php\n$document = $result-\u003egetDocument();\n$isFavorite = $doc-\u003ehasAttribute('favourite');\n```\n\n- SimpleXML\n```php\n$document = $result-\u003egetDocument();\n$attributes = $document-\u003eattributes();\n$isFavorite = isset($attributes['favourite']);\n```\n\n## XLS transformations\n\n- Single result (DomXmlResult|SimpleXmlResult)\n\n```php\n$resultPool = $stmt-\u003eexecute();\n$results = $resultPool-\u003egetAllResults();\n$res = $results[0];\n\n$html = $res-\u003etransform(__DIR__.'/xml/cd_catalog_simplified.xsl');\n```\n\n- ResultSet\n\n```php\n$resultPool = $stmt-\u003eexecute();\n$results = $resultPool-\u003egetAllResults();\n$rootTagName = 'catalog';\n\n$html = $resultPool-\u003etransform($rootTagName, $results, __DIR__.'/xml/cd_catalog_simplified.xsl');\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcdh%2Flaravel-exist-db-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcdh%2Flaravel-exist-db-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcdh%2Flaravel-exist-db-client/lists"}