@@ -3,7 +3,7 @@ |
||
3 | 3 | // init the output message |
4 | 4 | $message = date('Y-m-d H:i') . ' '; |
5 | 5 | try |
6 | -{ |
|
6 | +{ |
|
7 | 7 | // load the fritzbox_api class |
8 | 8 | require_once(__DIR__ . '/fritzbox_api.class.php'); |
9 | 9 | $fritz = new fritzbox_api(); |
@@ -38,13 +38,13 @@ |
||
38 | 38 | // this is based on 1 => 1, 2 => 10, 3 => 11, 4 => 100, 5 => 101, 6 => 110, 7 => 111 |
39 | 39 | $fritz->doPostForm($formfields); |
40 | 40 | } |
41 | -catch (Exception $e) |
|
41 | +catch(Exception $e) |
|
42 | 42 | { |
43 | 43 | $message .= $e->getMessage(); |
44 | 44 | } |
45 | 45 | |
46 | 46 | // log the result |
47 | -if ( isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api' ) |
|
47 | +if(isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api') |
|
48 | 48 | { |
49 | 49 | $fritz->logMessage($message); |
50 | 50 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if ( !isset($this->config) ) |
|
2 | +if(!isset($this->config)) |
|
3 | 3 | { |
4 | 4 | die(__FILE__ . ' must not be called directly'); |
5 | 5 | } |
@@ -38,13 +38,13 @@ |
||
38 | 38 | // this is based on 1 => 1, 2 => 10, 3 => 11, 4 => 100, 5 => 101, 6 => 110, 7 => 111 |
39 | 39 | $fritz->doPostForm($formfields); |
40 | 40 | } |
41 | -catch (Exception $e) |
|
41 | +catch(Exception $e) |
|
42 | 42 | { |
43 | 43 | $message .= $e->getMessage(); |
44 | 44 | } |
45 | 45 | |
46 | 46 | // log the result |
47 | -if ( isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api' ) |
|
47 | +if(isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api') |
|
48 | 48 | { |
49 | 49 | $fritz->logMessage($message); |
50 | 50 | } |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | // init the output message |
24 | 24 | $message = date('Y-m-d H:i') . ' '; |
25 | 25 | |
26 | - if ( !$fritz->config->getItem('foncallslist_path') ) |
|
26 | + if(!$fritz->config->getItem('foncallslist_path')) |
|
27 | 27 | { |
28 | 28 | throw new Exception('Mandatory config Item foncallslist_path not set.'); |
29 | 29 | } |
30 | - if ( ( file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable($fritz->config->getItem('foncallslist_path')) ) || ( !file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable(dirname($fritz->config->getItem('foncallslist_path'))) ) ) |
|
30 | + if((file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable($fritz->config->getItem('foncallslist_path'))) || (!file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable(dirname($fritz->config->getItem('foncallslist_path'))))) |
|
31 | 31 | { |
32 | 32 | throw new Exception('Config item foncallslist_path (' . $fritz->config->getItem('foncallslist_path') . ') is not writeable.'); |
33 | 33 | } |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | // set a log message |
55 | 55 | $message .= 'Call list sucessfully downloaded'; |
56 | 56 | } |
57 | -catch (Exception $e) |
|
57 | +catch(Exception $e) |
|
58 | 58 | { |
59 | 59 | $message .= $e->getMessage(); |
60 | 60 | } |
61 | 61 | |
62 | 62 | // log the result |
63 | -if ( isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api' ) |
|
63 | +if(isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api') |
|
64 | 64 | { |
65 | 65 | $fritz->logMessage($message); |
66 | 66 | } |
@@ -38,13 +38,13 @@ |
||
38 | 38 | // this is based on 1 => 1, 2 => 10, 3 => 11, 4 => 100, 5 => 101, 6 => 110, 7 => 111 |
39 | 39 | $fritz->doPostForm($formfields); |
40 | 40 | } |
41 | -catch (Exception $e) |
|
41 | +catch(Exception $e) |
|
42 | 42 | { |
43 | 43 | $message .= $e->getMessage(); |
44 | 44 | } |
45 | 45 | |
46 | 46 | // log the result |
47 | -if ( isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api' ) |
|
47 | +if(isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api') |
|
48 | 48 | { |
49 | 49 | $fritz->logMessage($message); |
50 | 50 | } |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | // init the output message |
24 | 24 | $message = date('Y-m-d H:i') . ' '; |
25 | 25 | |
26 | - if ( !$fritz->config->getItem('foncallslist_path') ) |
|
26 | + if(!$fritz->config->getItem('foncallslist_path')) |
|
27 | 27 | { |
28 | 28 | throw new Exception('Mandatory config Item foncallslist_path not set.'); |
29 | 29 | } |
30 | - if ( ( file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable($fritz->config->getItem('foncallslist_path')) ) || ( !file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable(dirname($fritz->config->getItem('foncallslist_path'))) ) ) |
|
30 | + if((file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable($fritz->config->getItem('foncallslist_path'))) || (!file_exists($fritz->config->getItem('foncallslist_path')) && !is_writable(dirname($fritz->config->getItem('foncallslist_path'))))) |
|
31 | 31 | { |
32 | 32 | throw new Exception('Config item foncallslist_path (' . $fritz->config->getItem('foncallslist_path') . ') is not writeable.'); |
33 | 33 | } |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | // set a log message |
55 | 55 | $message .= 'Call list sucessfully downloaded'; |
56 | 56 | } |
57 | -catch (Exception $e) |
|
57 | +catch(Exception $e) |
|
58 | 58 | { |
59 | 59 | $message .= $e->getMessage(); |
60 | 60 | } |
61 | 61 | |
62 | 62 | // log the result |
63 | -if ( isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api' ) |
|
63 | +if(isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api') |
|
64 | 64 | { |
65 | 65 | $fritz->logMessage($message); |
66 | 66 | } |