{"id":13409126,"url":"https://github.com/YOURLS/composer-installer","last_synced_at":"2025-03-14T14:30:57.746Z","repository":{"id":52286235,"uuid":"271299913","full_name":"YOURLS/composer-installer","owner":"YOURLS","description":"📦 Install YOURLS plugins with Composer - Work in progress 🚧","archived":false,"fork":false,"pushed_at":"2022-04-21T20:31:17.000Z","size":49,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-24T00:16:18.755Z","etag":null,"topics":["composer-plugin","yourls","yourls-plugin"],"latest_commit_sha":null,"homepage":"","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/YOURLS.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":"2020-06-10T14:31:36.000Z","updated_at":"2022-07-28T10:06:16.000Z","dependencies_parsed_at":"2022-08-20T16:00:31.948Z","dependency_job_id":null,"html_url":"https://github.com/YOURLS/composer-installer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2Fcomposer-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2Fcomposer-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2Fcomposer-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2Fcomposer-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YOURLS","download_url":"https://codeload.github.com/YOURLS/composer-installer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242947300,"owners_count":20211004,"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":["composer-plugin","yourls","yourls-plugin"],"created_at":"2024-07-30T20:00:58.182Z","updated_at":"2025-03-14T14:30:57.416Z","avatar_url":"https://github.com/YOURLS.png","language":"PHP","funding_links":[],"categories":["Official Links","PHP"],"sub_categories":[],"readme":"\n\n\n# YOURLS Composer Installer [![Listed in Awesome YOURLS!](https://img.shields.io/badge/Awesome-YOURLS-C5A3BE)](https://github.com/YOURLS/awesome-yourls/)\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/223647/84647720-18dba800-af04-11ea-9e7f-c6d623050f4a.png\"/\u003e\u003c/p\u003e\n\n\u003e Keep track of plugins and custom packages added with Composer in a `user/composer.json` file that is left untouched when you update YOURLS.\n\n\u003e In a nutshell: `composer add-plugin joecool/super-yourls-plugin`\n\n#### :construction: \u0026nbsp; Work in progress.\n\n[![Build Status](https://travis-ci.com/YOURLS/composer-installer.svg?branch=master)](https://travis-ci.com/YOURLS/composer-installer) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/YOURLS/composer-installer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/YOURLS/composer-installer/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/YOURLS/composer-installer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/YOURLS/composer-installer/?branch=master) [![Packagist](https://img.shields.io/packagist/v/yourls/composer-installer.svg)](https://packagist.org/packages/yourls/composer-installer)\n\n\n#### Foreword : install YOURLS with Composer\n\nInstalling YOURLS with Composer is already possible out of the box and doesn't need anything special. Just do :\n\n ```bash\n$\u003e composer create-project yourls/yourls path/to/install\n ```\n\n (For instance `composer create-project yourls/yourls .` in an empty directory)\n\nNote that this merely *downloads* the [latest YOURLS release](https://github.com/YOURLS/YOURLS/releases) in the specified directory. You will need after this to properly *install* YOURLS (see [yourls.org/#Install](https://yourls.org/#Install))\n\n## Install plugins\n\nAs a user you simply need to `require` the plugin in your `user/composer.json`.\n\n```js\n{\n    \"require\": {\n        \"joecool/super-plugin\": \"^1.0\"\n    }\n}\n```\nEven easier, in the command line, just type:\n\n ```bash\n$\u003e composer add-plugin joecool/superplugin\n ```\n\nThis will download the plugin into  `user/plugins/superplugin` , and transparently install any dependency in YOURLS' `vendor` directory.\n\nThis specific YOURLS plugin itself needs to be listed on [Packagist](https://packagist.org/). If it's not the case, nag your favorite plugin coder so they get it listed. *Even better*, open a simple Pull Request on their repository to help them doing so: see below.\n\n##### :bulb: Try it yourself:\n```\n$\u003e composer add-plugin ozh/example-plugin\n```\n\n## Make YOURLS plugins compatible\n\nAs a plugin coder, this is a simple 2 steps operation: add a `composer.json` and get your plugin listed on [Packagist](https://packagist.org/). That's it.\n\n### 1. Add a `composer.json` to your plugin\n\nFirst, your plugin must require PHP 7.2+\n\nThe `composer.json` tells everything Composer needs to know about your plugin. The important bits are `\"type\": \"yourls-plugin\"` and `\"require\"` this installer `\"yourls/composer-installer\"` as a dependency\n\nA minimalist `composer.json` would be for example:\n\n```js\n{\n    \"name\": \"ozh/example-plugin\",\n    \"description\": \"Example of a YOURLS plugin installable with Composer\",\n    \"type\": \"yourls-plugin\", // \u003c-- THIS\n    \"require\": {\n        \"php\": \"\u003e=7.2\",\n        \"yourls/composer-installer\": \"^1.0\" // \u003c-- AND THIS\n    }\n}\n```\n\nOf course, your plugin can completely leverage all Composer features and use any package: simply list them as additional dependencies:\n\n```js\n{\n    \"name\": \"joecool/awesome-plugin\",\n    \"description\": \"This plugin does this and that\",\n    \"type\": \"yourls-plugin\",\n    \"license\":\"MIT\",\n    \"require\": {\n        \"php\": \"\u003e=7.2\",\n        \"yourls/composer-installer\": \"^1.0\",\n        \"google/auth\": \"^2.3\",\n        \"twilio/sdk\": \"^2.0\",\n        \"\n    }\n}\n```\n\nIn such case, additional dependencies for your plugin will be placed in YOURLS' `includes/vendor` \n\n##### :bulb: Simple example:\nSee https://github.com/ozh/example-plugin/\n\n### 2. Get listed on Packagist\n\nThis step is pretty straightforward, head to https://packagist.org/packages/submit and follow instructions.\n\nIf you are completely new to Composer, their [about page](https://packagist.org/about) is a recommended read.\n\n## Benefits\n\nMaking YOURLS plugins compatible with this Composer custom installer is easy and optimizes resources.\n\n* If several plugins use the same libraries, say `endroid/qr-code`, this library will be installed once in YOURLS and available to all plugins.\n* It makes it simple for site managers to quickly scaffold YOURLS sites:  install everything with a simple one-liner: `composer create-project yourls/yourls; composer require ozh/stuff slayer/pentagram` \n* It makes it easier for plugin coders and plugin users to update plugins\n\n## Credits\n\nMuch of this custom installer code comes from project [Kirby](https://github.com/getkirby/composer-installer) . Thanks a bunch to them.\n\n## License\n\nMIT. Do whatever the hell you want with this.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYOURLS%2Fcomposer-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYOURLS%2Fcomposer-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYOURLS%2Fcomposer-installer/lists"}