Last active
March 15, 2018 07:35
-
-
Save ptflp/4d4cb63b52b61f2a02b68b9b429b4e94 to your computer and use it in GitHub Desktop.
migration for dektrium/yii2-user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -p "Type ip/host MySQL database: " -r | |
export hostdb=$REPLY; | |
read -p "Type MySQL database name: " -r | |
export dbname=$REPLY; | |
read -p "Type user of MySQL database: " -r | |
export userdb=$REPLY; | |
read -p "Type password of MySQL database: " -r | |
export passdb=$REPLY; | |
composer create-project --prefer-dist yiisoft/yii2-app-advanced web | |
cd web | |
./init --env=Development --overwrite=All | |
sed -i "s/mysql:host=localhost;dbname=yii2advanced/mysql:host=${hostdb};dbname=${dbname}/" common/config/main-local.php; | |
sed -i "s/'username' => 'root'/'username' => '${userdb}'/" common/config/main-local.php; | |
sed -i "s/'password' => ''/'password' => '${passdb}'/" common/config/main-local.php; | |
url=https://gist.githubusercontent.com/ptflp/4d4cb63b52b61f2a02b68b9b429b4e94/raw/7ebd54bd0923f7ea8287be2350c8bc0c6f828a1e/yii2-user.sh | |
filename=$(basename "$url") | |
wget "$url" | |
chmod +x $filename | |
./$filename | |
rm -f $filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment