{"id":19325980,"url":"https://github.com/linkorb/autotune","last_synced_at":"2025-04-22T20:32:06.666Z","repository":{"id":62517446,"uuid":"49810536","full_name":"linkorb/autotune","owner":"linkorb","description":"AutoTune for Composer - For PHP Library Developers","archived":false,"fork":false,"pushed_at":"2016-02-01T12:45:29.000Z","size":11,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T20:36:02.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/linkorb.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":"2016-01-17T09:20:33.000Z","updated_at":"2021-10-05T13:43:43.000Z","dependencies_parsed_at":"2022-11-02T13:31:12.035Z","dependency_job_id":null,"html_url":"https://github.com/linkorb/autotune","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fautotune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fautotune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fautotune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fautotune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/autotune/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250318841,"owners_count":21410999,"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-10T02:12:05.742Z","updated_at":"2025-04-22T20:32:06.440Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoTune for Composer\n\n\u003cimg src=\"http://upr.io/xpnegd.jpg\" style=\"width: 100%\" /\u003e\n\n## Why use AutoTune for Composer?\n\nAutoTune is great for library developers.\n\nOften you're working on a library and the calling application at the same time.\n\nBefore AutoTune there were 2 things you could do to test your library in your application:\n\n1. Commit new version of the library for all changes, wait for packagist to re-index, and update your composer.lock in the calling application and test.\n2. Add a \"repository\" to your calling application's composer.json (which you shouldn't forget to remove during commit, and put back after)\n\nBoth are cumbersome. This is where AutoTune comes in!\n\n## How does autotune work?\n\nAutoTune expects to find a `autotune.json` in your calling application's path, next to composer.json. Here's an example:\n\n```json\n{\n    \"autoload\": {\n        \"psr-4\": {\n            \"Monolog\\\\\": \"~/git/monolog/monolog/src/Monolog\"\n        }\n    }\n}\n```\n\nIf this file is found, it will read the contents, and override any psr-0 or psr-4 namespaces with the local version as defined in your autotune.json file.\n\nYou can add the autotune.json to your `.gitignore` file, so that you can keep your code directory clean and in sync with the remote repository.\n\n## Making your own application ready for AutoTune\n\nMaking your own application ready for AutoTune takes 3 simple steps:\n\n### 1. Include `linkorb/autotune` from Packagist in your composer.json file\n\n```json\nrequire-dev\": {\n   \"linkorb/autotune\": \"~1.0\"\n}\n```\n\nThen run `composer update`\n\n### 2. Initialize AutoTune in your app\n\nSomewhere in your application, you're including `vendor/autoload.php`. Sometimes it's in `web/index.php` or `bin/console`. Find this location, and modify add these lines:\n\n```php\n$loader = require_once __DIR__.'/../vendor/autoload.php';\nif (class_exists('AutoTune\\Tuner')) {\n    \\AutoTune\\Tuner::init($loader);\n}\n```\nWrapping the call to `init` in the `class_exists` block ensures autotune is only used if AutoTune is installed in your (development) environment (installed from the require-dev block in composer.json). In production environments it won't be called if you install your dependencies with `--no-dev`)\n\n### 3. Add an `autotune.json` file to your project root.\n\nExample content:\n\n```json\n{\n    \"autoload\": {\n        \"psr-4\": {\n            \"Monolog\\\\\": \"~/git/monolog/monolog/src/Monolog\"\n        }\n    }\n}\n```\n\nIdeally you'd add the `autotune.json` to your `.gitignore` file.\n\n### Done\n\nWhenever your application is doing something like the following, it will load the \"local\" version of a library, instead of the one in your `vendor/` directory.\n\n```php\n$logger = new \\Monolog\\Logger('example');\n```\n\nSo from now on, no changes are required to your main application. Everything is managed by your local `autotune.json` file.\n\n## License\n\nMIT (see [LICENSE.md](LICENSE.md))\n\n## Brought to you by the LinkORB Engineering team\n\n\u003cimg src=\"http://www.linkorb.com/d/meta/tier1/images/linkorbengineering-logo.png\" width=\"200px\" /\u003e\u003cbr /\u003e\nCheck out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).\n\nBtw, we're hiring!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fautotune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Fautotune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fautotune/lists"}