Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtamuli committed Sep 10, 2018
2 parents 8440ab9 + 1797356 commit 83e7cf0
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 6 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# site-type-php
# 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
```
50 changes: 46 additions & 4 deletions src/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ) {

Expand Down Expand Up @@ -190,6 +208,12 @@ private function create_site_db_user( string $site_url ): string {
*
* [<site-name>]
* : Name of the website whose info is required.
*
* ## EXAMPLES
*
* # Display site info
* $ ee site info example.com
*
*/
public function info( $args, $assoc_args ) {

Expand Down Expand Up @@ -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 = [] ) {

Expand Down Expand Up @@ -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' ];
Expand Down
2 changes: 1 addition & 1 deletion src/Site_PHP_Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 83e7cf0

Please sign in to comment.