{"id":13562641,"url":"https://github.com/mridang/pearify","last_synced_at":"2025-04-03T18:34:09.215Z","repository":{"id":18787681,"uuid":"85309735","full_name":"mridang/pearify","owner":"mridang","description":"Pearify converts PSR-4 Composer packages to PEAR compliant code.","archived":true,"fork":false,"pushed_at":"2022-06-27T03:10:55.000Z","size":52,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-08T11:46:40.572Z","etag":null,"topics":["classname","command-line-tool","composer","magento","pear","psr-4"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/mridang/pearify","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/mridang.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":"2017-03-17T12:32:36.000Z","updated_at":"2023-01-27T23:35:12.000Z","dependencies_parsed_at":"2022-08-28T10:03:09.820Z","dependency_job_id":null,"html_url":"https://github.com/mridang/pearify","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fpearify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fpearify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fpearify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fpearify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mridang","download_url":"https://codeload.github.com/mridang/pearify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247057193,"owners_count":20876533,"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":["classname","command-line-tool","composer","magento","pear","psr-4"],"created_at":"2024-08-01T13:01:10.666Z","updated_at":"2025-04-03T18:34:04.190Z","avatar_url":"https://github.com/mridang.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Pearify — Like Browserify, For PEAR compliance\n\nPearify is a tool to rewrite PSR-0 and PSR-4 PHP class names to the PEAR naming conventions. Pearify\nis based on the excellent PHP class-rewriting project by Michael Tibben.\n\nRequirements\n------------\n\nPearify requires PHP version 5.4 or greater.\n\nInstallation\n------------\n\nThe simplest way to get Pearify is via Packagist. Simply add `mridang/pearify` to your composer JSON's\nlist of requirements and run `composer install`.\n\nAbout\n------------\n\nPearify relies heavily on Composer and works only on Composer-based projects. Pearify uses the classmap\ngenerated by Composer to get a list of PHP classes to be renamed.\n\nPearify requires that you have dumped the optimised autoload classmap so it can include the\narray of file paths. You can generate the classmap by invoking\n\n```\ncomposer dump-autoload --optimize\n```\n\nRunning the aforementioned command, will generate a file called `autoload_classmap.php` in the \n`vendor\\composer` directory. More information on the `dump-autoload` directive can be found at\nhttps://getcomposer.org/doc/03-cli.md#dump-autoload. \n\nThe classmap contains an exhaustive list of all the PHP classnames (including paths of dev \ndependencies) and the relative file paths. While this file contains classes from development\ndependencies as well, they are automatically excluded by Pearify.\n\nPearify reads your project's `composer.json` file to recursively deduce all the production\ndependencies of your project and only select classes from the classmap belonging to your project's\nproduction dependencies.\n\nIf you had a PHP class file called `MyClass.php` in the directory `vendor/myname/myproject/`\n\n```php\nnamespace MyName\\MyProject;\n\nuse DateTime;\n\nclass MyClass {\n\n    public function getDate() {\n        return new DateTime(\"2014-10-20\");\n    }\n}\n```\n\nIt would be renamed and copied over to a file name `lib\\MyName\\MyProject\\MyClass.php`\n\n```php\nclass MyName_MyProject_MyClass {\n\n    public function getDate() {\n        return new DateTime(\"2014-10-20\");\n    }\n}\n```\n\nThe original file is left untouched and the new file is created (or overwritten) with all the `use`\nand `namespace` statements removed.\n\n\nGotchas\n-------\n\nPearify has quite a few shortcomings. If you'd like to see support for one of the following added to\nComposer, please create a pull-request.\n\n* Only the `vendor` directory is processed. No support for the `vendor-dir` property as shown at \nhttps://getcomposer.org/doc/06-config.md#vendor-dir\n* No support for the suggested dependencies using the `suggests` property as shown at\nhttps://getcomposer.org/doc/04-schema.md#suggest\n* Files without any classes are excluded\n* Resources in the dependencies are excluded\n* Tests in the dependencies are excluded\n\nAuthors\n-------\n\n* Mridang Agarwalla\n* Hannu Pölönen\n\nCredits\n-------\n\n* Michael Tibben (@mtibben)\n\nLicense\n-------\n\nPearify is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fpearify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmridang%2Fpearify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fpearify/lists"}