diff --git a/README.md b/README.md index 405f3ca..df6eaf9 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -# site-type-php \ No newline at end of file +# EasyEngine/site-type-php + +Adds `php` site type to [site command](https://github.com/EasyEngine/site-command/) + +## Usage + +```bash +ee site create example.com --type=php # Create simple php site (without db) +ee site create example.com --type=php --with-db # Create php site with db +ee site create example.com --type=php --cache # Create php site with redis cache +``` diff --git a/src/PHP.php b/src/PHP.php index feceeb1..3f8cdc2 100644 --- a/src/PHP.php +++ b/src/PHP.php @@ -4,10 +4,10 @@ namespace EE\Site\Type; -use \Symfony\Component\Filesystem\Filesystem; -use \EE\Model\Site; -use function \EE\Site\Utils\auto_site_name; -use function \EE\Site\Utils\get_site_info; +use EE\Model\Site; +use Symfony\Component\Filesystem\Filesystem; +use function EE\Site\Utils\auto_site_name; +use function EE\Site\Utils\get_site_info; /** * Creates a simple PHP Website. @@ -121,6 +121,24 @@ public function __construct() { * * [--force] * : Resets the remote database if it is not empty. + * + * ## EXAMPLES + * + * # Create php site (without db) + * $ ee site create example.com --type=php + * + * # Create php site with db + * $ ee site create example.com --type=php --with-db + * + * # Create php site with ssl from letsencrypt + * $ ee site create example.com --type=php --ssl=le + * + * # Create php site with wildcard ssl + * $ ee site create example.com --type=php --ssl=le --wildcard + * + * # Create php site with remote database + * $ ee site create example.com --type=php --with-db --dbhost=localhost --dbuser=username --dbpass=password + * */ public function create( $args, $assoc_args ) { @@ -190,6 +208,12 @@ private function create_site_db_user( string $site_url ): string { * * [] * : Name of the website whose info is required. + * + * ## EXAMPLES + * + * # Display site info + * $ ee site info example.com + * */ public function info( $args, $assoc_args ) { @@ -456,6 +480,15 @@ private function create_site_db_entry() { * * [--db] * : Restart db container of site. + * + * ## EXAMPLES + * + * # Restart all containers of site + * $ ee site restart example.com + * + * # Restart single container of site + * $ ee site restart example.com --nginx + * */ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { @@ -485,6 +518,15 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { * * [--php] * : Reload php container of site. + * + * ## EXAMPLES + * + * # Reload all containers of site + * $ ee site reload example.com + * + * # Reload single containers of site + * $ ee site reload example.com --nginx + * */ public function reload( $args, $assoc_args, $whitelisted_containers = [], $reload_commands = [] ) { $whitelisted_containers = [ 'nginx', 'php' ]; diff --git a/src/Site_PHP_Docker.php b/src/Site_PHP_Docker.php index 1216814..609a06f 100644 --- a/src/Site_PHP_Docker.php +++ b/src/Site_PHP_Docker.php @@ -188,7 +188,7 @@ public function generate_docker_compose_yml( array $filters = [] ) { 'network' => true, ]; - $docker_compose_yml = mustache_render( SITE_WP_TEMPLATE_ROOT . '/docker-compose.mustache', $binding ); + $docker_compose_yml = mustache_render( SITE_PHP_TEMPLATE_ROOT . '/docker-compose.mustache', $binding ); return $docker_compose_yml; }