diff --git "a/docs/10_\360\237\244\224_Why.md" "b/docs/10_\360\237\244\224_Why.md" index d2ee7a3a673582b4ab002c99c5192b49ae360583..1ccbaa8641cbb0620b0db6d385fb1b9e24e39491 100644 --- "a/docs/10_\360\237\244\224_Why.md" +++ "b/docs/10_\360\237\244\224_Why.md" @@ -11,7 +11,9 @@ The init script: * sets permisssions for container and local user * generates needed files for docker from configuration and a set of templates * starts/ stops your container +* opens a console +* starts php lint # What problems does it not solve? -It is a script for a dual container and Apache + PHP and Mariadb only. Nothing else. +It is a script for a dual container and Apache + PHP and (optional) Mariadb only. Nothing else. diff --git "a/docs/20_\342\234\205_Requirements.md" "b/docs/20_\342\234\205_Requirements.md" index 39bc40e9e7d9fddf5ade47244e8f3de19ecdd751..6ce4b93939080f22960daa39b91db2494ab74d98 100644 --- "a/docs/20_\342\234\205_Requirements.md" +++ "b/docs/20_\342\234\205_Requirements.md" @@ -4,4 +4,4 @@ It was tested on Linux only. * Bash + GNU cure utilities * Docker Non-root installation - see <https://docs.docker.com/engine/security/rootless/> -* ACL to enable write permissions on web data for Apache httpd in the container container and local user (you) \ No newline at end of file +* ACL to enable write permissions on web data for Apache httpd in the container container and local user (you) diff --git "a/docs/50_\342\214\250\357\270\217_Usage.md" "b/docs/50_\342\214\250\357\270\217_Usage.md" index ddd4ec174c946dfc49191a07ed8c96198a1a4211..fb448dc09224f954ffd3b0272ecf219727cbfcc8 100644 --- "a/docs/50_\342\214\250\357\270\217_Usage.md" +++ "b/docs/50_\342\214\250\357\270\217_Usage.md" @@ -12,7 +12,7 @@ There is a menu offerning a key and the description for its action. If an action The script supports command line parameters to use it in scripts. Use `-h` to get a help: ```txt -INITIALIZER FOR DOCKER APP v1.9 +INITIALIZER FOR DOCKER APP v1.10 A helper script written in Bash to bring up a PHP+Mysql application in docker. @@ -49,6 +49,7 @@ MENU KEYS: m - more infos o - open app [my_new_app] http://localhost:8001/ c - console (bash) + p - console check with php linter q - quit @@ -57,5 +58,77 @@ EXAMPLES: init.sh starts interactive mode init.sh u bring up docker container(s) and stay in interactive mode init.sh i q set write permissions and quit + init.sh p q start php linter and exit -``` \ No newline at end of file +``` + +### Actions + +#### g - remove git data of starterkit + +After cloning the starter kit repo for a new project you don't want to commit project data to the starter kit but to your project. +This feature removes the git directory if it is connected with the starter kit repository. +If you initialized another project it will bedetected and this feature does nothing. + +#### i - init application: set permissions + +On a rootless docker setup you need to set the write permission for the `www-data` user and your current desktop user. + +#### t - generate files from templates + +Insite the docker/templates directory are templates. + +**Rules**: + +* in the first line must be a line `# TARGET: [name of target file]` to define the target file +* Placeholdrs have the syntax variable in double brackets, i.e. `{{VARNAME}}` +* variables to be replaced are those in docker/init.sh.cfg and `{{genrator}}` + +This feature generates the files from the templates and puts them in the correct place. + +#### T - remove generated files + +This feature removes the files generated by the `t` action. + +#### u - startup containers docker-compose ... up -d + +Fast start webserver container and database container (if enabled). + +#### U - startup containers docker-compose ... up -d --build + +Build and start webserver container and database container (if enabled). + +#### s - shutdown containers docker-compose stop + +Shut down your containers. + +#### r - remove containers docker-compose rm -f + +Remove your containers. + +#### m - more infos + +Show processes. + +#### o - open app [my_new_app] http://localhost:NNNN/ + +Start a browser and open the application. +This feature uses the command `xdg-open` to run on Linux. + +#### c - console (bash) + +Open a console and start a Bash inside webserver container. + +If you have a database container too then you get a selection for the first. + +You need to type `exit` and press `Return` to return to the menu. + +#### p - console check with php linter + +Start a docker command on the webserver container and start php lint for all php files: + +`find . -name '*.php' -exec php -l {} \; | grep -v '^No syntax errors detected'` + +Starting from PHP 8.3 php -l supports multiple files. A newer PHP version will be detected to use the faster mode automatically: + +`php -l $( find . -name '*.php' ) | grep -v '^No syntax errors detected'` \ No newline at end of file diff --git a/docs/images/main_menu.png b/docs/images/main_menu.png index c6953692ea4832ae39ed2106465f2d2abfee6c08..bc4d1696e5041db153d3da254c2523f2882d24bb 100644 Binary files a/docs/images/main_menu.png and b/docs/images/main_menu.png differ