{"id":16948846,"url":"https://github.com/timoliver/cloudkit-php","last_synced_at":"2026-02-09T05:04:57.288Z","repository":{"id":46423191,"uuid":"417159707","full_name":"TimOliver/CloudKit-PHP","owner":"TimOliver","description":"For server-to-server comms from PHP to CloudKit.","archived":false,"fork":false,"pushed_at":"2024-12-03T13:34:13.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-26T06:25:39.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimOliver.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":"2021-10-14T14:20:57.000Z","updated_at":"2024-12-03T13:37:46.000Z","dependencies_parsed_at":"2022-09-06T03:02:03.145Z","dependency_job_id":null,"html_url":"https://github.com/TimOliver/CloudKit-PHP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCloudKit-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCloudKit-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCloudKit-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCloudKit-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimOliver","download_url":"https://codeload.github.com/TimOliver/CloudKit-PHP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776273,"owners_count":20508503,"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-10-13T21:52:32.233Z","updated_at":"2026-02-09T05:04:52.259Z","avatar_url":"https://github.com/TimOliver.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CloudKit-PHP\n\nToday I found this fantastic [gist](https://gist.github.com/Mauricevb/87c144cec514c5ce73bd) by [Mauricevb](https://gist.github.com/Mauricevb) that demonstrates how to communicate with CloudKit from PHP. I already had a previous project that used a backend similar to CloudKit so by replacing the web request code with his I've created this PHP library for CloudKit. It's very much a work in progress and it would be great if anyone could contribute to fill in the missing methods.\n\n## Status\n\nFetching, querying and saving records is partially working.\n\n## Development Resources\n\n[CloudKit JS Reference](https://developer.apple.com/library/ios/documentation/CloudKitJS/Reference/CloudKitJavaScriptReference/index.html#//apple_ref/doc/uid/TP40015359)\n\n[Accessing CloudKit Using a Server-to-Server Key](https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/SettingUpWebServices/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW6)\n\n[CloudKit Web Services Reference](https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40015240-CH1-SW1)\n\n\n## Example\n```php\n\u003c?php\nrequire dirname(__FILE__).'/autoload.php';\nuse CloudKit\\Container;\nuse CloudKit\\Record;\nuse CloudKit\\Query;\nuse CloudKit\\Location;\n\n$container = new Container('iCloud.com.container', // containerID\n  '9bbf2b399e9cd74x372bb4ec11cb5x1b7f0d73db16a24x08a018', // keyID, see Accessing CloudKit link above \n  'eckey.pem', // private key file, again see accessing CloudKit.\n  'development'); // environment\n\n$query = new Query(\"Venue\");\n//$query-\u003efilter('name', 'Java Earth');\n$query-\u003efilter('name', '=', 'Java Earth');\n//$query-\u003efilterIn('name', ['Java Earth']);\n$response = $container-\u003egetPublicCloudDatabase()-\u003eperformQuery($query, [ 'resultsLimit' =\u003e 1 ]);\n\nif($response-\u003ehasErrors()) {\n    echo $response-\u003egetErrors()[0]-\u003egetReason();\n    return;\n}\n\n$records = $response-\u003egetRecords();\n\n\n$record = NULL;\nif(count($records) \u003e 0) {\n    $record = $records[0];\n}else{\n    $record = new Record('Venue');\n}\n\n$record-\u003esetField('name', 'Java Earth');\n$record-\u003esetField('formattedAddress', '4978 Cass St, San Diego, CA 92109, United States');\n$record-\u003esetField('location', new Location(32.805509, -117.254510));\n$response2 = $container-\u003egetPublicCloudDatabase()-\u003esaveRecords([$record]);\nif($response2-\u003ehasErrors()) {\n    var_dump($response2-\u003egetErrors()[0]);\n}else{\n    echo \"Success\\n\";\n}\n\n?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoliver%2Fcloudkit-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimoliver%2Fcloudkit-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoliver%2Fcloudkit-php/lists"}