mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Fixed some formatting oddities
This commit is contained in:
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -24,7 +24,7 @@
|
|||||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||||
- [ ] Documentation (a change to man pages or other documentation)
|
- [ ] Documentation (a change to man pages or other documentation)
|
||||||
|
|
||||||
### Checklist:
|
### Checklist
|
||||||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||||
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||||
- [ ] My code adheres to the e107 [code style standard](https://github.com/e107inc/e107/wiki/e107-Coding-Standard).
|
- [ ] My code adheres to the e107 [code style standard](https://github.com/e107inc/e107/wiki/e107-Coding-Standard).
|
||||||
|
@@ -39,15 +39,15 @@ class cPanelDeployer extends Deployer
|
|||||||
|
|
||||||
foreach ($this->components as $component)
|
foreach ($this->components as $component)
|
||||||
{
|
{
|
||||||
$method = "prepare_${component}";
|
$method = "prepare_{$component}";
|
||||||
if (!method_exists($this, $method))
|
if (!method_exists($this, $method))
|
||||||
{
|
{
|
||||||
throw new Exception("Unsupported component \"${component}\" requested.");
|
throw new Exception("Unsupported component \"{$component}\" requested.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($this->components as $component)
|
foreach ($this->components as $component)
|
||||||
{
|
{
|
||||||
$method = "prepare_${component}";
|
$method = "prepare_{$component}";
|
||||||
$this->$method();
|
$this->$method();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,23 +64,23 @@ class cPanelDeployer extends Deployer
|
|||||||
|
|
||||||
$this->cPanel = $cPanel = new cpanelAPI($username, $password, $hostname);
|
$this->cPanel = $cPanel = new cpanelAPI($username, $password, $hostname);
|
||||||
|
|
||||||
self::println("Connecting to cPanel at \"${hostname}\" with username \"${username}\"…");
|
self::println("Connecting to cPanel at \"{$hostname}\" with username \"{$username}\"…");
|
||||||
|
|
||||||
$domains_data = $cPanel->uapi->DomainInfo->domains_data();
|
$domains_data = $cPanel->uapi->DomainInfo->domains_data();
|
||||||
if (!$domains_data)
|
if (!$domains_data)
|
||||||
{
|
{
|
||||||
throw new Exception("Cannot connect to cPanel at \"${hostname}\" with username \"${username}\" and password \"${password}\"");
|
throw new Exception("Cannot connect to cPanel at \"{$hostname}\" with username \"{$username}\" and password \"{$password}\"");
|
||||||
}
|
}
|
||||||
$userdata = $domains_data->{'data'};
|
$userdata = $domains_data->{'data'};
|
||||||
$this->homedir = $homedir = $userdata->{'main_domain'}->{'homedir'};
|
$this->homedir = $userdata->{'main_domain'}->{'homedir'};
|
||||||
$this->docroot = $docroot = $userdata->{'main_domain'}->{'documentroot'};
|
$this->docroot = $userdata->{'main_domain'}->{'documentroot'};
|
||||||
$this->domain = $domain = $userdata->{'main_domain'}->{'domain'};
|
$this->domain = $userdata->{'main_domain'}->{'domain'};
|
||||||
|
|
||||||
self::println("Obtained home directory from cPanel: " . $this->homedir);
|
self::println("Obtained home directory from cPanel: " . $this->homedir);
|
||||||
self::println("Obtained document root from cPanel: " . $this->docroot);
|
self::println("Obtained document root from cPanel: " . $this->docroot);
|
||||||
self::println("Obtained domain name from cPanel: " . $this->domain);
|
self::println("Obtained domain name from cPanel: " . $this->domain);
|
||||||
|
|
||||||
$acceptance_tests = self::get_active_acceptance_tests($cPanel, $homedir);
|
$acceptance_tests = self::get_active_acceptance_tests($cPanel, $this->homedir);
|
||||||
|
|
||||||
self::println("Adding this test (".$this->run_id.") to registered tests list…");
|
self::println("Adding this test (".$this->run_id.") to registered tests list…");
|
||||||
$run_time = microtime(true);
|
$run_time = microtime(true);
|
||||||
@@ -89,7 +89,7 @@ class cPanelDeployer extends Deployer
|
|||||||
'time' => $run_time
|
'time' => $run_time
|
||||||
]);
|
]);
|
||||||
|
|
||||||
self::write_acceptance_tests($cPanel, $homedir, $acceptance_tests);
|
self::write_acceptance_tests($cPanel, $this->homedir, $acceptance_tests);
|
||||||
|
|
||||||
$valid_acceptance_test_ids = self::get_acceptance_test_ids($acceptance_tests);
|
$valid_acceptance_test_ids = self::get_acceptance_test_ids($acceptance_tests);
|
||||||
self::println("Current unexpired tests: [".implode(", ", $valid_acceptance_test_ids)."]");
|
self::println("Current unexpired tests: [".implode(", ", $valid_acceptance_test_ids)."]");
|
||||||
@@ -245,7 +245,7 @@ class cPanelDeployer extends Deployer
|
|||||||
{
|
{
|
||||||
$hostname = $this->credentials['hostname'];
|
$hostname = $this->credentials['hostname'];
|
||||||
$db_id = $this->getDbName();
|
$db_id = $this->getDbName();
|
||||||
return "mysql:host=${hostname};dbname=${db_id}";
|
return "mysql:host={$hostname};dbname={$db_id}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getDbName()
|
private function getDbName()
|
||||||
@@ -287,7 +287,7 @@ class cPanelDeployer extends Deployer
|
|||||||
$cPanel = $this->cPanel;
|
$cPanel = $this->cPanel;
|
||||||
$username = &$this->credentials['username'];
|
$username = &$this->credentials['username'];
|
||||||
$run_id = &$this->run_id;
|
$run_id = &$this->run_id;
|
||||||
$this->db_id = $db_id = "${username}_${run_id}";
|
$this->db_id = $db_id = "{$username}_{$run_id}";
|
||||||
|
|
||||||
self::println("Ensuring that MySQL users allow any remote access hosts (%)…");
|
self::println("Ensuring that MySQL users allow any remote access hosts (%)…");
|
||||||
$remote_hosts = $cPanel->api2->MysqlFE->gethosts()->{'cpanelresult'}->{'data'};
|
$remote_hosts = $cPanel->api2->MysqlFE->gethosts()->{'cpanelresult'}->{'data'};
|
||||||
@@ -304,12 +304,12 @@ class cPanelDeployer extends Deployer
|
|||||||
$this->skip_mysql_remote_hosts = true;
|
$this->skip_mysql_remote_hosts = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::println("Creating new MySQL database \"${db_id}\"…");
|
self::println("Creating new MySQL database \"{$db_id}\"…");
|
||||||
$cPanel->uapi->Mysql->create_database(['name' => $db_id]);
|
$cPanel->uapi->Mysql->create_database(['name' => $db_id]);
|
||||||
|
|
||||||
self::println("Creating new MySQL user \"${db_id}\" with password \"${run_id}\"…");
|
self::println("Creating new MySQL user \"{$db_id}\" with password \"{$run_id}\"…");
|
||||||
$cPanel->uapi->Mysql->create_user(['name' => $db_id, 'password' => $run_id]);
|
$cPanel->uapi->Mysql->create_user(['name' => $db_id, 'password' => $run_id]);
|
||||||
self::println("Granting ALL PRIVILEGES to MySQL user \"${db_id}\"…");
|
self::println("Granting ALL PRIVILEGES to MySQL user \"{$db_id}\"…");
|
||||||
$cPanel->uapi->Mysql->set_privileges_on_database(['user' => $db_id,
|
$cPanel->uapi->Mysql->set_privileges_on_database(['user' => $db_id,
|
||||||
'database' => $db_id,
|
'database' => $db_id,
|
||||||
'privileges' => 'ALL PRIVILEGES'
|
'privileges' => 'ALL PRIVILEGES'
|
||||||
@@ -350,7 +350,7 @@ class cPanelDeployer extends Deployer
|
|||||||
$i = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
|
$i = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
|
||||||
self::println("Adding app to temporary archive…");
|
self::println("Adding app to temporary archive…");
|
||||||
$path = realpath($path);
|
$path = realpath($path);
|
||||||
foreach ($i as $relpath => $value)
|
foreach ($i as $relpath => $_value)
|
||||||
{
|
{
|
||||||
$realpath = realpath($relpath);
|
$realpath = realpath($relpath);
|
||||||
if (substr($realpath, 0, strlen($path)) === $path)
|
if (substr($realpath, 0, strlen($path)) === $path)
|
||||||
|
Reference in New Issue
Block a user