{"id":19357738,"url":"https://github.com/joomla-framework/compat","last_synced_at":"2025-04-23T11:30:30.529Z","repository":{"id":7191584,"uuid":"8495150","full_name":"joomla-framework/compat","owner":"joomla-framework","description":"[DEPRECATED] Joomla Framework PHP Compatibility Package","archived":false,"fork":false,"pushed_at":"2021-09-18T09:28:05.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":7,"subscribers_count":13,"default_branch":"1.x-dev","last_synced_at":"2025-04-02T14:21:47.350Z","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":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joomla-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"joomla","custom":"https://community.joomla.org/sponsorship-campaigns.html"}},"created_at":"2013-03-01T05:42:58.000Z","updated_at":"2021-09-18T09:28:09.000Z","dependencies_parsed_at":"2022-08-21T11:40:45.690Z","dependency_job_id":null,"html_url":"https://github.com/joomla-framework/compat","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fcompat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fcompat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fcompat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fcompat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joomla-framework","download_url":"https://codeload.github.com/joomla-framework/compat/tar.gz/refs/heads/1.x-dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250285743,"owners_count":21405299,"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-10T07:09:01.809Z","updated_at":"2025-04-23T11:30:30.247Z","avatar_url":"https://github.com/joomla-framework.png","language":"PHP","funding_links":["https://github.com/sponsors/joomla","https://community.joomla.org/sponsorship-campaigns.html"],"categories":[],"sub_categories":[],"readme":"# The Compat Package [![Build Status](https://ci.joomla.org/api/badges/joomla-framework/compat/status.svg)](https://ci.joomla.org/joomla-framework/compat)\n\n[![Latest Stable Version](https://poser.pugx.org/joomla/compat/v/stable)](https://packagist.org/packages/joomla/compat) [![Total Downloads](https://poser.pugx.org/joomla/compat/downloads)](https://packagist.org/packages/joomla/compat) [![Latest Unstable Version](https://poser.pugx.org/joomla/compat/v/unstable)](https://packagist.org/packages/joomla/compat) [![License](https://poser.pugx.org/joomla/compat/license)](https://packagist.org/packages/joomla/compat)\n\nThis is a simple package that contains forward compatibility classes and interfaces that are registered to the global namespace\n\n## Deprecated\n\nThe `joomla/compat` package has been deprecated.  No further updates are planned.\n\n## JsonSerializable\n\n`JsonSerializable` is a PHP 5.4 interface that allows you to specify what data to serialize to JSON when you `json_encode` an object that implements the interface.\n\n### Usage\n\nSince this is a PHP 5.4 interface, the `jsonSerialize()` method does not get called automatically when `json_encode`-ing an instance of the class when used in 5.3. To work around this, simply call the `jsonSerialize()` method directly when passing it to `json_encode`. This is forward-compatible with PHP 5.4.\n\nNote in some instances of PHP 5.5 from Debian the interface is also missing (see http://stackoverflow.com/questions/18239405/php-fatal-error-call-to-undefined-function-json-decode) which will also require this interface to be included.\n\n```php\nclass MyClass implements \\JsonSerializable\n{\n\t/**\n\t * @var  array  Holds the data this class uses.\n\t */\n\tprotected $data;\n\n\tpublic function __construct(array $data)\n\t{\n\t\t$this-\u003edata = $data;\n\t}\n\n\tpublic function jsonSerialize()\n\t{\n\t\treturn $this-\u003edata;\n\t}\n}\n\n$obj = new MyClass(array('sample', 'data', 'to', 'encode'));\n\n$encoded = json_encode($obj-\u003ejsonSerialize());\n```\n\n## Installation via Composer\n\nAdd `\"joomla/compat\": \"~1.0\"` to the require block in your composer.json and then run `composer install`.\n\n```json\n{\n\t\"require\": {\n\t\t\"joomla/compat\": \"~1.0\"\n\t}\n}\n```\n\nAlternatively, you can simply run the following from the command line:\n\n```sh\ncomposer require joomla/compat \"~1.0\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Fcompat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoomla-framework%2Fcompat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Fcompat/lists"}