Completed
Pull Request — master (#26)
by Lars
14:13
created
src/Intraface/XMLRPC/OnlinePayment/Server0100.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         if (!$payment_id = $onlinepayment->save($values)) {
135 135
             // this is probably a little to hard reaction.
136
-            throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt ' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
136
+            throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt '.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
137 137
         }
138 138
 
139 139
         if ($onlinepayment->get('status') == 'authorized') {
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
             // @todo: Change with gateway.
167 167
             $settings = $doctrine->getTable('Intraface_modules_onlinepayment_Language')->findOneByIntranetId($kernel->intranet->getId());
168 168
 
169
-            $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()) . ' (#' . $payment_id . ')';
170
-            $body = $settings->getConfirmationEmailBody($shop->getLanguage()) . "\n\n" . $this->kernel->intranet->address->get('name');
169
+            $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()).' (#'.$payment_id.')';
170
+            $body = $settings->getConfirmationEmailBody($shop->getLanguage())."\n\n".$this->kernel->intranet->address->get('name');
171 171
         } catch (Exception $e) {
172 172
         }
173 173
 
174 174
         if (empty($subject)) {
175
-            $subject = 'Payment confirmation / betalingsbekræftelse (#' . $payment_id . ')';
175
+            $subject = 'Payment confirmation / betalingsbekræftelse (#'.$payment_id.')';
176 176
         }
177 177
 
178 178
         if (empty($body)) {
179
-            $body    = 'We have received your payment for order #' .$debtor->getId(). '.' . "\n\n";
180
-            $body   .= 'Vi har modtaget din betaling for ordre #' .$debtor->getId(). '.';
181
-            $body   .= "\n\nYours sincerely / Venlig hilsen\n".  $this->kernel->intranet->address->get('name');
179
+            $body    = 'We have received your payment for order #'.$debtor->getId().'.'."\n\n";
180
+            $body   .= 'Vi har modtaget din betaling for ordre #'.$debtor->getId().'.';
181
+            $body   .= "\n\nYours sincerely / Venlig hilsen\n".$this->kernel->intranet->address->get('name');
182 182
         }
183 183
 
184 184
         $data = array('contact_id' => $debtor->getContact()->getId(),
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
         if (!$email->queue()) {
197 197
             $this->error->merge($email->error->getMessage());
198
-            throw new Exception('Could not send email to ' . $debtor->getContact()->getId());
198
+            throw new Exception('Could not send email to '.$debtor->getContact()->getId());
199 199
         }
200 200
 
201 201
         return true;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         if (!$payment_id = $onlinepayment->create()) {
217 217
             // this is probably a little to hard reaction
218
-            throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
218
+            throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
219 219
         }
220 220
 
221 221
         return $this->prepareResponseData($payment_id);
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Admin/Server.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
         $db = MDB2::singleton(DB_DSN);
30 30
 
31 31
         if (PEAR::isError($db)) {
32
-            throw new XML_RPC2_Exception('error accessing the database ' . $db->getUserInfo());
32
+            throw new XML_RPC2_Exception('error accessing the database '.$db->getUserInfo());
33 33
         }
34 34
 
35 35
         $db->setFetchMode(MDB2_FETCHMODE_ASSOC);
36 36
         $result = $db->query("SELECT id, name, private_key FROM intranet WHERE identifier = ".$db->quote($intranet_identifier, 'text')." AND identifier <> ''");
37 37
 
38 38
         if (PEAR::isError($result)) {
39
-            throw new XML_RPC2_Exception('error querying the database ' . $result->getUserInfo());
39
+            throw new XML_RPC2_Exception('error querying the database '.$result->getUserInfo());
40 40
         }
41 41
 
42 42
         if ($result->numRows() <> 1) {
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/CMS/Server0300.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             // niveau 9999 g�r at den ikke kan genkende den, og tager top_level.
67 67
             // 0 der ellers skulle v�re topmenu virker af en m�rkelig grund ikke. Variablen er ikke registeret som sat!
68 68
             //
69
-            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array');    // 'toplevel'
69
+            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
70 70
             $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
71 71
             $cmspage->value['sections'] = $cmspage->collect();
72 72
             $cmspage->value['comments'] = $cmspage->getComments();
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $this->factory($site_id);
150 150
 
151 151
         $cmspage = new CMS_Page($this->site);
152
-        $value['toplevel'] = $cmspage->navigation->build(9999, 'array');    // 'toplevel'
152
+        $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
153 153
         $value['sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
154 154
 
155 155
         return $this->prepareResponseData($value);
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/CMS/Server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
              * niveau 9999 g�r at den ikke kan genkende den, og tager top_level.
68 68
              * 0 der ellers skulle v�re topmenu virker af en m�rkelig grund ikke. Variablen er ikke registeret som sat!
69 69
              */
70
-            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array');    // 'toplevel'
70
+            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
71 71
             $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
72 72
             $cmspage->value['sections'] = $cmspage->collect();
73 73
             $cmspage->value['comments'] = $cmspage->getComments();
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/CMS/Server0400.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             // level 9999 cannot be recognized, so we take top level
64 64
             // 0 which should be top level does not work - the variable is not set
65 65
 
66
-            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array');    // 'toplevel'
66
+            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
67 67
             $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
68 68
             $cmspage->value['sections'] = $cmspage->collect();
69 69
             $cmspage->value['comments'] = $cmspage->getComments();
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $this->factory($site_id);
146 146
 
147 147
         $cmspage = new CMS_Page($this->site);
148
-        $value['toplevel'] = $cmspage->navigation->build(9999, 'array');    // 'toplevel'
148
+        $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
149 149
         $value['sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
150 150
 
151 151
         return $this->prepareResponseData($value);
Please login to merge, or discard this patch.
src/Intraface/Main.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     function includeFile($file)
161 161
     {
162 162
         // @todo constant should be removed
163
-        $file = PATH_INCLUDE_MODULE . $this->module_name . '/' . $file;
163
+        $file = PATH_INCLUDE_MODULE.$this->module_name.'/'.$file;
164 164
         if (!file_exists($file)) {
165 165
             return false;
166 166
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         // @todo global should be removed
220 220
         global $_setting; // globalized other places also
221 221
 
222
-        include(dirname(__FILE__). '/modules/' .$this->module_name.'/'.$file);
222
+        include(dirname(__FILE__).'/modules/'.$this->module_name.'/'.$file);
223 223
     }
224 224
 
225 225
     /**
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     public function getPath()
231 231
     {
232
-        return PATH_WWW . 'restricted/module/' . $this->module_name . '/';
232
+        return PATH_WWW.'restricted/module/'.$this->module_name.'/';
233 233
     }
234 234
 
235 235
     /**
Please login to merge, or discard this patch.
src/Intraface/Pdf.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         if (is_int($value)) {
105 105
             $this->value['x'] = $this->get('margin_left') + $value;
106 106
         } elseif (is_string($value) && substr($value, 0, 1) == "+") {
107
-            $this->value['x'] +=  intval(substr($value, 1));
107
+            $this->value['x'] += intval(substr($value, 1));
108 108
         } elseif (is_string($value) && substr($value, 0, 1) == "-") {
109 109
             $this->value['x'] -= intval(substr($value, 1));
110 110
         } else {
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 
151 151
         $height = $this->get('header_height');
152 152
         ;
153
-        $width = $size[0] * ($height/$size[1]);
153
+        $width = $size[0]*($height/$size[1]);
154 154
 
155 155
         if ($width > $this->get('content_width')) {
156 156
             $width = $this->get('content_width');
157
-            $height = $size[1] * ($width/$size[0]);
157
+            $height = $size[1]*($width/$size[0]);
158 158
         }
159 159
         parent::addJpegFromFile($headerImg, $this->get('right_margin_position') - $width, $this->page_height - $this->get('header_margin_top') - $height, $width, $height); // , ($this->value["page_width"] - $this->value["margin_left"])/10
160 160
         parent::closeObject();
@@ -177,15 +177,15 @@  discard block
 block discarded – undo
177 177
     public function roundRectangle($x, $y, $width, $height, $round)
178 178
     {
179 179
         parent::setLineStyle(1);
180
-        parent::line($x, $y+$round, $x, $y+$height-$round);
181
-        parent::line($x+$round, $y+$height, $x+$width-$round, $y+$height);
182
-        parent::line($x+$width, $y+$height-$round, $x+$width, $y+$round-1);
183
-        parent::line($x+$width-$round, $y, $x+$round, $y);
184
-
185
-        parent::partEllipse($x+$round, $y+$round, 180, 270, $round);
186
-        parent::partEllipse($x+$round, $y+$height-$round, 90, 180, $round);
187
-        parent::partEllipse($x+$width-$round, $y+$height-$round, 0, 90, $round);
188
-        parent::partEllipse($x+$width-$round, $y+$round, 270, 360, $round);
180
+        parent::line($x, $y + $round, $x, $y + $height - $round);
181
+        parent::line($x + $round, $y + $height, $x + $width - $round, $y + $height);
182
+        parent::line($x + $width, $y + $height - $round, $x + $width, $y + $round - 1);
183
+        parent::line($x + $width - $round, $y, $x + $round, $y);
184
+
185
+        parent::partEllipse($x + $round, $y + $round, 180, 270, $round);
186
+        parent::partEllipse($x + $round, $y + $height - $round, 90, 180, $round);
187
+        parent::partEllipse($x + $width - $round, $y + $height - $round, 0, 90, $round);
188
+        parent::partEllipse($x + $width - $round, $y + $round, 270, 360, $round);
189 189
     }
190 190
 
191 191
    /**
Please login to merge, or discard this patch.
install/Install.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 
27 27
     function dropDatabase()
28 28
     {
29
-        $result = $this->db->query("SHOW TABLES FROM " . DB_NAME);
29
+        $result = $this->db->query("SHOW TABLES FROM ".DB_NAME);
30 30
         if (PEAR::isError($result)) {
31 31
             throw new Exception($result->getUserInfo());
32 32
         }
33 33
 
34 34
         while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
35
-            $drop = $this->db->exec('DROP TABLE ' . $line['tables_in_' . DB_NAME]);
35
+            $drop = $this->db->exec('DROP TABLE '.$line['tables_in_'.DB_NAME]);
36 36
             if (PEAR::IsError($drop)) {
37 37
                 throw new Exception($drop->getUserInfo());
38 38
             }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     function createDatabaseSchema()
44 44
     {
45
-        $sql_structure = file_get_contents(dirname(__FILE__) . '/database-structure.sql');
45
+        $sql_structure = file_get_contents(dirname(__FILE__).'/database-structure.sql');
46 46
         $sql_arr = Intraface_Install::splitSql($sql_structure);
47 47
 
48 48
         foreach ($sql_arr as $sql) {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             }
54 54
         }
55 55
 
56
-        $sql_structure = file_get_contents(dirname(__FILE__) . '/database-update.sql');
56
+        $sql_structure = file_get_contents(dirname(__FILE__).'/database-update.sql');
57 57
         $sql_arr = Intraface_Install::splitSql($sql_structure);
58 58
 
59 59
         foreach ($sql_arr as $sql) {
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 
69 69
     function emptyDatabase()
70 70
     {
71
-        $result = $this->db->query("SHOW TABLES FROM " . DB_NAME);
71
+        $result = $this->db->query("SHOW TABLES FROM ".DB_NAME);
72 72
         if (PEAR::isError($result)) {
73 73
             throw new Exception($result->getUserInfo());
74 74
         }
75 75
         while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
76
-            $truncate = $this->db->exec('TRUNCATE TABLE ' . $line['Tables_in_'.DB_NAME]);
76
+            $truncate = $this->db->exec('TRUNCATE TABLE '.$line['Tables_in_'.DB_NAME]);
77 77
             if (PEAR::IsError($truncate)) {
78 78
                 throw new Exception($truncate->getUserInfo());
79 79
             }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     function createStartingValues()
86 86
     {
87
-        $sql_values = file_get_contents(dirname(__FILE__) . '/database-values.sql');
87
+        $sql_values = file_get_contents(dirname(__FILE__).'/database-values.sql');
88 88
         $sql_arr = Intraface_Install::splitSql($sql_values);
89 89
 
90 90
         foreach ($sql_arr as $sql) {
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
 
129 129
     function deleteUploadDirectory($f)
130 130
     {
131
-        if ( is_dir( $f ) ){
132
-            foreach ( scandir( $f ) as $item ){
133
-                if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) )
131
+        if (is_dir($f)) {
132
+            foreach (scandir($f) as $item) {
133
+                if (!strcmp($item, '.') || !strcmp($item, '..'))
134 134
                     continue;
135
-                $this->deleteUploadDirectory( $f . "/" . $item );
135
+                $this->deleteUploadDirectory($f."/".$item);
136 136
             }
137
-            rmdir( $f );
138
-        } else{
139
-            @unlink( $f );
137
+            rmdir($f);
138
+        } else {
139
+            @unlink($f);
140 140
         }
141 141
     }
142 142
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $object_method[0] = str_replace('/', '', $object_method[0]);
216 216
             $object_method[0] = str_replace('\\', '', $object_method[0]);
217 217
 
218
-            require_once dirname(__FILE__) . '/Helper/'.$object_method[0].'.php';
218
+            require_once dirname(__FILE__).'/Helper/'.$object_method[0].'.php';
219 219
             $object_name = 'Install_Helper_'.$object_method[0];
220 220
             $object = new $object_name($kernel, $this->db);
221 221
             $object->$object_method[1]();
Please login to merge, or discard this patch.
tests/xmlrpcservers/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once dirname(__FILE__) . '/../unit/config.test.php';
2
+require_once dirname(__FILE__).'/../unit/config.test.php';
3 3
 
4 4
 require_once 'konstrukt/konstrukt.inc.php';
5 5
 
Please login to merge, or discard this patch.