{"id":21169147,"url":"https://github.com/cosmicjs/cosmicjs-php","last_synced_at":"2025-07-09T18:31:49.691Z","repository":{"id":35276967,"uuid":"39537760","full_name":"cosmicjs/cosmicjs-php","owner":"cosmicjs","description":"The official PHP client for Cosmic JS. This module will help you easily add dynamic content to your website or application.","archived":false,"fork":false,"pushed_at":"2016-01-22T07:26:16.000Z","size":904,"stargazers_count":7,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T05:11:32.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cosmicjs.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmicjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-23T00:54:35.000Z","updated_at":"2019-04-09T04:34:24.000Z","dependencies_parsed_at":"2022-09-07T03:21:36.272Z","dependency_job_id":null,"html_url":"https://github.com/cosmicjs/cosmicjs-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cosmicjs/cosmicjs-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcosmicjs-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcosmicjs-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcosmicjs-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcosmicjs-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmicjs","download_url":"https://codeload.github.com/cosmicjs/cosmicjs-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcosmicjs-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502387,"owners_count":23618587,"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-20T15:24:19.151Z","updated_at":"2025-07-09T18:31:49.404Z","avatar_url":"https://github.com/cosmicjs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Cosmic JS Logo](https://cosmicjs.com/images/marketing/logo-w-brand.jpg)](https://cosmicjs.com/)\n===\n\n### Getting started\nGo to [https://cosmicjs.com](https://cosmicjs.com), create an account and setup a bucket.\n\n### Install\n```\ngit clone https://github.com/cosmicjs/cosmicjs-php\n```\n### Usage\n```php\n\u003c?php\n/* !!!! CONFIGURE !!!!\n==================================== */\n$config = new stdClass();\n$config-\u003ebucket_slug = \"driver-example\"; // bucket slug\n$config-\u003eread_key = \"\"; // leave empty if not required\n$config-\u003ewrite_key = \"\"; // leave empty if not required\ninclude(\"cosmicjs.php\");\n\n/* Add\n================================= */\n$object_string = '{\n  \"type_slug\": \"pages\",\n  \"title\": \"Test Title\",\n  \"content\": \"here is some test content\",\n  \"write_key\": \"' . $config-\u003ewrite_key . '\"\n}';\n$object = $cosmicjs-\u003eaddObject($object_string);\n\n/* Edit\n================================= */\n$object_string = '{\n  \"slug\": \"test-title\",\n  \"title\": \"New Title\",\n  \"content\": \"here is some NEW test content\",\n  \"write_key\": \"' . $config-\u003ewrite_key . '\"\n}';\n$object = $cosmicjs-\u003eeditObject($object_string);\n\n/* Delete\n================================= */\n$object_string = '{\n  \"slug\": \"test-title\",\n  \"write_key\": \"' . $config-\u003ewrite_key . '\"\n}';\n$object = $cosmicjs-\u003edeleteObject($object_string);\n\n/* Get Objects\n================================= */\n$objects = $cosmicjs-\u003egetObjects();\n\n/* Get Media\n================================= */\n$media = $cosmicjs-\u003egetMedia();\n?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicjs%2Fcosmicjs-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmicjs%2Fcosmicjs-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicjs%2Fcosmicjs-php/lists"}