Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend
This commit is contained in:
@@ -30,9 +30,9 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
protected function getConfigData()
|
||||
{
|
||||
$data = $this->getConfig()->getData($this->getUser()->isAdmin());
|
||||
|
||||
|
||||
$fieldDefs = $this->getMetadata()->get('entityDefs.Settings.fields');
|
||||
|
||||
|
||||
foreach ($fieldDefs as $field => $d) {
|
||||
if ($d['type'] == 'password') {
|
||||
unset($data[$field]);
|
||||
@@ -40,7 +40,7 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function actionRead($params, $data)
|
||||
{
|
||||
return $this->getConfigData();
|
||||
@@ -52,12 +52,13 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data)
|
||||
{
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$result = $this->getConfig()->setData($data, $this->getUser()->isAdmin());
|
||||
|
||||
$this->getConfig()->setData($data, $this->getUser()->isAdmin());
|
||||
$result = $this->getConfig()->save();
|
||||
if ($result === false) {
|
||||
throw new Error('Cannot save settings');
|
||||
}
|
||||
|
||||
@@ -375,6 +375,9 @@ abstract class Base
|
||||
$manifest = $this->getManifest();
|
||||
|
||||
$res = $this->getConfig()->set('version', $manifest['version']);
|
||||
if (method_exists($this->getConfig(), 'save')) {
|
||||
$res = $this->getConfig()->save();
|
||||
}
|
||||
$res &= $this->getContainer()->get('dataManager')->rebuild();
|
||||
|
||||
return $res;
|
||||
|
||||
@@ -53,7 +53,9 @@ class Config
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $configData;
|
||||
private $data;
|
||||
|
||||
private $changedData = array();
|
||||
|
||||
private $fileManager;
|
||||
|
||||
@@ -109,28 +111,25 @@ class Config
|
||||
$name = array($name => $value);
|
||||
}
|
||||
|
||||
return $this->setArray($name);
|
||||
foreach ($name as $key => $value) {
|
||||
$this->data[$key] = $value;
|
||||
$this->changedData[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set options from array
|
||||
*
|
||||
* @param array $values
|
||||
* @return bool
|
||||
*/
|
||||
protected function setArray($values)
|
||||
public function save()
|
||||
{
|
||||
if (!is_array($values)) {
|
||||
return false;
|
||||
}
|
||||
$values = $this->changedData;
|
||||
|
||||
if (!isset($values[$this->cacheTimestamp])) {
|
||||
$values = array_merge($this->updateCacheTimestamp(true), $values);
|
||||
}
|
||||
|
||||
$result = $this->getFileManager()->mergeContentsPHP($this->configPath, $values, true);
|
||||
$this->loadConfig(true);
|
||||
if ($result) {
|
||||
$this->changedData = array();
|
||||
$this->loadConfig(true);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -147,18 +146,18 @@ class Config
|
||||
*/
|
||||
protected function loadConfig($reload = false)
|
||||
{
|
||||
if (!$reload && isset($this->configData) && !empty($this->configData)) {
|
||||
return $this->configData;
|
||||
if (!$reload && isset($this->data) && !empty($this->data)) {
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
$configPath = file_exists($this->configPath) ? $this->configPath : $this->defaultConfigPath;
|
||||
|
||||
$this->configData = $this->getFileManager()->getContents($configPath);
|
||||
$this->data = $this->getFileManager()->getContents($configPath);
|
||||
|
||||
$systemConfig = $this->getFileManager()->getContents($this->systemConfigPath);
|
||||
$this->configData = Util::merge($systemConfig, $this->configData);
|
||||
$this->data = Util::merge($systemConfig, $this->data);
|
||||
|
||||
return $this->configData;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
|
||||
@@ -170,9 +169,9 @@ class Config
|
||||
*/
|
||||
public function getData($isAdmin = false)
|
||||
{
|
||||
$configData = $this->loadConfig();
|
||||
$data = $this->loadConfig();
|
||||
|
||||
$restrictedConfig = $configData;
|
||||
$restrictedConfig = $data;
|
||||
foreach($this->getRestrictItems($isAdmin) as $name) {
|
||||
if (isset($restrictedConfig[$name])) {
|
||||
unset($restrictedConfig[$name]);
|
||||
@@ -200,7 +199,7 @@ class Config
|
||||
}
|
||||
}
|
||||
|
||||
return $this->setArray($values);
|
||||
return $this->set($values);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,14 +228,14 @@ class Config
|
||||
*/
|
||||
protected function getRestrictItems($onlySystemItems = false)
|
||||
{
|
||||
$configData = $this->loadConfig();
|
||||
$data = $this->loadConfig();
|
||||
|
||||
if ($onlySystemItems) {
|
||||
return $configData['systemItems'];
|
||||
return $data['systemItems'];
|
||||
}
|
||||
|
||||
if (empty($this->adminItems)) {
|
||||
$this->adminItems= Util::merge($configData['systemItems'], $configData['adminItems']);
|
||||
$this->adminItems= Util::merge($data['systemItems'], $data['adminItems']);
|
||||
}
|
||||
|
||||
return $this->adminItems;
|
||||
|
||||
@@ -65,6 +65,7 @@ class Installer
|
||||
if (!file_exists($configPath)) {
|
||||
$configData = $this->getConfig()->getDefaults();
|
||||
$this->getConfig()->set($configData);
|
||||
$this->getConfig()->save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +168,8 @@ class Installer
|
||||
{
|
||||
$config = $this->app->getContainer()->get('config');
|
||||
|
||||
$result = $config->set($data);
|
||||
$config->set($data);
|
||||
$result = $config->save();
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -314,7 +316,8 @@ class Installer
|
||||
public function setSuccess()
|
||||
{
|
||||
$config = $this->app->getContainer()->get('config');
|
||||
$result = $config->set('isInstalled', true);
|
||||
$config->set('isInstalled', true);
|
||||
$result = $config->save();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -76,13 +76,13 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function checkDbConnection($hostName, $dbUserName, $dbUserPass, $dbName, $dbDriver = 'pdo_mysql')
|
||||
public function checkDbConnection($hostName, $port ,$dbUserName, $dbUserPass, $dbName, $dbDriver = 'pdo_mysql')
|
||||
{
|
||||
$result['success'] = true;
|
||||
|
||||
switch ($dbDriver) {
|
||||
case 'mysqli':
|
||||
$mysqli = new mysqli($hostName, $dbUserName, $dbUserPass, $dbName);
|
||||
$mysqli = (empty($port)) ? new mysqli($hostName, $dbUserName, $dbUserPass, $dbName) : new mysqli($hostName, $dbUserName, $dbUserPass, $dbName, $port);
|
||||
if (!$mysqli->connect_errno) {
|
||||
$mysqli->close();
|
||||
}
|
||||
@@ -95,7 +95,8 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
|
||||
case 'pdo_mysql':
|
||||
try {
|
||||
$dbh = new PDO("mysql:host={$hostName};dbname={$dbName}", $dbUserName, $dbUserPass);
|
||||
$dsn = "mysql:host={$hostName};" . ((!empty($port)) ? "port={$port};" : '') . "dbname={$dbName}";
|
||||
$dbh = new PDO($dsn, $dbUserName, $dbUserPass);
|
||||
$dbh = null;
|
||||
} catch (PDOException $e) {
|
||||
|
||||
@@ -129,48 +130,9 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
return $this->modRewriteUrl;
|
||||
}
|
||||
|
||||
public function getChmodCommand($path, $permissions = array('755'), $isSudo = false, $isFile = null, $isCd = true)
|
||||
{
|
||||
//$path = $this->getFullPath($path);
|
||||
|
||||
$path = empty($path) ? '*' : $path;
|
||||
if (is_array($path)) {
|
||||
$path = implode(' ', $path);
|
||||
}
|
||||
|
||||
$sudoStr = $isSudo ? 'sudo ' : '';
|
||||
|
||||
$cd = $isCd ? $this->getCd(true) : '';
|
||||
|
||||
if (is_string($permissions)) {
|
||||
$permissions = (array) $permissions;
|
||||
}
|
||||
|
||||
if (!isset($isFile) && count($permissions) == 1) {
|
||||
return $cd.$sudoStr.'chmod -R '.$permissions[0].' '.$path;
|
||||
}
|
||||
|
||||
$bufPerm = (count($permissions) == 1) ? array_fill(0, 2, $permissions[0]) : $permissions;
|
||||
|
||||
$commands = array();
|
||||
|
||||
if ($isCd) {
|
||||
$commands[] = $this->getCd();
|
||||
}
|
||||
|
||||
$commands[] = $sudoStr.'chmod '.$bufPerm[0].' $(find '.$path.' -type f)';
|
||||
$commands[] = $sudoStr.'chmod '.$bufPerm[1].' $(find '.$path.' -type d)';
|
||||
|
||||
if (count($permissions) >= 2) {
|
||||
return implode(' ' . $this->combineOperator . ' ', $commands);
|
||||
}
|
||||
|
||||
return $isFile ? $commands[0] : $commands[1];
|
||||
}
|
||||
|
||||
public function getChownCommand($path, $isSudo = false, $isCd = true)
|
||||
{
|
||||
$path = empty($path) ? '*' : $path;
|
||||
$path = empty($path) ? '.' : $path;
|
||||
if (is_array($path)) {
|
||||
$path = implode(' ', $path);
|
||||
}
|
||||
@@ -193,6 +155,46 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
return $cd.$sudoStr.'chown -R '.$owner.':'.$group.' '.$path;
|
||||
}
|
||||
|
||||
|
||||
public function getChmodCommand($path, $permissions = array('755'), $isSudo = false, $isFile = null, $isCd = true)
|
||||
{
|
||||
//$path = $this->getFullPath($path);
|
||||
|
||||
$path = empty($path) ? '.' : $path;
|
||||
if (is_array($path)) {
|
||||
$path = implode(' ', $path);
|
||||
}
|
||||
|
||||
$sudoStr = $isSudo ? 'sudo ' : '';
|
||||
|
||||
$cd = $isCd ? $this->getCd(true) : '';
|
||||
|
||||
if (is_string($permissions)) {
|
||||
$permissions = (array) $permissions;
|
||||
}
|
||||
|
||||
if (!isset($isFile) && count($permissions) == 1) {
|
||||
return $cd.'find '.$path.' -type d -exec ' . $sudoStr . 'chmod '.$permissions[0].' {} +';
|
||||
}
|
||||
|
||||
$bufPerm = (count($permissions) == 1) ? array_fill(0, 2, $permissions[0]) : $permissions;
|
||||
|
||||
$commands = array();
|
||||
|
||||
if ($isCd) {
|
||||
$commands[] = $this->getCd();
|
||||
}
|
||||
|
||||
$commands[] = 'find '.$path.' -type f -exec ' .$sudoStr.'chmod '.$bufPerm[0].' {} +';//.'chmod '.$bufPerm[0].' $(find '.$path.' -type f)';
|
||||
$commands[] = 'find '.$path.' -type d -exec ' .$sudoStr. 'chmod '.$bufPerm[1].' {} +';//.'chmod '.$bufPerm[1].' $(find '.$path.' -type d)';
|
||||
|
||||
if (count($permissions) >= 2) {
|
||||
return implode(' ' . $this->combineOperator . ' ', $commands);
|
||||
}
|
||||
|
||||
return $isFile ? $commands[0] : $commands[1];
|
||||
}
|
||||
|
||||
public function getFullPath($path)
|
||||
{
|
||||
if (is_array($path)) {
|
||||
@@ -219,7 +221,7 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
* @param bool $isFile
|
||||
* @return string
|
||||
*/
|
||||
public function getPermissionCommands($path, $permissions = array('644', '755'), $isSudo = false, $isFile = null)
|
||||
public function getPermissionCommands($path, $permissions = array('644', '755'), $isSudo = false, $isFile = null, $changeOwner = true)
|
||||
{
|
||||
if (is_string($path)) {
|
||||
$path = array_fill(0, 2, $path);
|
||||
@@ -229,11 +231,12 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
$commands = array();
|
||||
$commands[] = $this->getChmodCommand($chmodPath, $permissions, $isSudo, $isFile);
|
||||
|
||||
$chown = $this->getChownCommand($chownPath, $isSudo, false);
|
||||
if (isset($chown)) {
|
||||
$commands[] = $chown;
|
||||
if ($changeOwner) {
|
||||
$chown = $this->getChownCommand($chownPath, $isSudo, false);
|
||||
if (isset($chown)) {
|
||||
$commands[] = $chown;
|
||||
}
|
||||
}
|
||||
|
||||
return implode(' ' . $this->combineOperator . ' ', $commands).';';
|
||||
}
|
||||
|
||||
|
||||
@@ -26,12 +26,16 @@ $result = array('success' => true, 'errorMsg' => '');
|
||||
// save settings
|
||||
$data = array(
|
||||
'driver' => 'pdo_mysql',
|
||||
'host' => $_SESSION['install']['host-name'],
|
||||
'port' => $_SESSION['install']['port'],
|
||||
'dbname' => $_SESSION['install']['db-name'],
|
||||
'user' => $_SESSION['install']['db-user-name'],
|
||||
'password' => $_SESSION['install']['db-user-password'],
|
||||
);
|
||||
$host = $_SESSION['install']['host-name'];
|
||||
if (strpos($host,':') === false) {
|
||||
$host .= ":";
|
||||
}
|
||||
list($data['host'], $data['port']) = explode(':', $host);
|
||||
|
||||
$lang = (!empty($_SESSION['install']['user-lang']))? $_SESSION['install']['user-lang'] : 'en_US';
|
||||
if (!$installer->saveData($data, $lang)) {
|
||||
$result['success'] = false;
|
||||
@@ -39,4 +43,4 @@ if (!$installer->saveData($data, $lang)) {
|
||||
}
|
||||
|
||||
ob_clean();
|
||||
echo json_encode($result);
|
||||
echo json_encode($result);
|
||||
|
||||
@@ -31,11 +31,17 @@ if (!$installer->checkPermission()) {
|
||||
foreach($error as $folder => $permission) {
|
||||
$group[implode('-', $permission)][] = $folder;
|
||||
}
|
||||
ksort($group);
|
||||
$instruction = '';
|
||||
$instructionSU = '';
|
||||
$changeOwner = true;
|
||||
foreach($group as $permission => $folders) {
|
||||
$instruction .= $systemHelper->getPermissionCommands(array($folders, ''), explode('-', $permission)) . "<br>";
|
||||
$instructionSU .= " " . $systemHelper->getPermissionCommands(array($folders, ''), explode('-', $permission), true) . "<br>";
|
||||
if ($permission == '0644-0755') $folders = '';
|
||||
$instruction .= $systemHelper->getPermissionCommands(array($folders, ''), explode('-', $permission), false, null, $changeOwner) . "<br>";
|
||||
$instructionSU .= " " . $systemHelper->getPermissionCommands(array($folders, ''), explode('-', $permission), true, null, $changeOwner) . "<br>";
|
||||
if ($changeOwner) {
|
||||
$changeOwner = false;
|
||||
}
|
||||
}
|
||||
$result['errorMsg'] = $langs['messages']['Permission denied to'] . ':<br><pre>/'.implode('<br>/', $urls).'</pre>';
|
||||
$result['errorFixInstruction'] = str_replace( '"{C}"' , $instruction, $langs['messages']['permissionInstruction']) . "<br>" .
|
||||
|
||||
@@ -34,12 +34,15 @@ if (!empty($_REQUEST['dbName']) && !empty($_REQUEST['hostName']) && !empty($_REQ
|
||||
$connect = false;
|
||||
|
||||
$dbName = trim($_REQUEST['dbName']);
|
||||
$hostName = trim($_REQUEST['hostName']);
|
||||
if (strpos($_REQUEST['hostName'],':') === false) {
|
||||
$_REQUEST['hostName'] .= ":";
|
||||
}
|
||||
list($hostName, $port) = explode(':', trim($_REQUEST['hostName']));
|
||||
$dbUserName = trim($_REQUEST['dbUserName']);
|
||||
$dbUserPass = trim($_REQUEST['dbUserPass']);
|
||||
$dbDriver = (!empty($_REQUEST['dbDriver']))? $_REQUEST['dbDriver'] : 'pdo_mysql';
|
||||
|
||||
$res = $systemHelper->checkDbConnection($hostName, $dbUserName, $dbUserPass, $dbName, $dbDriver);
|
||||
$res = $systemHelper->checkDbConnection($hostName, $port, $dbUserName, $dbUserPass, $dbName, $dbDriver);
|
||||
$result['success'] &= $res['success'];
|
||||
if (!empty($res['errors'])) {
|
||||
$result['errors'] = array_merge($result['errors'], $res['errors']);
|
||||
@@ -48,4 +51,4 @@ if (!empty($_REQUEST['dbName']) && !empty($_REQUEST['hostName']) && !empty($_REQ
|
||||
}
|
||||
|
||||
ob_clean();
|
||||
echo json_encode($result);
|
||||
echo json_encode($result);
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
"Next": "Next",
|
||||
"Go to EspoCRM": "Go to EspoCRM",
|
||||
"Re-check": "Re-check",
|
||||
"Test settings": "Test Connection"
|
||||
"Test settings": "Test Connection",
|
||||
"Database Settings Description": "Enter your MySQL database connection information (hostname, username and password). You can specify the server port for hostname like localhost:3306."
|
||||
},
|
||||
"fields": {
|
||||
"Choose your language:": "Choose your language:",
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
"Next": "Next",
|
||||
"Go to EspoCRM": "Go to EspoCRM",
|
||||
"Re-check": "Re-check",
|
||||
"Test settings": "Test Connection"
|
||||
"Test settings": "Test Connection",
|
||||
"Database Settings Description": "Enter your MySQL database connection information (hostname, username and password). You can specify the server port for hostname like localhost:3306."
|
||||
},
|
||||
"fields": {
|
||||
"Choose your language:": "Choose your language:",
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
"Next": "Siguiente",
|
||||
"Go to EspoCRM": "Ir a EspoCRM(Español)",
|
||||
"Re-check": "Revisar otra vez",
|
||||
"Test settings": "Test de conexión"
|
||||
"Test settings": "Test de conexión",
|
||||
"Database Settings Description": "Enter your MySQL database connection information (hostname, username and password). You can specify the server port for hostname like localhost:3306."
|
||||
},
|
||||
"fields": {
|
||||
"Choose your language:": "Seleccione un lenguaje:",
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="modal-footer">
|
||||
<div class="cell cell-website pull-left" align="left">
|
||||
<label class="field-label-website control-label">{$langs['fields']['Choose your language:']}</label>
|
||||
<div class="field field-website">
|
||||
@@ -30,6 +28,9 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="modal-footer">
|
||||
|
||||
<button class="btn btn-primary" type="button" id="start">{$langs['labels']['Start']}</button>
|
||||
</footer>
|
||||
</form>
|
||||
@@ -43,3 +44,4 @@
|
||||
})
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
|
||||
+24
-37
@@ -10,55 +10,23 @@
|
||||
<div class=" col-md-6">
|
||||
<div class="row">
|
||||
<div class="cell cell-website col-sm-12 form-group">
|
||||
<div class="host-name-c cell">
|
||||
<label class="field-label-website control-label">{$langs['fields']['Host Name']} *</label>
|
||||
<div class="field field-website">
|
||||
<input type="text" value="{$fields['host-name'].value}" name="host-name" class="main-element form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="semicolon-sign-c cell">
|
||||
<label class="field-label-website control-label"> </label>
|
||||
<div class="semicolon-sign">:</div>
|
||||
</div>
|
||||
<div class="port-c cell">
|
||||
<label class="field-label-website control-label">{$langs['fields']['Port']}</label>
|
||||
<div class="field field-website">
|
||||
<input type="text" value="{$fields['port'].value}" name="port" class="main-element form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class=" col-md-6">
|
||||
<div class="row">
|
||||
<div class="cell cell-website col-sm-12 form-group">
|
||||
<label class="field-label-website control-label">{$langs['fields']['Database Name']} *</label>
|
||||
<div class="field field-website">
|
||||
<input type="text" value="{$fields['db-name'].value}" name="db-name" class="main-element form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class=" col-md-6">
|
||||
<div class="row">
|
||||
<div class="cell cell-website col-sm-12 form-group">
|
||||
<label class="field-label-website control-label">{$langs['fields']['Database User Name']} *</label>
|
||||
<div class="field field-website">
|
||||
<input type="text" value="{$fields['db-user-name'].value}" name="db-user-name" class="main-element form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class=" col-md-6">
|
||||
<div class="row">
|
||||
<div class="cell cell-website col-sm-12 form-group">
|
||||
<label class="field-label-website control-label">{$langs['fields']['Database User Password']}</label>
|
||||
<div class="field field-website">
|
||||
@@ -67,12 +35,31 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-md-6">
|
||||
<div class="row">
|
||||
<div class="cell cell-website col-sm-12 form-group">
|
||||
<div class="label-description">
|
||||
{$langs['labels']['Database Settings Description']}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<div class="btn-panel">
|
||||
<button class="btn btn-default" type="button" id="test-connection">{$langs['labels']['Test settings']}</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class=" col-md-6">
|
||||
<div class="row">
|
||||
<div class="cell cell-website col-sm-12 form-group">
|
||||
<div class="btn-panel">
|
||||
<button class="btn btn-default" type="button" id="test-connection">{$langs['labels']['Test settings']}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="modal-footer">
|
||||
@@ -88,4 +75,4 @@
|
||||
var installScript = new InstallScript({action: 'step2', langs: langs});
|
||||
})
|
||||
{/literal}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -56,6 +56,13 @@ select[name="user-lang"] {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.label-description {
|
||||
line-height: 24px;
|
||||
height: 33px;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
padding: 14px 0 5px;
|
||||
}
|
||||
.semicolon-sign-c {
|
||||
text-align: center;
|
||||
width: 4%;
|
||||
|
||||
@@ -67,10 +67,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
||||
$setKey= 'testOption';
|
||||
$setValue= 'Test';
|
||||
|
||||
$this->assertTrue($this->object->set($setKey, $setValue));
|
||||
$this->object->set($setKey, $setValue);
|
||||
$this->assertTrue($this->object->save());
|
||||
$this->assertEquals($setValue, $this->object->get($setKey));
|
||||
|
||||
$this->assertTrue($this->object->set($setKey, 'Another Wrong Value'));
|
||||
$this->object->set($setKey, 'Another Wrong Value');
|
||||
$this->assertTrue($this->object->save());
|
||||
}
|
||||
|
||||
public function testSetArray()
|
||||
@@ -80,14 +82,16 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
||||
'testOption2' => 'Test2',
|
||||
);
|
||||
|
||||
$this->assertTrue($this->object->set($values));
|
||||
$this->object->set($values);
|
||||
$this->assertTrue($this->object->save());
|
||||
$this->assertEquals('Test', $this->object->get('testOption'));
|
||||
$this->assertEquals('Test2', $this->object->get('testOption2'));
|
||||
|
||||
$wrongArray = array(
|
||||
'testOption' => 'Another Wrong Value',
|
||||
);
|
||||
$this->assertTrue($this->object->set($wrongArray));
|
||||
$this->object->set($wrongArray);
|
||||
$this->assertTrue($this->object->save());
|
||||
}
|
||||
|
||||
public function testSystemConfigMerge()
|
||||
|
||||
Reference in New Issue
Block a user