@@ -25,9 +25,11 @@ |
||
25 | 25 | * |
26 | 26 | * @return void |
27 | 27 | */ |
28 | - public function do() |
|
28 | + public function do { |
|
29 | + () |
|
29 | 30 | { |
30 | 31 | global $globalaaa, $globalbbb; |
32 | + } |
|
31 | 33 | echo 'dobbb'."\n"; |
32 | 34 | $globalaaa.='+bbb'; |
33 | 35 | $globalbbb.='+bbb'; |
@@ -27,8 +27,10 @@ |
||
27 | 27 | * |
28 | 28 | * @return void |
29 | 29 | */ |
30 | - public function do() |
|
30 | + public function do { |
|
31 | + () |
|
31 | 32 | { |
32 | 33 | echo 'doaaa'."\n"; |
33 | 34 | } |
35 | + } |
|
34 | 36 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined('ODTPHP_PATHTOPCLZIP')) define('ODTPHP_PATHTOPCLZIP','pclzip/'); |
|
2 | +if (! defined('ODTPHP_PATHTOPCLZIP')) { |
|
3 | + define('ODTPHP_PATHTOPCLZIP','pclzip/'); |
|
4 | +} |
|
3 | 5 | require_once ODTPHP_PATHTOPCLZIP.'pclzip.lib.php'; |
4 | 6 | require_once 'ZipInterface.php'; |
5 | 7 | class PclZipProxyException extends Exception |
@@ -32,7 +34,10 @@ discard block |
||
32 | 34 | throw new PclZipProxyException('PclZip class not loaded - PclZip library |
33 | 35 | is required for using PclZipProxy'); ; |
34 | 36 | } |
35 | - if ($forcedir) $this->tmpdir=preg_replace('|[//\/]$|','',$forcedir); // $this->tmpdir must not contains / at the end |
|
37 | + if ($forcedir) { |
|
38 | + $this->tmpdir=preg_replace('|[//\/]$|','',$forcedir); |
|
39 | + } |
|
40 | + // $this->tmpdir must not contains / at the end |
|
36 | 41 | } |
37 | 42 | |
38 | 43 | /** |
@@ -88,10 +88,16 @@ discard block |
||
88 | 88 | { |
89 | 89 | // To provide debug information on line number processed |
90 | 90 | global $count; |
91 | - if (empty($count)) $count=1; |
|
92 | - else $count++; |
|
91 | + if (empty($count)) { |
|
92 | + $count=1; |
|
93 | + } else { |
|
94 | + $count++; |
|
95 | + } |
|
93 | 96 | |
94 | - if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps |
|
97 | + if (empty($this->savxml)) { |
|
98 | + $this->savxml = $this->xml; |
|
99 | + } |
|
100 | + // Sav content of line at first line merged, so we will reuse original for next steps |
|
95 | 101 | $this->xml = $this->savxml; |
96 | 102 | $tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values |
97 | 103 | |
@@ -123,7 +129,9 @@ discard block |
||
123 | 129 | $reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
124 | 130 | preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); |
125 | 131 | foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause |
126 | - if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml); |
|
132 | + if (!empty($match[3])) { |
|
133 | + $this->xml = str_replace($match[0], $match[3], $this->xml); |
|
134 | + } |
|
127 | 135 | } |
128 | 136 | // Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether) |
129 | 137 | $this->xml = preg_replace($reg, '', $this->xml); |
@@ -60,16 +60,16 @@ |
||
60 | 60 | if (is_array($elems)) { |
61 | 61 | foreach ($elems as $elem) { |
62 | 62 | switch ($elem['name']) { |
63 | - case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
64 | - $result['is-not-defined'] = true; |
|
65 | - break; |
|
66 | - case '{'.Plugin::NS_CALDAV.'}text-match': |
|
67 | - $result['text-match'] = [ |
|
68 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
69 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
70 | - 'value' => $elem['value'], |
|
71 | - ]; |
|
72 | - break; |
|
63 | + case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
64 | + $result['is-not-defined'] = true; |
|
65 | + break; |
|
66 | + case '{'.Plugin::NS_CALDAV.'}text-match': |
|
67 | + $result['text-match'] = [ |
|
68 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
69 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
70 | + 'value' => $elem['value'], |
|
71 | + ]; |
|
72 | + break; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -64,27 +64,27 @@ |
||
64 | 64 | if (is_array($elems)) { |
65 | 65 | foreach ($elems as $elem) { |
66 | 66 | switch ($elem['name']) { |
67 | - case '{'.Plugin::NS_CALDAV.'}comp-filter': |
|
68 | - $result['comp-filters'][] = $elem['value']; |
|
69 | - break; |
|
70 | - case '{'.Plugin::NS_CALDAV.'}prop-filter': |
|
71 | - $result['prop-filters'][] = $elem['value']; |
|
72 | - break; |
|
73 | - case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
74 | - $result['is-not-defined'] = true; |
|
75 | - break; |
|
76 | - case '{'.Plugin::NS_CALDAV.'}time-range': |
|
77 | - if ('VCALENDAR' === $result['name']) { |
|
78 | - throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); |
|
79 | - } |
|
80 | - $result['time-range'] = [ |
|
81 | - 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
82 | - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
83 | - ]; |
|
84 | - if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
85 | - throw new BadRequest('The end-date must be larger than the start-date'); |
|
86 | - } |
|
87 | - break; |
|
67 | + case '{'.Plugin::NS_CALDAV.'}comp-filter': |
|
68 | + $result['comp-filters'][] = $elem['value']; |
|
69 | + break; |
|
70 | + case '{'.Plugin::NS_CALDAV.'}prop-filter': |
|
71 | + $result['prop-filters'][] = $elem['value']; |
|
72 | + break; |
|
73 | + case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
74 | + $result['is-not-defined'] = true; |
|
75 | + break; |
|
76 | + case '{'.Plugin::NS_CALDAV.'}time-range': |
|
77 | + if ('VCALENDAR' === $result['name']) { |
|
78 | + throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); |
|
79 | + } |
|
80 | + $result['time-range'] = [ |
|
81 | + 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
82 | + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
83 | + ]; |
|
84 | + if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
85 | + throw new BadRequest('The end-date must be larger than the start-date'); |
|
86 | + } |
|
87 | + break; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
@@ -64,28 +64,28 @@ |
||
64 | 64 | if (is_array($elems)) { |
65 | 65 | foreach ($elems as $elem) { |
66 | 66 | switch ($elem['name']) { |
67 | - case '{'.Plugin::NS_CALDAV.'}param-filter': |
|
68 | - $result['param-filters'][] = $elem['value']; |
|
69 | - break; |
|
70 | - case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
71 | - $result['is-not-defined'] = true; |
|
72 | - break; |
|
73 | - case '{'.Plugin::NS_CALDAV.'}time-range': |
|
74 | - $result['time-range'] = [ |
|
75 | - 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
76 | - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
77 | - ]; |
|
78 | - if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
79 | - throw new BadRequest('The end-date must be larger than the start-date'); |
|
80 | - } |
|
81 | - break; |
|
82 | - case '{'.Plugin::NS_CALDAV.'}text-match': |
|
83 | - $result['text-match'] = [ |
|
84 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
85 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
86 | - 'value' => $elem['value'], |
|
87 | - ]; |
|
88 | - break; |
|
67 | + case '{'.Plugin::NS_CALDAV.'}param-filter': |
|
68 | + $result['param-filters'][] = $elem['value']; |
|
69 | + break; |
|
70 | + case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
71 | + $result['is-not-defined'] = true; |
|
72 | + break; |
|
73 | + case '{'.Plugin::NS_CALDAV.'}time-range': |
|
74 | + $result['time-range'] = [ |
|
75 | + 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
76 | + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
77 | + ]; |
|
78 | + if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
79 | + throw new BadRequest('The end-date must be larger than the start-date'); |
|
80 | + } |
|
81 | + break; |
|
82 | + case '{'.Plugin::NS_CALDAV.'}text-match': |
|
83 | + $result['text-match'] = [ |
|
84 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
85 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
86 | + 'value' => $elem['value'], |
|
87 | + ]; |
|
88 | + break; |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -61,22 +61,22 @@ |
||
61 | 61 | if (is_array($elems)) { |
62 | 62 | foreach ($elems as $elem) { |
63 | 63 | switch ($elem['name']) { |
64 | - case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
65 | - $result['is-not-defined'] = true; |
|
66 | - break; |
|
67 | - case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
68 | - $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
64 | + case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
65 | + $result['is-not-defined'] = true; |
|
66 | + break; |
|
67 | + case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
68 | + $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
69 | 69 | |
70 | - if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
71 | - throw new BadRequest('Unknown match-type: '.$matchType); |
|
72 | - } |
|
73 | - $result['text-match'] = [ |
|
74 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
75 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
76 | - 'value' => $elem['value'], |
|
77 | - 'match-type' => $matchType, |
|
78 | - ]; |
|
79 | - break; |
|
70 | + if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
71 | + throw new BadRequest('Unknown match-type: '.$matchType); |
|
72 | + } |
|
73 | + $result['text-match'] = [ |
|
74 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
75 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
76 | + 'value' => $elem['value'], |
|
77 | + 'match-type' => $matchType, |
|
78 | + ]; |
|
79 | + break; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
@@ -67,25 +67,25 @@ |
||
67 | 67 | if (is_array($elems)) { |
68 | 68 | foreach ($elems as $elem) { |
69 | 69 | switch ($elem['name']) { |
70 | - case '{'.Plugin::NS_CARDDAV.'}param-filter': |
|
71 | - $result['param-filters'][] = $elem['value']; |
|
72 | - break; |
|
73 | - case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
74 | - $result['is-not-defined'] = true; |
|
75 | - break; |
|
76 | - case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
77 | - $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
70 | + case '{'.Plugin::NS_CARDDAV.'}param-filter': |
|
71 | + $result['param-filters'][] = $elem['value']; |
|
72 | + break; |
|
73 | + case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
74 | + $result['is-not-defined'] = true; |
|
75 | + break; |
|
76 | + case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
77 | + $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
78 | 78 | |
79 | - if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
80 | - throw new BadRequest('Unknown match-type: '.$matchType); |
|
81 | - } |
|
82 | - $result['text-matches'][] = [ |
|
83 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
84 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
85 | - 'value' => $elem['value'], |
|
86 | - 'match-type' => $matchType, |
|
87 | - ]; |
|
88 | - break; |
|
79 | + if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
80 | + throw new BadRequest('Unknown match-type: '.$matchType); |
|
81 | + } |
|
82 | + $result['text-matches'][] = [ |
|
83 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
84 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
85 | + 'value' => $elem['value'], |
|
86 | + 'match-type' => $matchType, |
|
87 | + ]; |
|
88 | + break; |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |