@@ -23,30 +23,30 @@ |
||
23 | 23 | |
24 | 24 | $lang = $this->generalSettings['PBXLanguage']; |
25 | 25 | |
26 | - $conf = "[directories]\n" . |
|
27 | - "astetcdir => {$this->config->path('asterisk.astetcdir')}\n" . |
|
28 | - "astagidir => {$this->config->path('asterisk.astagidir')}\n" . |
|
29 | - "astkeydir => /etc/asterisk\n" . |
|
30 | - "astrundir => /var/asterisk/run\n" . |
|
31 | - "astmoddir => {$this->config->path('asterisk.astmoddir')}\n" . |
|
32 | - "astvarlibdir => {$this->config->path('asterisk.astvarlibdir')}\n" . |
|
33 | - "astdbdir => {$this->config->path('asterisk.astdbdir')}\n" . |
|
34 | - "astlogdir => {$this->config->path('asterisk.astlogdir')}\n" . |
|
35 | - "astspooldir => {$this->config->path('asterisk.astspooldir')}\n" . |
|
36 | - "\n" . |
|
37 | - "\n" . |
|
38 | - "[options]\n" . |
|
39 | - "verbose = 0\n" . |
|
40 | - "debug = 0\n" . |
|
41 | - "dumpcore = no\n" . |
|
42 | - "transcode_via_sln = no\n" . |
|
43 | - "hideconnect = yes\n" . |
|
44 | - "defaultlanguage = {$lang}\n" . |
|
45 | - "cache_media_frames = yes\n" . |
|
46 | - "cache_record_files = yes\n" . |
|
47 | - "record_cache_dir = /tmp\n" . |
|
26 | + $conf = "[directories]\n". |
|
27 | + "astetcdir => {$this->config->path('asterisk.astetcdir')}\n". |
|
28 | + "astagidir => {$this->config->path('asterisk.astagidir')}\n". |
|
29 | + "astkeydir => /etc/asterisk\n". |
|
30 | + "astrundir => /var/asterisk/run\n". |
|
31 | + "astmoddir => {$this->config->path('asterisk.astmoddir')}\n". |
|
32 | + "astvarlibdir => {$this->config->path('asterisk.astvarlibdir')}\n". |
|
33 | + "astdbdir => {$this->config->path('asterisk.astdbdir')}\n". |
|
34 | + "astlogdir => {$this->config->path('asterisk.astlogdir')}\n". |
|
35 | + "astspooldir => {$this->config->path('asterisk.astspooldir')}\n". |
|
36 | + "\n". |
|
37 | + "\n". |
|
38 | + "[options]\n". |
|
39 | + "verbose = 0\n". |
|
40 | + "debug = 0\n". |
|
41 | + "dumpcore = no\n". |
|
42 | + "transcode_via_sln = no\n". |
|
43 | + "hideconnect = yes\n". |
|
44 | + "defaultlanguage = {$lang}\n". |
|
45 | + "cache_media_frames = yes\n". |
|
46 | + "cache_record_files = yes\n". |
|
47 | + "record_cache_dir = /tmp\n". |
|
48 | 48 | "systemname = mikopbx\n"; |
49 | 49 | |
50 | - Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/asterisk.conf', $conf); |
|
50 | + Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/asterisk.conf', $conf); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | \ No newline at end of file |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $response = json_decode($response, true); |
66 | 66 | |
67 | 67 | $filename = $response['data']['filename'] ?? ''; |
68 | - if ( ! file_exists($filename)) { |
|
68 | + if (!file_exists($filename)) { |
|
69 | 69 | $response['messages'][] = 'Log file not found'; |
70 | 70 | } else { |
71 | 71 | $response['data']['filename'] = $filename; |
72 | - $response['data']['content'] = mb_convert_encoding('' . file_get_contents($filename), 'UTF-8', 'UTF-8'); |
|
72 | + $response['data']['content'] = mb_convert_encoding(''.file_get_contents($filename), 'UTF-8', 'UTF-8'); |
|
73 | 73 | unlink($filename); |
74 | 74 | } |
75 | 75 | |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | if (array_key_exists('filename', $response['data'])) { |
102 | 102 | $di = Di::getDefault(); |
103 | 103 | $downloadLink = $di->getShared('config')->path('www.downloadCacheDir'); |
104 | - $filename = $downloadLink . "/" . $response['data']['filename'] ?? ''; |
|
105 | - if ( ! file_exists($filename)) { |
|
104 | + $filename = $downloadLink."/".$response['data']['filename'] ?? ''; |
|
105 | + if (!file_exists($filename)) { |
|
106 | 106 | $response['messages'][] = 'File not found'; |
107 | 107 | } else { |
108 | 108 | $scheme = $this->request->getScheme(); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | { |
31 | 31 | $di->setShared( |
32 | 32 | self::SERVICE_NAME, |
33 | - function () { |
|
33 | + function() { |
|
34 | 34 | $response = new Response(); |
35 | 35 | |
36 | 36 | /** |
@@ -30,7 +30,8 @@ |
||
30 | 30 | { |
31 | 31 | $di->setShared( |
32 | 32 | self::SERVICE_NAME, |
33 | - function () { |
|
33 | + function () |
|
34 | + { |
|
34 | 35 | $response = new Response(); |
35 | 36 | |
36 | 37 | /** |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () { |
|
36 | + function() { |
|
37 | 37 | return new BeanstalkClient(WorkerApiCommands::class); |
38 | 38 | } |
39 | 39 | ); |
@@ -33,7 +33,8 @@ |
||
33 | 33 | { |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () { |
|
36 | + function () |
|
37 | + { |
|
37 | 38 | return new BeanstalkClient(WorkerApiCommands::class); |
38 | 39 | } |
39 | 40 | ); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | $di->setShared( |
37 | 37 | self::SERVICE_NAME, |
38 | - function () { |
|
38 | + function() { |
|
39 | 39 | // Create a events manager |
40 | 40 | $eventsManager = new EventsManager(); |
41 | 41 | $dispatcher = new Dispatcher(); |
@@ -35,7 +35,8 @@ |
||
35 | 35 | { |
36 | 36 | $di->setShared( |
37 | 37 | self::SERVICE_NAME, |
38 | - function () { |
|
38 | + function () |
|
39 | + { |
|
39 | 40 | // Create a events manager |
40 | 41 | $eventsManager = new EventsManager(); |
41 | 42 | $dispatcher = new Dispatcher(); |
@@ -129,14 +129,14 @@ |
||
129 | 129 | |
130 | 130 | //Add modules firewall rules |
131 | 131 | $di = Di::getDefault(); |
132 | - if ($di!==null) { |
|
132 | + if ($di !== null) { |
|
133 | 133 | $pbxConfModules = $di->get('pbxConfModules'); |
134 | - foreach ($pbxConfModules as $pbxConfModule){ |
|
134 | + foreach ($pbxConfModules as $pbxConfModule) { |
|
135 | 135 | $additionalRules = $pbxConfModule->getDefaultFirewallRules(); |
136 | - if ($additionalRules!==[]){ |
|
136 | + if ($additionalRules !== []) { |
|
137 | 137 | $additionalRules = array_change_key_case($additionalRules, CASE_UPPER); |
138 | - foreach ($additionalRules as $key=>$rule){ |
|
139 | - $template[$key]=$rule; |
|
138 | + foreach ($additionalRules as $key=>$rule) { |
|
139 | + $template[$key] = $rule; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $gnatsConfig = $di->getShared('config')->get('gnats'); |
35 | 35 | $di->setShared( |
36 | 36 | self::SERVICE_NAME, |
37 | - function () use ($gnatsConfig) { |
|
37 | + function() use ($gnatsConfig) { |
|
38 | 38 | $connectionOptions = new NatsConnectionOptions(); |
39 | 39 | $host = $gnatsConfig->host; |
40 | 40 | $port = $gnatsConfig->port; |
@@ -34,7 +34,8 @@ |
||
34 | 34 | $gnatsConfig = $di->getShared('config')->get('gnats'); |
35 | 35 | $di->setShared( |
36 | 36 | self::SERVICE_NAME, |
37 | - function () use ($gnatsConfig) { |
|
37 | + function () use ($gnatsConfig) |
|
38 | + { |
|
38 | 39 | $connectionOptions = new NatsConnectionOptions(); |
39 | 40 | $host = $gnatsConfig->host; |
40 | 41 | $port = $gnatsConfig->port; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $baseUri = $di->getShared('config')->path('adminApplication.baseUri'); |
41 | 41 | $di->setShared( |
42 | 42 | self::SERVICE_NAME, |
43 | - function () use ($baseUri) { |
|
43 | + function() use ($baseUri) { |
|
44 | 44 | $url = new Url(); |
45 | 45 | $url->setBaseUri($baseUri); |
46 | 46 |
@@ -40,7 +40,8 @@ |
||
40 | 40 | $baseUri = $di->getShared('config')->path('adminApplication.baseUri'); |
41 | 41 | $di->setShared( |
42 | 42 | self::SERVICE_NAME, |
43 | - function () use ($baseUri) { |
|
43 | + function () use ($baseUri) |
|
44 | + { |
|
44 | 45 | $url = new Url(); |
45 | 46 | $url->setBaseUri($baseUri); |
46 | 47 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $di->setShared( |
40 | 40 | self::SERVICE_NAME, |
41 | - function () { |
|
41 | + function() { |
|
42 | 42 | return new Registry(); |
43 | 43 | } |
44 | 44 | ); |
@@ -38,7 +38,8 @@ |
||
38 | 38 | { |
39 | 39 | $di->setShared( |
40 | 40 | self::SERVICE_NAME, |
41 | - function () { |
|
41 | + function () |
|
42 | + { |
|
42 | 43 | return new Registry(); |
43 | 44 | } |
44 | 45 | ); |