Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for --type support of ee site command #104

Merged
merged 41 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9030635
Move AcmePhp from core to site-command
mrrobot47 Aug 28, 2018
9dcdd84
Move site related files from core to site-command
mrrobot47 Aug 28, 2018
ab8c4d0
Update composer dependencies
mrrobot47 Aug 28, 2018
74dbc3a
Update namespaces and change Site_Command to HTML site-type
mrrobot47 Aug 28, 2018
106134c
Use constants where applicable
mrrobot47 Aug 28, 2018
7dbb02f
Add site-type routing in site-command
mrrobot47 Aug 28, 2018
2535117
add help hook for site-type and register html site-type
mrrobot47 Aug 28, 2018
a2cbf6a
Move template from core to site-command
mrrobot47 Aug 28, 2018
b947d24
Update template path
mrrobot47 Aug 28, 2018
81e5159
Update namespace and filenames
mrrobot47 Aug 28, 2018
1cf1d40
Update namespace and filenames
mrrobot47 Aug 28, 2018
b8ff0f0
Load site utility function file
mrrobot47 Aug 28, 2018
2976ebe
Add type namespace in shutdownhandler and letsencrypt class
mrrobot47 Aug 28, 2018
a7382df
Remove unnecessary namespace
mrrobot47 Aug 28, 2018
da2cb12
Add type namespace to Abstract class
mrrobot47 Aug 28, 2018
ebd3eff
Add type namespace to letsencrypt class
mrrobot47 Aug 28, 2018
0178748
Update EE usage to \EE acc to new namespace
mrrobot47 Aug 28, 2018
a8af7f1
Update getting of args in help and set default type
mrrobot47 Aug 28, 2018
5df0eaf
Update EE usage to \EE for letsencrypt class
mrrobot47 Aug 28, 2018
000c413
Update execeptions according to namespace changes
mrrobot47 Aug 28, 2018
a7f5d88
Merge branch 'develop' into refactor-for-type
mrrobot47 Aug 29, 2018
c9590a5
Move hooks to helper
mrrobot47 Aug 29, 2018
f5d6cce
Reorganize files to helper and site-type folders
mrrobot47 Aug 29, 2018
eaefba4
Move use statement to hooks file
mrrobot47 Aug 29, 2018
828e731
Update doc comment
mrrobot47 Aug 29, 2018
ed5c6e0
Update warning message
mrrobot47 Aug 29, 2018
eb2e1e4
Update sprintf
mrrobot47 Aug 29, 2018
69b6976
Remove TODO from code to track in seperate issue
mrrobot47 Aug 29, 2018
4d9dc92
Update hook name and doc comment
mrrobot47 Aug 29, 2018
4f66fc2
Add early return in help hook
mrrobot47 Aug 29, 2018
75e55f7
Rename html class file
mrrobot47 Aug 29, 2018
6dd18f8
Update help info in doc block
mrrobot47 Aug 29, 2018
18c462f
Update path for require
mrrobot47 Aug 29, 2018
077316c
Move shutdownfunction and common rollback to abstract class
mrrobot47 Aug 29, 2018
b5c167d
Move file loading to composer
mrrobot47 Aug 29, 2018
e408a92
Update loading sequence
mrrobot47 Aug 29, 2018
72444d8
Change hook addition
mrrobot47 Aug 29, 2018
eb15ce5
Remove test trigger of error
mrrobot47 Aug 29, 2018
a313af6
Update hooks file to add hooks
mrrobot47 Aug 29, 2018
482b4f8
Update sprintf usage
mrrobot47 Aug 30, 2018
cd38bc7
Update function name
mrrobot47 Aug 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions AcmePhp/Cli/Exception/AcmeCliActionException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from EE core to here.


/*
* This file is part of the Acme PHP project.
*
* (c) Titouan Galopin <galopintitouan@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace AcmePhp\Cli\Exception;

/**
* @author Titouan Galopin <galopintitouan@gmail.com>
*/
class AcmeCliActionException extends AcmeCliException
{
public function __construct($actionName, \Exception $previous = null)
{
parent::__construct(sprintf('An exception was thrown during action "%s"', $actionName), $previous);
}
}
23 changes: 23 additions & 0 deletions AcmePhp/Cli/Exception/AcmeCliException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from EE core to here.


/*
* This file is part of the Acme PHP project.
*
* (c) Titouan Galopin <galopintitouan@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace AcmePhp\Cli\Exception;

/**
* @author Titouan Galopin <galopintitouan@gmail.com>
*/
class AcmeCliException extends \RuntimeException
{
public function __construct($message, \Exception $previous = null)
{
parent::__construct($message, 0, $previous);
}
}
23 changes: 23 additions & 0 deletions AcmePhp/Cli/Exception/AcmeDnsResolutionException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from EE core to here.


/*
* This file is part of the Acme PHP project.
*
* (c) Titouan Galopin <galopintitouan@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace AcmePhp\Cli\Exception;

/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class AcmeDnsResolutionException extends AcmeCliException
{
public function __construct($message, \Exception $previous = null)
{
parent::__construct(null === $message ? 'An exception was thrown during resolution of DNS' : $message, $previous);
}
}
55 changes: 55 additions & 0 deletions AcmePhp/Cli/Exception/CommandFlowException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from EE core to here.


/*
* This file is part of the Acme PHP project.
*
* (c) Titouan Galopin <galopintitouan@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace AcmePhp\Cli\Exception;

/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class CommandFlowException extends AcmeCliException
{
/**
* @var string
*/
private $missing;
/**
* @var string
*/
private $command;
/**
* @var array
*/
private $arguments;

/**
* @param string $missing Missing requirement to fix the flow
* @param string $command Name of the command to run in order to fix the flow
* @param array $arguments Optional list of missing arguments
* @param \Exception|null $previous
*/
public function __construct($missing, $command, array $arguments = [], \Exception $previous = null)
{
$this->missing = $missing;
$this->command = $command;
$this->arguments = $arguments;

$message = trim(sprintf(
'You have to %s first. Run the command%sphp %s %s %s',
$missing,
PHP_EOL.PHP_EOL,
$_SERVER['PHP_SELF'],
$command,
implode(' ', $arguments)
));

parent::__construct($message, $previous);
}
}
Loading