{"id":15042209,"url":"https://github.com/yii2tech/install","last_synced_at":"2025-10-04T05:31:28.906Z","repository":{"id":57087054,"uuid":"38040098","full_name":"yii2tech/install","owner":"yii2tech","description":"basic script for project installation","archived":true,"fork":false,"pushed_at":"2019-07-03T11:26:50.000Z","size":76,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-25T17:49:55.011Z","etag":null,"topics":["init","initialize","initscript","install","installer","support","vcs","yii","yii2","yii2-extension"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yii2tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["klimov-paul"],"patreon":"klimov_paul"}},"created_at":"2015-06-25T09:21:46.000Z","updated_at":"2024-05-31T08:48:21.000Z","dependencies_parsed_at":"2022-08-20T16:00:25.858Z","dependency_job_id":null,"html_url":"https://github.com/yii2tech/install","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/yii2tech/install","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Finstall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Finstall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Finstall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Finstall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yii2tech","download_url":"https://codeload.github.com/yii2tech/install/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Finstall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278267465,"owners_count":25958869,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["init","initialize","initscript","install","installer","support","vcs","yii","yii2","yii2-extension"],"created_at":"2024-09-24T20:46:59.498Z","updated_at":"2025-10-04T05:31:28.636Z","avatar_url":"https://github.com/yii2tech.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yii2tech\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://avatars2.githubusercontent.com/u/12951949\" height=\"100px\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eInstall Extension for Yii 2\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\nThis extension provides ability for automated initialization of the project working copy, including local directories and\nfiles creation, running DB migrations and so on.\n\nFor license information check the [LICENSE](LICENSE.md)-file.\n\n[![Latest Stable Version](https://poser.pugx.org/yii2tech/install/v/stable.png)](https://packagist.org/packages/yii2tech/install)\n[![Total Downloads](https://poser.pugx.org/yii2tech/install/downloads.png)](https://packagist.org/packages/yii2tech/install)\n[![Build Status](https://travis-ci.org/yii2tech/install.svg?branch=master)](https://travis-ci.org/yii2tech/install)\n\n\nRequirements\n------------\n\nThis extension requires Linux OS.\n\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist yii2tech/install\n```\n\nor add\n\n```json\n\"yii2tech/install\": \"*\"\n```\n\nto the require section of your composer.json.\n\nIf you wish to setup crontab during project installation, you will also need to install [yii2tech/crontab](https://github.com/yii2tech/crontab),\nwhich is not required by default. In order to do so either run\n\n```\nphp composer.phar require --prefer-dist yii2tech/crontab\n```\n\nor add\n\n```json\n\"yii2tech/crontab\": \"*\"\n```\n\nto the require section of your composer.json.\n\n\nUsage\n-----\n\nThis extension provides special console controller [[yii2tech\\install\\InitController]], which allows initialization of the\nproject working copy. Such initialization includes:\n\n - check if current environment matches project requirements.\n - create local directories (the ones, which may be not stored in version control system) and make them write-able.\n - create local files, such as configuration files, from templates.\n - run extra shell commands, like 'yii migrate' command.\n - setup cron jobs.\n\nIn order to create an installer, you should create a separated console application entry script. This script should\nbe absolutely stripped from the local configuration files, database and so on!\nSee [examples/install.php](examples/install.php) for the example of such script.\n\nOnce you have such script you can run installation process, using following command:\n\n```\nphp install.php init\n```\n\n\n## Working with local files \u003cspan id=\"working-with-local-files\"\u003e\u003c/span\u003e\n\nThe most interesting feature introduced by [[yii2tech\\install\\InitController]] is creating local project files, such as\nconfiguration files, from thier examples in interactive mode.\nFor each file, which content may vary depending on actual project environment, you should create a template file named in\nformat `{filename}.sample`. This file should be located under the same directory, where the actual local file should appear.\nInside the template file you can use placeholders in format: `{{placeholderName}}`. For example:\n\n```php\ndefined('YII_DEBUG') or define('YII_DEBUG', {{yiiDebug}});\ndefined('YII_ENV') or define('YII_ENV', '{{yiiEnv}}');\n\nreturn [\n    'components' =\u003e [\n        'db' =\u003e [\n            'dsn' =\u003e 'mysql:host={{dbHost}};dbname={{dbName}}',\n            'username' =\u003e '{{dbUser}}',\n            'password' =\u003e '{{dbPassword}}',\n        ],\n    ],\n];\n```\n\nWhile being processed, file templates are parsed, and for all found placeholders user will be asked to enter a value for them.\nYou can make this process more user-friendly by setting [[yii2tech\\install\\InitController::localFilePlaceholders]], specifying\nhints, type and validation rules. See [[yii2tech\\install\\LocalFilePlaceholder]] for more details.\n\n\n## Non interactive installation \u003cspan id=\"non-interactive-installation\"\u003e\u003c/span\u003e\n\nAsking user for particular placeholder value may be not efficient and sometimes not acceptable. You may need to run\nproject intallation in fully automatic mode without user input, for example after updating source code from version\ncontrol system inside automatic project update.\nIn order to disable any user-interaction, you should use `interactive` option:\n\n```\nphp install.php init --interactive=0\n```\n\nIn this mode for all local file placeholders the default values will be taken, but only in case such values are explicitely\ndefined via [[yii2tech\\install\\InitController::localFilePlaceholders]]. Because install entry script usually stored under\nversion control system and local file placeholder values (as well as other installation parameters) may vary depending\non particular environment, [[yii2tech\\install\\InitController]] instroduce 'config' option. Using this option you may\nspecify extra configuration file, which should be merged with predefined parameters.\nIn order to create such configuration file, you can use following:\n\n```\nphp install.php init/config @app/config/install.php\n```\n\nOnce you have adjusted created configuration file, you can run installation with it:\n\n```\nphp install.php init --config=@app/config/install.php --interactive=0\n```\n","funding_links":["https://github.com/sponsors/klimov-paul","https://patreon.com/klimov_paul"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyii2tech%2Finstall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyii2tech%2Finstall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyii2tech%2Finstall/lists"}