From e7433a204a39500f8a2be1f22681a7d13e828020 Mon Sep 17 00:00:00 2001 From: Al Ganiev Date: Sun, 26 Jan 2020 15:17:00 +1000 Subject: [PATCH] changed path in require and added maxconn option (#392) --- src/Configuration/ElFinderConfigurationReader.php | 1 + src/DependencyInjection/Configuration.php | 1 + src/Resources/views/Elfinder/helper/main.js.twig | 2 +- tests/Configuration/ElFinderConfigurationReaderTest.php | 4 ++++ tests/DependencyInjection/ConfigurationLoadTest.php | 1 + tests/Fixtures/config/config.php | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Configuration/ElFinderConfigurationReader.php b/src/Configuration/ElFinderConfigurationReader.php index 5671cd2..fd0b15a 100644 --- a/src/Configuration/ElFinderConfigurationReader.php +++ b/src/Configuration/ElFinderConfigurationReader.php @@ -108,6 +108,7 @@ public function getConfiguration(string $instance): array 'uploadAllow' => $parameter['upload_allow'], 'uploadDeny' => $parameter['upload_deny'], 'uploadMaxSize' => $parameter['upload_max_size'], + 'uploadMaxConn' => $parameter['upload_max_conn'], 'defaults' => $parameter['defaults'], 'attributes' => $parameter['attributes'], 'acceptedName' => $parameter['accepted_name'], diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 233afed..f53e54a 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -133,6 +133,7 @@ public function getConfigTreeBuilder() ->defaultValue(array('deny', 'allow')) ->end() // upload_order ->scalarNode('upload_max_size')->defaultValue(0)->end() + ->integerNode('upload_max_conn')->defaultValue(3)->end() ->arrayNode('defaults') ->useAttributeAsKey('defaults') ->normalizeKeys(false) diff --git a/src/Resources/views/Elfinder/helper/main.js.twig b/src/Resources/views/Elfinder/helper/main.js.twig index 8500830..ecf2bc9 100644 --- a/src/Resources/views/Elfinder/helper/main.js.twig +++ b/src/Resources/views/Elfinder/helper/main.js.twig @@ -115,7 +115,7 @@ // config of RequireJS (REQUIRED) require.config({ - baseUrl : 'bundles/fmelfinder/js', + baseUrl : '/bundles/fmelfinder/js', paths : { 'jquery' : '//cdnjs.cloudflare.com/ajax/libs/jquery/'+(old? '1.12.4' : jqver)+'/jquery.min', 'jquery-ui': '//cdnjs.cloudflare.com/ajax/libs/jqueryui/'+uiver+'/jquery-ui.min', diff --git a/tests/Configuration/ElFinderConfigurationReaderTest.php b/tests/Configuration/ElFinderConfigurationReaderTest.php index 8bb40a5..767bd93 100644 --- a/tests/Configuration/ElFinderConfigurationReaderTest.php +++ b/tests/Configuration/ElFinderConfigurationReaderTest.php @@ -97,6 +97,7 @@ private function getConfigurationReader($attributesObject) 'upload_allow' => '', 'upload_deny' => '', 'upload_max_size' => '', + 'upload_max_conn' => 3, 'defaults' => '', 'attributes' => '', 'accepted_name' => '', @@ -149,6 +150,7 @@ private function getConfigurationReader($attributesObject) 'upload_allow' => '', 'upload_deny' => '', 'upload_max_size' => '', + 'upload_max_conn' => 3, 'defaults' => '', 'attributes' => '', 'accepted_name' => '', @@ -201,6 +203,7 @@ private function getConfigurationReader($attributesObject) 'upload_allow' => '', 'upload_deny' => '', 'upload_max_size' => '', + 'upload_max_conn' => 3, 'defaults' => '', 'attributes' => '', 'accepted_name' => '', @@ -253,6 +256,7 @@ private function getConfigurationReader($attributesObject) 'upload_allow' => '', 'upload_deny' => '', 'upload_max_size' => '', + 'upload_max_conn' => 3, 'defaults' => '', 'attributes' => '', 'accepted_name' => '', diff --git a/tests/DependencyInjection/ConfigurationLoadTest.php b/tests/DependencyInjection/ConfigurationLoadTest.php index 8cdc909..87999e5 100644 --- a/tests/DependencyInjection/ConfigurationLoadTest.php +++ b/tests/DependencyInjection/ConfigurationLoadTest.php @@ -116,6 +116,7 @@ public function testSupportsAllConfigFormats($path) 'defaults' => array('read' => true, 'write' => true), 'upload_deny' => array('all'), 'upload_max_size' => 0, + 'upload_max_conn' => 3, 'dropbox2_settings' => array( 'aliasFormat' => '%s@Dropbox', 'path' => '/', diff --git a/tests/Fixtures/config/config.php b/tests/Fixtures/config/config.php index cb8effa..c221ad0 100644 --- a/tests/Fixtures/config/config.php +++ b/tests/Fixtures/config/config.php @@ -25,6 +25,7 @@ 'upload_allow' => array('image/png', 'image/jpg', 'image/jpeg'), 'upload_deny' => array('all'), 'upload_max_size' => 0, + 'upload_max_conn' => 3, 'dropbox2_settings' => array( 'app_key' => 'some_consumer', 'app_secret' => 'con$umer',