forked from directus/v8-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
551 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Directus\Exception; | ||
|
||
class InvalidPathException extends Exception implements UnprocessableEntityExceptionInterface | ||
{ | ||
public function __construct($message) | ||
{ | ||
parent::__construct($message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Directus\Services; | ||
|
||
use Directus\Util\ArrayUtils; | ||
use Directus\Util\Installation\InstallerUtils; | ||
|
||
class InstallService extends AbstractService | ||
{ | ||
public function install(array $data) | ||
{ | ||
$this->validate($data, [ | ||
'env' => 'string', | ||
|
||
'force' => 'bool', | ||
|
||
'db_host' => 'string', | ||
'db_name' => 'required|string', | ||
'db_user' => 'required|string', | ||
'db_password' => 'string', | ||
|
||
'mail_from' => 'string', | ||
'cors_enabled' => 'bool', | ||
|
||
'project_name' => 'string', | ||
'user_email' => 'required|email', | ||
'user_password' => 'required|string', | ||
'user_token' => 'string' | ||
]); | ||
|
||
$force = ArrayUtils::pull($data, 'force', false); | ||
$env = ArrayUtils::get($data, 'env', '_'); | ||
$basePath = $this->container->get('path_base'); | ||
|
||
InstallerUtils::ensureCanCreateConfig($basePath, $data, $force); | ||
InstallerUtils::ensureCanCreateTables($basePath, $data, $force); | ||
|
||
InstallerUtils::createConfig($basePath, $data, $force); | ||
|
||
InstallerUtils::createTables($basePath, $env, $force); | ||
InstallerUtils::addDefaultSettings($basePath, $data, $env); | ||
InstallerUtils::addDefaultUser($basePath, $data, $env); | ||
|
||
// config | ||
// db_host | ||
// db_name* | ||
// db_user* | ||
// db_password | ||
// ----------- | ||
// mail_from | ||
// cors_enabled | ||
|
||
// database | ||
// none | ||
|
||
// default user/settings | ||
// project_name => directus_name | ||
// user_email => directus_email | ||
// user_password => directus_password | ||
// user_token => directus_token | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.