Cheatography
https://cheatography.com
composer for install packages
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Symfony
Symfony install:
composer create-project symfony/website-skeleton:"^5" hello-world
composer create-project symfony/skeleton:"6.1.*" my_project_directory
run server:
php -S 127.0.0.1:8000 -t public
Apache setting:
//.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ public [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^public/
RewriteRule ^(.*)$ public/$1
</IfModule>
install:
composer require symfony/apache-pack
show list of make function
php bin/console list make
Generator controller
php bin/console make:controller
|
|
|
PSR-standards
PSR-0: Autoloading(old)
PSR-1: coding standard basic
PSR-2: coding standard extend
PSR-3: logger interface
PSR-4: Autoloading(new)
PSR-5: PHPDoc
PSR-6: Caching Interface
PSR-7: interfaces for HTTP message interfaces
PSR-11: Dependenci Injections
PSR-13: Link
PSR-14: Event Dispatcher
PSR-15: Request Handlers
PSR-16: Common Interface for Caching Libraries
PSR-17: Factories
PSR-18: HTTP client |
Docker
https://hub.docker.com/ //images
docker version //show if exist
docker build -t api_python .//built image container
docker run -d --name apicontainer -p 8080:8080 api_python:latest
docker -p //show all running containers
docker run apicontainer
docker kill apicontainer
docker start apicontainer
docker pause apicontainer
docker unpause apicontainer
docker ps --all //show all containers
docker ps --filter status=paused
docker exec -it apicontainer sh // edit running container
docker restart apicontainer
docker rm apicontainer
docker image rm api_python
|
|