Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
67e34e52b8 | ||
|
dc96556b5a | ||
|
31822ab7e7 | ||
|
50e9a4c621 |
@@ -19,8 +19,8 @@
|
|||||||
"bin/baikalstorage"
|
"bin/baikalstorage"
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5",
|
"php" : "^7.2 || ^8.0",
|
||||||
"sabre/dav" : "~4.1.0",
|
"sabre/dav" : "~4.3.0",
|
||||||
"sabre/vobject": "^4.2.1",
|
"sabre/vobject": "^4.2.1",
|
||||||
"nesbot/carbon": "^2.0.0",
|
"nesbot/carbon": "^2.0.0",
|
||||||
"laminas/laminas-validator": "^2.13",
|
"laminas/laminas-validator": "^2.13",
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Aerex\BaikalStorage\Configs;
|
namespace Aerex\BaikalStorage\Configs;
|
||||||
|
|
||||||
@@ -21,9 +21,9 @@ class ConfigBuilder implements ConfigurationInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigTreeBuilder() {
|
public function getConfigTreeBuilder() {
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('configs', 'array');
|
||||||
$rootNode = $treeBuilder->root('configs');
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
$ref = $rootNode->children()
|
$ref = $rootNode->children()
|
||||||
->arrayNode('general')
|
->arrayNode('general')
|
||||||
->children()
|
->children()
|
||||||
->arrayNode('logger')
|
->arrayNode('logger')
|
||||||
@@ -35,12 +35,12 @@ class ConfigBuilder implements ConfigurationInterface {
|
|||||||
->validate()
|
->validate()
|
||||||
->IfNotInArray(['DEBUG', 'INFO', 'NOTICE', 'WARNING', 'ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY'])
|
->IfNotInArray(['DEBUG', 'INFO', 'NOTICE', 'WARNING', 'ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY'])
|
||||||
->thenInvalid('Invalid log level %s')
|
->thenInvalid('Invalid log level %s')
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->arrayNode('storages')
|
->arrayNode('storages')
|
||||||
->children();
|
->children();
|
||||||
foreach ($this->configs as $config) {
|
foreach ($this->configs as $config) {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Aerex\BaikalStorage\Configs;
|
namespace Aerex\BaikalStorage\Configs;
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Aerex\BaikalStorage;
|
namespace Aerex\BaikalStorage;
|
||||||
|
|
||||||
@@ -14,20 +14,19 @@ class Console extends AbstractConsole {
|
|||||||
|
|
||||||
private function convertToString($input) {
|
private function convertToString($input) {
|
||||||
if (is_array($input)) {
|
if (is_array($input)) {
|
||||||
return json_encode($input);
|
return json_encode($input);
|
||||||
}
|
}
|
||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function execute($cmd, $args, $input = null, $envs = []) {
|
public function execute($cmd, $args, $input = null, $envs = []) {
|
||||||
$stdin[] = $cmd;
|
$stdin[] = $cmd;
|
||||||
$stdin = array_merge($stdin, $this->defaultArgs, $args);
|
$stdin = array_merge($stdin, $this->defaultArgs, $args);
|
||||||
|
|
||||||
if (isset($input)) {
|
if (isset($input)) {
|
||||||
$input = $this->convertToString($input);
|
$input = $this->convertToString($input);
|
||||||
}
|
}
|
||||||
$process = new Process(implode(' ', $stdin), null, $envs, $input);
|
$process = new Process($stdin, null, $envs, $input);
|
||||||
$process->inheritEnvironmentVariables();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$process->mustRun();
|
$process->mustRun();
|
||||||
|
Reference in New Issue
Block a user