Skip to content

Commit b4a80f8

Browse files
committed
Print redis config file if saving failed
1 parent fa23e86 commit b4a80f8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

application/forms/RedisConfigForm.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use ipl\Validator\PrivateKeyValidator;
2121
use ipl\Validator\X509CertValidator;
2222
use Throwable;
23+
use Zend_Form_Decorator_Abstract;
2324
use Zend_Validate_Callback;
2425

2526
class RedisConfigForm extends ConfigForm
@@ -537,6 +538,17 @@ public function onSuccess()
537538

538539
try {
539540
$connectionConfig->saveIni();
541+
} catch(NotWritableError $e) {
542+
$this->addDecorator('ViewScript', array(
543+
'viewModule' => 'default',
544+
'viewScript' => 'showConfiguration.phtml',
545+
'errorMessage' => $e->getMessage(),
546+
'configString' => $connectionConfig,
547+
'filePath' => $connectionConfig->getConfigFile(),
548+
'placement' => Zend_Form_Decorator_Abstract::PREPEND
549+
));
550+
551+
return false;
540552
} catch (Throwable $e) {
541553
$this->addError($e->getMessage());
542554
Logger::error($e->getMessage());

0 commit comments

Comments
 (0)