{"id":15096763,"url":"https://github.com/apache/predictionio-sdk-php","last_synced_at":"2025-10-08T00:31:59.879Z","repository":{"id":7401544,"uuid":"8731831","full_name":"apache/predictionio-sdk-php","owner":"apache","description":"PredictionIO PHP SDK","archived":true,"fork":false,"pushed_at":"2021-01-27T19:07:00.000Z","size":154,"stargazers_count":267,"open_issues_count":3,"forks_count":55,"subscribers_count":34,"default_branch":"develop","last_synced_at":"2024-12-21T02:22:30.695Z","etag":null,"topics":["big-data","predictionio","scala"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-12T15:56:47.000Z","updated_at":"2024-11-27T16:15:38.000Z","dependencies_parsed_at":"2022-09-02T17:02:50.270Z","dependency_job_id":null,"html_url":"https://github.com/apache/predictionio-sdk-php","commit_stats":null,"previous_names":["apache/attic-predictionio-sdk-php"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpredictionio-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpredictionio-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpredictionio-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpredictionio-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/predictionio-sdk-php/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235669382,"owners_count":19026815,"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":["big-data","predictionio","scala"],"created_at":"2024-09-25T16:01:30.152Z","updated_at":"2025-10-08T00:31:54.611Z","avatar_url":"https://github.com/apache.png","language":"PHP","readme":"# Apache PredictionIO PHP SDK\n\n[![Build\nStatus](https://travis-ci.org/apache/predictionio-sdk-php.svg?branch=develop)](https://travis-ci.org/apache/predictionio-sdk-php)\n\n## Prerequisites\n\n* PHP 5.6+ (http://php.net/)\n* PHP: cURL (http://php.net/manual/en/book.curl.php)\n* Phing (http://www.phing.info/)\n* ApiGen (http://apigen.org/)\n\nNote: This SDK only supports Apache PredictionIO version 0.8.2 or higher.\n\n## Getting Started\n\nThe easiest way to install PredictionIO PHP client is to use\n[Composer](http://getcomposer.org/).\n\n1. `predictionio` is available on [Packagist](https://packagist.org) and can be\ninstalled using [Composer](https://getcomposer.org/):\n\n        composer require predictionio/predictionio\n\n2. Include Composer's autoloader in your PHP code\n\n        require_once(\"vendor/autoload.php\");\n\n## Usage\n\nThis package is a web service client based on Guzzle.\nA few quick examples are shown below.\n\n### Instantiate PredictionIO API Event Client\n\n```PHP\nuse predictionio\\EventClient;\n$accessKey = 'j4jIdbq59JsF2f4CXwwkIiVHNFnyNvWXqMqXxcIbQDqFRz5K0fe9e3QfqjKwvW3O';\n$client = new EventClient($accessKey, 'http://localhost:7070');\n```\n\n### Set a User Record from Your App\n\n```PHP\n// assume you have a user with user ID 5\n$response = $client-\u003esetUser(5);\n```\n\n\n### Set an Item Record from Your App\n\n```PHP\n// assume you have a book with ID 'bookId1' and we assign 1 as the type ID for book\n$response = $client-\u003esetItem('bookId1', array('itypes' =\u003e 1));\n```\n\n\n### Import a User Action (View) form Your App\n\n```PHP\n// assume this user has viewed this book item\n$client-\u003erecordUserActionOnItem('view', 5, 'bookId1');\n```\n\n\n### Retrieving Prediction Result\n\n```PHP\n// assume you have created an itemrank engine on localhost:8000\n// we try to get ranking of 5 items (item IDs: 1, 2, 3, 4, 5) for a user (user ID 7)\n\n$engineClient = new EngineClient('http://localhost:8000');\n$response = $engineClient-\u003esendQuery(array('uid'=\u003e7, 'iids'=\u003earray(1,2,3,4,5)));\n\nprint_r($response);\n```\n\n## Bugs and Feature Requests\n\nUse [Apache JIRA](https://issues.apache.org/jira/browse/PIO) to report bugs or\nrequest new features.\n\n## Community\n\nKeep track of development and community news.\n\n*   Subscribe to the [user mailing\n    list](mailto:user-subscribe@predictionio.apache.org) and the [dev mailing\n    list](mailto:dev-subscribe@predictionio.apache.org).\n*   Follow [@PredictionIO](https://twitter.com/PredictionIO) on Twitter.\n\n## Contributing\n\nRead the [Contribute\nCode](http://predictionio.apache.org/community/contribute-code/) page.\n\n## License\n\nApache PredictionIO is under [Apache 2\nlicense](http://www.apache.org/licenses/LICENSE-2.0.html).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fpredictionio-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fpredictionio-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fpredictionio-sdk-php/lists"}