Skip to content

Commit 386ffe1

Browse files
committed
ability to add extra config parameters
1 parent 9de5aaf commit 386ffe1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

connectors/php/filemanager.class.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ class Filemanager {
2525
protected $logger = false;
2626
protected $logfile = '/tmp/filemanager.log';
2727

28-
public function __construct() {
28+
public function __construct($config = '') {
2929

3030
$content = file_get_contents("../../scripts/filemanager.config.js");
3131
$config = json_decode($content, true);
3232

3333
$this->config = $config;
3434

35+
// override config options if needed
36+
if(!empty($config)) {
37+
$this->setup($config);
38+
}
39+
3540
$this->root = dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR;
3641
$this->properties = array(
3742
'Date Created'=>null,
@@ -62,6 +67,13 @@ public function __construct() {
6267
$this->availableLanguages();
6368
$this->loadLanguageFile();
6469
}
70+
71+
// $extraconfig should be formatted as json config array.
72+
public function setup($extraconfig) {
73+
74+
$this->config = array_merge($this->config, $extraconfig);
75+
76+
}
6577

6678
public function error($string,$textarea=false) {
6779
$array = array(
@@ -491,8 +503,6 @@ private function getFullPath($path = '') {
491503
if($path == '') {
492504
$path = $this->get['path'];
493505
}
494-
495-
// $this->__log('getCurrentPath : $this->doc_root ' .$this->doc_root. ' $this->get[path] : ' . $path . '');
496506

497507
if($this->config['options']['fileRoot'] !== false) {
498508
$full_path = $this->doc_root . rawurldecode(str_replace ( $this->doc_root , '' , $path));

0 commit comments

Comments
 (0)