@@ -417,11 +417,11 @@ |
||
417 | 417 | /** |
418 | 418 | * @param $event |
419 | 419 | * @param $eventsArray |
420 | - * @param $extcalTimeHandler |
|
421 | - * @param $startMonth |
|
422 | - * @param $endMonth |
|
420 | + * @param ExtcalTime $extcalTimeHandler |
|
421 | + * @param integer $startMonth |
|
422 | + * @param integer $endMonth |
|
423 | 423 | * @param $cats |
424 | - * @return bool |
|
424 | + * @return false|null |
|
425 | 425 | */ |
426 | 426 | function bExtcalMinicalAddEventToArray(&$event, &$eventsArray, $extcalTimeHandler, $startMonth, $endMonth, $cats) |
427 | 427 | { |
@@ -144,7 +144,7 @@ |
||
144 | 144 | // Flag current day |
145 | 145 | $selectedDays = array( |
146 | 146 | new Calendar_Day(date('Y', xoops_getUserTimestamp(time(), $extcalTimeHandler->_getUserTimeZone($GLOBALS['xoopsUser']))), date('n', xoops_getUserTimestamp(time(), $extcalTimeHandler->_getUserTimeZone($GLOBALS['xoopsUser']))), |
147 | - date('j', xoops_getUserTimestamp(time(), $extcalTimeHandler->_getUserTimeZone($GLOBALS['xoopsUser'])))), |
|
147 | + date('j', xoops_getUserTimestamp(time(), $extcalTimeHandler->_getUserTimeZone($GLOBALS['xoopsUser'])))), |
|
148 | 148 | ); |
149 | 149 | |
150 | 150 | // Build calendar object |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | global $extcalConfig, $xoopsUser; |
4 | -include_once __DIR__ . '/../include/constantes.php'; |
|
5 | -include_once __DIR__ . '/../class/utilities.php'; |
|
6 | -include_once __DIR__ . '/../class/tableForm.php'; |
|
4 | +include_once __DIR__.'/../include/constantes.php'; |
|
5 | +include_once __DIR__.'/../class/utilities.php'; |
|
6 | +include_once __DIR__.'/../class/tableForm.php'; |
|
7 | 7 | //--------------------------------------------------------------------------- |
8 | 8 | /** |
9 | 9 | * @param $options |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | |
17 | 17 | extcal_getDefautminicalOption($options); |
18 | 18 | |
19 | - include_once __DIR__ . '/../class/config.php'; |
|
19 | + include_once __DIR__.'/../class/config.php'; |
|
20 | 20 | |
21 | - require_once _EXTCAL_PEAR_CALENDAR_ROOT . '/Util/Textual.php'; |
|
22 | - require_once _EXTCAL_PEAR_CALENDAR_ROOT . '/Month/Weeks.php'; |
|
23 | - require_once _EXTCAL_PEAR_CALENDAR_ROOT . '/Day.php'; |
|
21 | + require_once _EXTCAL_PEAR_CALENDAR_ROOT.'/Util/Textual.php'; |
|
22 | + require_once _EXTCAL_PEAR_CALENDAR_ROOT.'/Month/Weeks.php'; |
|
23 | + require_once _EXTCAL_PEAR_CALENDAR_ROOT.'/Day.php'; |
|
24 | 24 | // require_once CALENDAR_ROOT . 'Month/Weeks.php'; |
25 | 25 | // require_once CALENDAR_ROOT . 'Day.php'; |
26 | 26 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'cat' => $tCatSelected, |
107 | 107 | 'externalKeys' => 'cat_id', |
108 | 108 | ); |
109 | - $events = $eventHandler->getEventsOnPeriode($criteres); |
|
109 | + $events = $eventHandler->getEventsOnPeriode($criteres); |
|
110 | 110 | } else { |
111 | 111 | $events = array(); |
112 | 112 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | 'number' => $dayCalObj->thisDay(), |
169 | 169 | 'isSelected' => $dayCalObj->isSelected(), |
170 | 170 | ); |
171 | - $day = $dayCalObj->thisDay(); |
|
171 | + $day = $dayCalObj->thisDay(); |
|
172 | 172 | if (isset($eventsArray[$day]) && !$dayCalObj->isEmpty()) { |
173 | 173 | $tableRows[$rowId]['week'][$cellId]['haveEvents'] = true; |
174 | 174 | $tableRows[$rowId]['week'][$cellId]['color'] = $eventsArray[$day]['color']; |
@@ -198,15 +198,15 @@ discard block |
||
198 | 198 | // Making navig data |
199 | 199 | $navig = array( |
200 | 200 | 'page' => $extcalConfig['start_page'], |
201 | - 'uri' => 'year=' . $monthCalObj->thisYear() . '&month=' . $monthCalObj->thisMonth(), |
|
201 | + 'uri' => 'year='.$monthCalObj->thisYear().'&month='.$monthCalObj->thisMonth(), |
|
202 | 202 | 'name' => $extcalTimeHandler->getFormatedDate($extcalConfig['nav_date_month'], $monthCalObj->getTimestamp()), |
203 | 203 | ); |
204 | 204 | |
205 | 205 | $horloge = array(); |
206 | 206 | $horloge['display'] = (trim($options[11]) != ''); |
207 | - $horloge['fullName'] = XOOPS_URL . _EXTCAL_PATH_HORLOGES . $options[11]; |
|
208 | - $horloge['width'] = $options[12] . 'px'; |
|
209 | - $horloge['height'] = $options[13] . 'px'; |
|
207 | + $horloge['fullName'] = XOOPS_URL._EXTCAL_PATH_HORLOGES.$options[11]; |
|
208 | + $horloge['width'] = $options[12].'px'; |
|
209 | + $horloge['height'] = $options[13].'px'; |
|
210 | 210 | |
211 | 211 | $ret = array( |
212 | 212 | 'imageParam' => $imageParam, |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | function bExtcalMinicalEdit($options) |
234 | 234 | { |
235 | - include_once __DIR__ . '/../class/form/spin/formspin.php'; |
|
235 | + include_once __DIR__.'/../class/form/spin/formspin.php'; |
|
236 | 236 | global $xoopsUser; |
237 | 237 | |
238 | 238 | // $t = print_r(get_defined_vars(),true); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $imageCatHandler = xoops_getHandler('imagecategory'); |
254 | 254 | |
255 | 255 | //===================================================================== |
256 | - $form->insertBreak('<div style="text-align: center;font-weight: bold;">' . _MB_EXTCAL_OPT_SLIDE_SHOW . '</div>', 'head'); |
|
256 | + $form->insertBreak('<div style="text-align: center;font-weight: bold;">'._MB_EXTCAL_OPT_SLIDE_SHOW.'</div>', 'head'); |
|
257 | 257 | |
258 | 258 | $k = 0; |
259 | 259 | $xfValue[$k] = new XoopsFormRadio(_MB_EXTCAL_DISPLAY_IMG, "options[{$k}]", $options[$k]); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $xfValue[$k] = new ExtcalFormSpin(_MB_EXTCAL_SS_NB_PHOTOS, "options[{$k}]", $options[$k], 0, 50, 1, 0, 8, _MB_EXTCAL_PX, $imgFolder = ''); |
295 | 295 | $form->addElement($xfValue[$k], false); |
296 | 296 | //===================================================================== |
297 | - $form->insertBreak('<div style="text-align: center;font-weight: bold;">' . _MB_EXTCAL_OPT_SHOW . '</div>', 'head'); |
|
297 | + $form->insertBreak('<div style="text-align: center;font-weight: bold;">'._MB_EXTCAL_OPT_SHOW.'</div>', 'head'); |
|
298 | 298 | |
299 | 299 | $t = array( |
300 | 300 | -1 => _MB_EXTCAL_PREVIEW, |
@@ -333,9 +333,9 @@ discard block |
||
333 | 333 | $form->addElement($xfValue[$k], false); |
334 | 334 | |
335 | 335 | //===================================================================== |
336 | - $form->insertBreak('<div style="text-align: center;font-weight: bold;">' . _MB_EXTCAL_HORLOGE_OPT . '</div>', 'head'); |
|
336 | + $form->insertBreak('<div style="text-align: center;font-weight: bold;">'._MB_EXTCAL_HORLOGE_OPT.'</div>', 'head'); |
|
337 | 337 | //--------------------------------------------------------------------- |
338 | - $t = XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH . _EXTCAL_PATH_HORLOGES); |
|
338 | + $t = XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH._EXTCAL_PATH_HORLOGES); |
|
339 | 339 | $t = array_merge(array(' ' => _NONE), $t); |
340 | 340 | |
341 | 341 | $k = 11; |
@@ -418,12 +418,12 @@ discard block |
||
418 | 418 | // $src = $doc->createElement('src'); |
419 | 419 | $src = clone $tempSrc; |
420 | 420 | $src = $photo->appendChild($src); |
421 | - $value = $doc->createTextNode(XOOPS_URL . '/uploads/' . $images->getVar('image_name')); |
|
421 | + $value = $doc->createTextNode(XOOPS_URL.'/uploads/'.$images->getVar('image_name')); |
|
422 | 422 | $src->appendChild($value); |
423 | 423 | } |
424 | 424 | |
425 | 425 | // get completed xml document |
426 | - $xml_string = $doc->save(XOOPS_ROOT_PATH . '/cache/extcalSlideShowParam.xml'); |
|
426 | + $xml_string = $doc->save(XOOPS_ROOT_PATH.'/cache/extcalSlideShowParam.xml'); |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | /**************************************************************************/ |
@@ -264,6 +264,10 @@ |
||
264 | 264 | * @param $max |
265 | 265 | * @return |
266 | 266 | */ |
267 | + |
|
268 | + /** |
|
269 | + * @param integer $min |
|
270 | + */ |
|
267 | 271 | Function bornerValeur($val, $min, $max) |
268 | 272 | { |
269 | 273 |
@@ -159,9 +159,9 @@ |
||
159 | 159 | $tHex = array('', '', '', ''); |
160 | 160 | |
161 | 161 | $tHex[0] = $aColors[0]; |
162 | - $tHex[1] = substr('00' . dechex($aColors[1]), -2); |
|
163 | - $tHex[2] = substr('00' . dechex($aColors[2]), -2); |
|
164 | - $tHex[3] = substr('00' . dechex($aColors[3]), -2); |
|
162 | + $tHex[1] = substr('00'.dechex($aColors[1]), -2); |
|
163 | + $tHex[2] = substr('00'.dechex($aColors[2]), -2); |
|
164 | + $tHex[3] = substr('00'.dechex($aColors[3]), -2); |
|
165 | 165 | |
166 | 166 | $colorHexa = implode('', $tHex); |
167 | 167 |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * @param $cat |
634 | 634 | * @param int $nbDays |
635 | 635 | * |
636 | - * @return CriteriaCompo |
|
636 | + * @return null|CriteriaElement |
|
637 | 637 | */ |
638 | 638 | function _getEventWeekCriteria($day, $month, $year, $cat, $nbDays = 7) |
639 | 639 | { |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | * @param $year |
656 | 656 | * @param $cat |
657 | 657 | * |
658 | - * @return CriteriaCompo |
|
658 | + * @return null|CriteriaElement |
|
659 | 659 | */ |
660 | 660 | function _getEventMonthCriteria($month, $year, $cat) |
661 | 661 | { |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | * @param $year |
677 | 677 | * @param int $cat |
678 | 678 | * |
679 | - * @return CriteriaCompo |
|
679 | + * @return null|CriteriaElement |
|
680 | 680 | */ |
681 | 681 | function _getEventYearCriteria($year, $cat = 0) |
682 | 682 | { |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | /** |
761 | 761 | * @param $start |
762 | 762 | * @param $end |
763 | - * @param $cat |
|
763 | + * @param integer $cat |
|
764 | 764 | * @param $user |
765 | 765 | * |
766 | 766 | * @return CriteriaCompo |
@@ -1763,7 +1763,7 @@ discard block |
||
1763 | 1763 | |
1764 | 1764 | /** |
1765 | 1765 | * @param $month |
1766 | - * @param $year |
|
1766 | + * @param string $year |
|
1767 | 1767 | * @param $dayCode |
1768 | 1768 | * |
1769 | 1769 | * @return int |
@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | |
3 | 3 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
4 | 4 | |
5 | -include_once __DIR__ . '/ExtcalPersistableObjectHandler.php'; |
|
6 | -include_once __DIR__ . '/perm.php'; |
|
7 | -include_once __DIR__ . '/time.php'; |
|
8 | -include_once __DIR__ . '/config.php'; |
|
9 | -include_once __DIR__ . '/extDateTime.php'; |
|
10 | -include_once __DIR__ . '/utilities.php'; |
|
11 | -include_once __DIR__ . '/../include/constantes.php'; |
|
5 | +include_once __DIR__.'/ExtcalPersistableObjectHandler.php'; |
|
6 | +include_once __DIR__.'/perm.php'; |
|
7 | +include_once __DIR__.'/time.php'; |
|
8 | +include_once __DIR__.'/config.php'; |
|
9 | +include_once __DIR__.'/extDateTime.php'; |
|
10 | +include_once __DIR__.'/utilities.php'; |
|
11 | +include_once __DIR__.'/../include/constantes.php'; |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Class ExtcalEvent. |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->initVar('event_etablissement', XOBJ_DTYPE_INT, 5, false); |
50 | 50 | $this->initVar('event_icone', XOBJ_DTYPE_TXTBOX, '', false); |
51 | 51 | |
52 | - $this->externalKey['cat_id'] = array( |
|
52 | + $this->externalKey['cat_id'] = array( |
|
53 | 53 | 'className' => 'cat', |
54 | 54 | 'getMethodeName' => 'getCat', |
55 | 55 | 'keyName' => 'cat', |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | $eventArray = array(); |
383 | 383 | |
384 | 384 | while (list($k, $v) = each($events)) { |
385 | - $ordre[] = (int)$v['event_start']; |
|
385 | + $ordre[] = (int) $v['event_start']; |
|
386 | 386 | $this->formatEventDate($v, $extcalConfig['event_date_week']); |
387 | 387 | //$v['cat']['cat_light_color'] = $v['cat']['cat_color']; |
388 | 388 | $v['cat']['cat_light_color'] = ExtcalUtilities::getLighterColor($v['cat']['cat_color'], _EXTCAL_INFOBULLE_RGB_MIN, _EXTCAL_INFOBULLE_RGB_MAX); |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | |
584 | 584 | reset($period); |
585 | 585 | foreach ($period as $dt) { |
586 | - echo $dt->format("l d-m-Y H:i:s\n") . '<br>'; |
|
586 | + echo $dt->format("l d-m-Y H:i:s\n").'<br>'; |
|
587 | 587 | } |
588 | 588 | } |
589 | 589 | |
@@ -909,10 +909,10 @@ discard block |
||
909 | 909 | $authorizedAccessCats = $this->_extcalPerm->getAuthorizedCat($user, 'extcal_cat_view'); |
910 | 910 | $count = count($authorizedAccessCats); |
911 | 911 | if ($count > 0) { |
912 | - $in = '(' . $authorizedAccessCats[0]; |
|
912 | + $in = '('.$authorizedAccessCats[0]; |
|
913 | 913 | array_shift($authorizedAccessCats); |
914 | 914 | foreach ($authorizedAccessCats as $authorizedAccessCat) { |
915 | - $in .= ',' . $authorizedAccessCat; |
|
915 | + $in .= ','.$authorizedAccessCat; |
|
916 | 916 | } |
917 | 917 | $in .= ')'; |
918 | 918 | $criteria->add(new Criteria('cat_id', $in, 'IN')); |
@@ -932,10 +932,10 @@ discard block |
||
932 | 932 | } |
933 | 933 | if (is_array($cats)) { |
934 | 934 | if (array_search(0, $cats) === false) { |
935 | - $in = '(' . current($cats); |
|
935 | + $in = '('.current($cats); |
|
936 | 936 | array_shift($cats); |
937 | 937 | foreach ($cats as $cat) { |
938 | - $in .= ',' . $cat; |
|
938 | + $in .= ','.$cat; |
|
939 | 939 | } |
940 | 940 | $in .= ')'; |
941 | 941 | $criteria->add(new Criteria('cat_id', $in, 'IN')); |
@@ -958,7 +958,7 @@ discard block |
||
958 | 958 | $fileHandler = xoops_getModuleHandler(_EXTCAL_CLS_FILE, _EXTCAL_MODULE); |
959 | 959 | |
960 | 960 | /***************************************************/ |
961 | - include_once __DIR__ . '/etablissement.php'; |
|
961 | + include_once __DIR__.'/etablissement.php'; |
|
962 | 962 | if ($siteSide === 'admin') { |
963 | 963 | $action = 'event.php?op=enreg'; |
964 | 964 | $cats = $catHandler->getAllCat($GLOBALS['xoopsUser'], 'all'); |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | if ($mode === 'clone') { |
977 | 977 | $data['event_id'] = 0; |
978 | 978 | $event->setVar('event_id', 0); |
979 | - $newTitle = $event->getVar('event_title') . ' (' . _AM_EXTCAL_CLONE_OF . $data['event_id'] . ')'; |
|
979 | + $newTitle = $event->getVar('event_title').' ('._AM_EXTCAL_CLONE_OF.$data['event_id'].')'; |
|
980 | 980 | $event->setVar('event_title', $newTitle); |
981 | 981 | } |
982 | 982 | |
@@ -1160,7 +1160,7 @@ discard block |
||
1160 | 1160 | $form->addElement($catSelect, true); |
1161 | 1161 | //----------------------------------------------------------- |
1162 | 1162 | |
1163 | - $file_path = __DIR__ . '/../assets/css/images'; |
|
1163 | + $file_path = __DIR__.'/../assets/css/images'; |
|
1164 | 1164 | $tf = XoopsLists::getImgListAsArray($file_path); |
1165 | 1165 | array_unshift($tf, _MD_EXTCAL_NONE); |
1166 | 1166 | $xfIcones = new XoopsFormSelect(_MD_EXTCAL_ICONE, 'event_icone', $event_icone, ''); |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | if (count($files) > 0) { |
1266 | 1266 | $eventFiles = new ExtcalFormFileCheckBox('', 'filetokeep'); |
1267 | 1267 | foreach ($files as $file) { |
1268 | - $name = $file['file_nicename'] . ' (<i>' . $file['file_mimetype'] . '</i>) ' . $file['formated_file_size']; |
|
1268 | + $name = $file['file_nicename'].' (<i>'.$file['file_mimetype'].'</i>) '.$file['formated_file_size']; |
|
1269 | 1269 | $eventFiles->addOption($file['file_id'], $name); |
1270 | 1270 | } |
1271 | 1271 | $fileElmtTray->addElement($eventFiles); |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | //Picture1 |
1282 | 1282 | $file_tray = new XoopsFormElementTray(sprintf(_MD_EXTCAL_FORM_IMG, 1), ''); |
1283 | 1283 | if (!empty($event_picture1)) { |
1284 | - $file_tray->addElement(new XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/' . $event_picture1 . "' name='image' id='image' alt=''/><br><br>")); |
|
1284 | + $file_tray->addElement(new XoopsFormLabel('', "<img src='".XOOPS_URL.'/uploads/extcal/'.$event_picture1."' name='image' id='image' alt=''/><br><br>")); |
|
1285 | 1285 | $check_del_img = new XoopsFormCheckBox('', 'delimg_1'); |
1286 | 1286 | $check_del_img->addOption(1, _MD_EXTCAL_DEL_IMG); |
1287 | 1287 | $file_tray->addElement($check_del_img); |
@@ -1292,8 +1292,8 @@ discard block |
||
1292 | 1292 | } |
1293 | 1293 | $file_img->setExtra("size ='40'"); |
1294 | 1294 | $file_tray->addElement($file_img); |
1295 | - $msg = sprintf(_MD_EXTCAL_IMG_CONFIG, (int)(400728 / 1000), 500, 500); |
|
1296 | - $file_label = new XoopsFormLabel('', '<br>' . $msg); |
|
1295 | + $msg = sprintf(_MD_EXTCAL_IMG_CONFIG, (int) (400728 / 1000), 500, 500); |
|
1296 | + $file_label = new XoopsFormLabel('', '<br>'.$msg); |
|
1297 | 1297 | $file_tray->addElement($file_label); |
1298 | 1298 | $form->addElement($file_tray); |
1299 | 1299 | $form->addElement(new XoopsFormHidden('file1', $event_picture1)); |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | //Picture2 |
1302 | 1302 | $file_tray = new XoopsFormElementTray(sprintf(_MD_EXTCAL_FORM_IMG, 2), ''); |
1303 | 1303 | if (!empty($event_picture2)) { |
1304 | - $file_tray->addElement(new XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/' . $event_picture2 . "' name='image' id='image' alt=''/><br><br>")); |
|
1304 | + $file_tray->addElement(new XoopsFormLabel('', "<img src='".XOOPS_URL.'/uploads/extcal/'.$event_picture2."' name='image' id='image' alt=''/><br><br>")); |
|
1305 | 1305 | $check_del_img = new XoopsFormCheckBox('', 'delimg_2'); |
1306 | 1306 | $check_del_img->addOption(1, _MD_EXTCAL_DEL_IMG); |
1307 | 1307 | $file_tray->addElement($check_del_img); |
@@ -1312,8 +1312,8 @@ discard block |
||
1312 | 1312 | } |
1313 | 1313 | $file_img->setExtra("size ='40'"); |
1314 | 1314 | $file_tray->addElement($file_img); |
1315 | - $msg = sprintf(_MD_EXTCAL_IMG_CONFIG, (int)(400728 / 1000), 500, 500); |
|
1316 | - $file_label = new XoopsFormLabel('', '<br>' . $msg); |
|
1315 | + $msg = sprintf(_MD_EXTCAL_IMG_CONFIG, (int) (400728 / 1000), 500, 500); |
|
1316 | + $file_label = new XoopsFormLabel('', '<br>'.$msg); |
|
1317 | 1317 | $file_tray->addElement($file_label); |
1318 | 1318 | $form->addElement($file_tray); |
1319 | 1319 | $form->addElement(new XoopsFormHidden('file2', $event_picture2)); |
@@ -1380,7 +1380,7 @@ discard block |
||
1380 | 1380 | $recurRules = 'weekly|'; |
1381 | 1381 | $recurRules .= $parm['rrule_weekly_interval']; |
1382 | 1382 | foreach ($parm['rrule_weekly_bydays'] as $day) { |
1383 | - $recurRules .= '|' . $day; |
|
1383 | + $recurRules .= '|'.$day; |
|
1384 | 1384 | } |
1385 | 1385 | |
1386 | 1386 | break; |
@@ -1390,11 +1390,11 @@ discard block |
||
1390 | 1390 | $parm['rrule_monthly_interval'] = 0; |
1391 | 1391 | } |
1392 | 1392 | $recurRules = 'monthly|'; |
1393 | - $recurRules .= $parm['rrule_monthly_interval'] . '|'; |
|
1393 | + $recurRules .= $parm['rrule_monthly_interval'].'|'; |
|
1394 | 1394 | if ($parm['rrule_monthly_byday'] != '') { |
1395 | 1395 | $recurRules .= $parm['rrule_monthly_byday']; |
1396 | 1396 | } else { |
1397 | - $recurRules .= 'MD' . $parm['rrule_bymonthday']; |
|
1397 | + $recurRules .= 'MD'.$parm['rrule_bymonthday']; |
|
1398 | 1398 | } |
1399 | 1399 | |
1400 | 1400 | break; |
@@ -1428,9 +1428,9 @@ discard block |
||
1428 | 1428 | |
1429 | 1429 | $recurRules = 'yearly|'; |
1430 | 1430 | $recurRules .= $parm['rrule_yearly_interval']; |
1431 | - $recurRules .= '|' . $parm['rrule_yearly_byday']; |
|
1431 | + $recurRules .= '|'.$parm['rrule_yearly_byday']; |
|
1432 | 1432 | foreach ($parm['rrule_yearly_bymonths'] as $month) { |
1433 | - $recurRules .= '|' . $month; |
|
1433 | + $recurRules .= '|'.$month; |
|
1434 | 1434 | } |
1435 | 1435 | |
1436 | 1436 | break; |
@@ -2363,10 +2363,10 @@ discard block |
||
2363 | 2363 | global $xoopsDB; |
2364 | 2364 | |
2365 | 2365 | //echo "<hr>{$andor}-{$limit}-{$offset}-{$userId}-{$user}<br>{$criteresPlus}"; |
2366 | - $tEvent = $xoopsDB->prefix('extcal_event') . ' AS te'; |
|
2367 | - $tCat = $xoopsDB->prefix('extcal_cat') . ' AS tc'; |
|
2366 | + $tEvent = $xoopsDB->prefix('extcal_event').' AS te'; |
|
2367 | + $tCat = $xoopsDB->prefix('extcal_cat').' AS tc'; |
|
2368 | 2368 | |
2369 | - $sql = 'SELECT te.*, tc.cat_name , tc.cat_color, ' . 'year(FROM_UNIXTIME(event_start)) AS year,' . 'month(FROM_UNIXTIME(event_start)) AS month,' . 'day(FROM_UNIXTIME(event_start)) AS day' . " FROM {$tEvent}, {$tCat}"; |
|
2369 | + $sql = 'SELECT te.*, tc.cat_name , tc.cat_color, '.'year(FROM_UNIXTIME(event_start)) AS year,'.'month(FROM_UNIXTIME(event_start)) AS month,'.'day(FROM_UNIXTIME(event_start)) AS day'." FROM {$tEvent}, {$tCat}"; |
|
2370 | 2370 | //--------------------------------------------------- |
2371 | 2371 | $tw = array(); |
2372 | 2372 | $tw[] = 'te.cat_id = tc.cat_id'; |
@@ -2375,7 +2375,7 @@ discard block |
||
2375 | 2375 | $authorizedAccessCats = $this->_extcalPerm->getAuthorizedCat($user, 'extcal_cat_view'); |
2376 | 2376 | $inCat = 'te.cat_id IN (0)'; |
2377 | 2377 | if (count($authorizedAccessCats) > 0) { |
2378 | - $inCat = 'te.cat_id IN (' . implode(',', $authorizedAccessCats) . ')'; |
|
2378 | + $inCat = 'te.cat_id IN ('.implode(',', $authorizedAccessCats).')'; |
|
2379 | 2379 | } |
2380 | 2380 | //echo $tw[count($tw)-1]; |
2381 | 2381 | |
@@ -2411,12 +2411,12 @@ discard block |
||
2411 | 2411 | 'te.event_address', |
2412 | 2412 | 'tc.cat_name', |
2413 | 2413 | ); |
2414 | - $t = array(); |
|
2414 | + $t = array(); |
|
2415 | 2415 | for ($i = 0, $count = count($queryarray); $i < $count; ++$i) { |
2416 | 2416 | $t1[] = " %1\$s LIKE '#{$queryarray[$i]}#' "; |
2417 | 2417 | } |
2418 | 2418 | |
2419 | - $flt = '(' . implode(" {$andor} ", $t1) . ')'; |
|
2419 | + $flt = '('.implode(" {$andor} ", $t1).')'; |
|
2420 | 2420 | |
2421 | 2421 | $t = array(); |
2422 | 2422 | for ($h = 0, $count = count($tFields); $h < $count; ++$h) { |
@@ -2425,10 +2425,10 @@ discard block |
||
2425 | 2425 | |
2426 | 2426 | $filtre = implode(' OR ', $t); |
2427 | 2427 | $filtre = str_replace('#', '%', $filtre); |
2428 | - $tw[] = '(' . $filtre . ')'; |
|
2428 | + $tw[] = '('.$filtre.')'; |
|
2429 | 2429 | } |
2430 | 2430 | |
2431 | - $sql .= ' WHERE ' . implode(' AND ', $tw); |
|
2431 | + $sql .= ' WHERE '.implode(' AND ', $tw); |
|
2432 | 2432 | //------------------------------------------------------------ |
2433 | 2433 | if (count($orderBy) > 0) { |
2434 | 2434 | $t = array(); |
@@ -2438,7 +2438,7 @@ discard block |
||
2438 | 2438 | } |
2439 | 2439 | } |
2440 | 2440 | if (count($t) > 0) { |
2441 | - $sql .= ' ORDER BY ' . implode(',', $t); |
|
2441 | + $sql .= ' ORDER BY '.implode(',', $t); |
|
2442 | 2442 | } |
2443 | 2443 | } |
2444 | 2444 | |
@@ -2471,7 +2471,7 @@ discard block |
||
2471 | 2471 | $i = 0; |
2472 | 2472 | while ($myrow = $xoopsDB->fetchArray($result)) { |
2473 | 2473 | $ret[$i]['image'] = 'assets/images/icons/extcal.gif'; |
2474 | - $ret[$i]['link'] = 'event.php?event=' . $myrow['event_id']; |
|
2474 | + $ret[$i]['link'] = 'event.php?event='.$myrow['event_id']; |
|
2475 | 2475 | $ret[$i]['title'] = $myrow['event_title']; |
2476 | 2476 | $ret[$i]['time'] = $myrow['event_submitdate']; |
2477 | 2477 | $ret[$i]['uid'] = $myrow['event_submitter']; |
@@ -2511,23 +2511,23 @@ discard block |
||
2511 | 2511 | // } |
2512 | 2512 | $tEvent = $xoopsDB->prefix('extcal_event'); |
2513 | 2513 | $tCat = $xoopsDB->prefix('extcal_cat'); |
2514 | - $sql = "SELECT {$tEvent}.*, {$tCat}.cat_name AS categorie, {$tCat}.cat_color " . " FROM {$tEvent}, {$tCat}" . " WHERE {$tEvent}.cat_id = {$tCat}.cat_id AND event_approved = '1'"; |
|
2514 | + $sql = "SELECT {$tEvent}.*, {$tCat}.cat_name AS categorie, {$tCat}.cat_color "." FROM {$tEvent}, {$tCat}"." WHERE {$tEvent}.cat_id = {$tCat}.cat_id AND event_approved = '1'"; |
|
2515 | 2515 | |
2516 | 2516 | $authorizedAccessCats = $this->_extcalPerm->getAuthorizedCat($user, 'extcal_cat_view'); |
2517 | 2517 | $count = count($authorizedAccessCats); |
2518 | 2518 | if ($count > 0) { |
2519 | - $in = '(' . $authorizedAccessCats[0]; |
|
2519 | + $in = '('.$authorizedAccessCats[0]; |
|
2520 | 2520 | array_shift($authorizedAccessCats); |
2521 | 2521 | foreach ($authorizedAccessCats as $authorizedAccessCat) { |
2522 | - $in .= ',' . $authorizedAccessCat; |
|
2522 | + $in .= ','.$authorizedAccessCat; |
|
2523 | 2523 | } |
2524 | 2524 | $in .= ')'; |
2525 | 2525 | } else { |
2526 | 2526 | $in = '(0)'; |
2527 | 2527 | } |
2528 | - $sql .= " AND {$tEvent}.cat_id IN " . $in . ''; |
|
2528 | + $sql .= " AND {$tEvent}.cat_id IN ".$in.''; |
|
2529 | 2529 | if ($userId != 0) { |
2530 | - $sql .= " AND event_submitter = '" . $userId . "'"; |
|
2530 | + $sql .= " AND event_submitter = '".$userId."'"; |
|
2531 | 2531 | } |
2532 | 2532 | |
2533 | 2533 | //echoArray($queryarray,false); |
@@ -2547,7 +2547,7 @@ discard block |
||
2547 | 2547 | $t1[] = " %1\$s LIKE '#{$queryarray[$i]}#' "; |
2548 | 2548 | } |
2549 | 2549 | |
2550 | - $flt = '(' . implode(" {$andor} ", $t1) . ')'; |
|
2550 | + $flt = '('.implode(" {$andor} ", $t1).')'; |
|
2551 | 2551 | |
2552 | 2552 | $t = array(); |
2553 | 2553 | for ($h = 0, $count = count($tFields); $h < $count; ++$h) { |
@@ -2560,7 +2560,7 @@ discard block |
||
2560 | 2560 | } |
2561 | 2561 | |
2562 | 2562 | if ($criteresPlus != '') { |
2563 | - $sql .= ' AND ' . $criteresPlus; |
|
2563 | + $sql .= ' AND '.$criteresPlus; |
|
2564 | 2564 | } |
2565 | 2565 | $sql .= ' ORDER BY event_id DESC'; |
2566 | 2566 | |
@@ -2570,7 +2570,7 @@ discard block |
||
2570 | 2570 | if ($xoopsSearch) { |
2571 | 2571 | while ($myrow = $xoopsDB->fetchArray($result)) { |
2572 | 2572 | $ret[$i]['image'] = 'assets/images/icons/extcal.gif'; |
2573 | - $ret[$i]['link'] = 'event.php?event=' . $myrow['event_id']; |
|
2573 | + $ret[$i]['link'] = 'event.php?event='.$myrow['event_id']; |
|
2574 | 2574 | $ret[$i]['title'] = $myrow['event_title']; |
2575 | 2575 | $ret[$i]['time'] = $myrow['event_submitdate']; |
2576 | 2576 | $ret[$i]['uid'] = $myrow['event_submitter']; |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | |
11 | 11 | /** |
12 | - * @param $form |
|
12 | + * @param ExtcalThemeForm $form |
|
13 | 13 | * @param int $startTS |
14 | 14 | * @param int $endTS |
15 | 15 | */ |
@@ -7,8 +7,8 @@ |
||
7 | 7 | { |
8 | 8 | |
9 | 9 | /** |
10 | - * @param $caption |
|
11 | - * @param $name |
|
10 | + * @param string $caption |
|
11 | + * @param string $name |
|
12 | 12 | * @param null $value |
13 | 13 | */ |
14 | 14 | function ExtcalFormFileCheckBox($caption, $name, $value = null) |
@@ -7,9 +7,9 @@ |
||
7 | 7 | { |
8 | 8 | |
9 | 9 | /** |
10 | - * @param $caption |
|
11 | - * @param $name |
|
12 | - * @param null $value |
|
10 | + * @param string $caption |
|
11 | + * @param string $name |
|
12 | + * @param string $value |
|
13 | 13 | */ |
14 | 14 | function ExtcalFormRRuleCheckBox($caption, $name, $value = null) |
15 | 15 | { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | /** |
181 | 181 | * Set the value |
182 | 182 | * |
183 | - * @param $value int |
|
183 | + * @param integer $value int |
|
184 | 184 | */ |
185 | 185 | public function setValue($value) |
186 | 186 | { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | /** |
200 | 200 | * Set the min value |
201 | 201 | * |
202 | - * @param $min int |
|
202 | + * @param integer $min int |
|
203 | 203 | */ |
204 | 204 | public function setMin($min) |
205 | 205 | { |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | /** |
218 | 218 | * Set the max value - must be more great then min |
219 | 219 | * |
220 | - * @param $max int |
|
220 | + * @param integer $max int |
|
221 | 221 | */ |
222 | 222 | public function setMax($max) |
223 | 223 | { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * Set the small increment when click a short time on up down nutton |
238 | 238 | * must be " > 0 " |
239 | 239 | * |
240 | - * @param $smallIncrement |
|
240 | + * @param integer $smallIncrement |
|
241 | 241 | * @internal param int $value |
242 | 242 | */ |
243 | 243 | public function setSmallIncrement($smallIncrement) |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | /** |
261 | 261 | * Set the large increment when click a long time on up down nutton |
262 | 262 | * |
263 | - * @param $largeIncrement int |
|
263 | + * @param integer $largeIncrement int |
|
264 | 264 | */ |
265 | 265 | public function setLargeIncrement($largeIncrement) |
266 | 266 | { |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * Set the size in nb car of the input text for the value |
284 | 284 | * must be 2 car min |
285 | 285 | * |
286 | - * @param $size mixed |
|
286 | + * @param integer $size mixed |
|
287 | 287 | */ |
288 | 288 | public function setSize($size) |
289 | 289 | { |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | /** |
309 | 309 | * Set the shortname of the folder images |
310 | 310 | * |
311 | - * @param $folder string |
|
311 | + * @param string $folder string |
|
312 | 312 | */ |
313 | 313 | public function setImgFolder($folder) |
314 | 314 | { |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | /** |
329 | 329 | * Set the label of unites between value and buttons |
330 | 330 | * |
331 | - * @param $unite string |
|
331 | + * @param string $unite string |
|
332 | 332 | */ |
333 | 333 | public function setUnite($unite) |
334 | 334 | { |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | /** |
347 | 347 | * Set the style CSS of the text |
348 | 348 | * |
349 | - * @param $style string |
|
349 | + * @param string $style string |
|
350 | 350 | */ |
351 | 351 | public function setStyleText($style) |
352 | 352 | { |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | /** |
367 | 367 | * Set the style CSS of the frame |
368 | 368 | * |
369 | - * @param $style string |
|
369 | + * @param string $style string |
|
370 | 370 | */ |
371 | 371 | public function setStyleBordure($style) |
372 | 372 | { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | /** |
387 | 387 | * Set MinMaxVisible : show the button to go min and max value |
388 | 388 | * |
389 | - * @param $visible bool |
|
389 | + * @param boolean $visible bool |
|
390 | 390 | */ |
391 | 391 | public function setMinMaxVisible($visible) |
392 | 392 | { |
@@ -495,6 +495,11 @@ discard block |
||
495 | 495 | * @param string $default |
496 | 496 | * @return string |
497 | 497 | */ |
498 | + |
|
499 | + /** |
|
500 | + * @param string $attribut |
|
501 | + * @param string $value |
|
502 | + */ |
|
498 | 503 | public function htmlAddAttribut($attribut, $value, $default = '') |
499 | 504 | { |
500 | 505 | $r = ''; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function setMin($min) |
205 | 205 | { |
206 | - $this->_min = (int)$min; |
|
206 | + $this->_min = (int) $min; |
|
207 | 207 | } |
208 | 208 | /*-----------------------------------------------------------------*/ |
209 | 209 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function setMax($max) |
223 | 223 | { |
224 | - $this->_max = (int)$max; |
|
224 | + $this->_max = (int) $max; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /*-----------------------------------------------------------------*/ |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | public function setSmallIncrement($smallIncrement) |
244 | 244 | { |
245 | - $this->_smallIncrement = (int)$smallIncrement; |
|
245 | + $this->_smallIncrement = (int) $smallIncrement; |
|
246 | 246 | if ($this->_smallIncrement == 0) { |
247 | 247 | $this->_smallIncrement = 1; |
248 | 248 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | */ |
265 | 265 | public function setLargeIncrement($largeIncrement) |
266 | 266 | { |
267 | - $this->_largeIncrement = (int)$largeIncrement; |
|
267 | + $this->_largeIncrement = (int) $largeIncrement; |
|
268 | 268 | if ($this->_largeIncrement == 0) { |
269 | 269 | $this->_largeIncrement = 10; |
270 | 270 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $sFolderImg = "{$sSpinFolder}/images/{$this->getImgFolder()}/"; |
406 | 406 | |
407 | 407 | $prefixe = $this->getName(); |
408 | - $prefixe2 = 'spin' . $prefixe; |
|
408 | + $prefixe2 = 'spin'.$prefixe; |
|
409 | 409 | |
410 | 410 | $smallIncrement = $this->getSmallIncrement(); |
411 | 411 | $largeIncrement = $this->getLargeIncrement(); |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $t = array(); |
425 | 425 | |
426 | 426 | if ($this->_loadJS) { |
427 | - $js = $sSpinFolder . '/js/spin.js'; |
|
427 | + $js = $sSpinFolder.'/js/spin.js'; |
|
428 | 428 | $t[] = "<script src='{$js}' type='text/javascript'></script>"; |
429 | 429 | } |
430 | 430 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | //------------------------------------------------------- |
470 | 470 | |
471 | 471 | $t[] = ' </tr>'; |
472 | - $t[] = '</table>' . "\n"; |
|
472 | + $t[] = '</table>'."\n"; |
|
473 | 473 | $t[] = '</div>'; |
474 | 474 | //------------------------------------------- |
475 | 475 | $html = implode("\n", $t); |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | /** |
1191 | 1191 | * @param $p_tarname |
1192 | 1192 | * @param $p_list |
1193 | - * @param $p_mode |
|
1193 | + * @param string $p_mode |
|
1194 | 1194 | * @param string $p_add_dir |
1195 | 1195 | * @param string $p_remove_dir |
1196 | 1196 | * |
@@ -1290,10 +1290,10 @@ discard block |
||
1290 | 1290 | /** |
1291 | 1291 | * @param $p_tarname |
1292 | 1292 | * @param $p_list |
1293 | - * @param $p_mode |
|
1293 | + * @param string $p_mode |
|
1294 | 1294 | * @param $p_list_detail |
1295 | - * @param $p_add_dir |
|
1296 | - * @param $p_remove_dir |
|
1295 | + * @param string $p_add_dir |
|
1296 | + * @param string $p_remove_dir |
|
1297 | 1297 | * |
1298 | 1298 | * @return int |
1299 | 1299 | */ |
@@ -2092,10 +2092,10 @@ discard block |
||
2092 | 2092 | * @param $p_tarname |
2093 | 2093 | * @param $p_file_list |
2094 | 2094 | * @param $p_list_detail |
2095 | - * @param $p_mode |
|
2096 | - * @param $p_path |
|
2095 | + * @param string $p_mode |
|
2096 | + * @param string $p_path |
|
2097 | 2097 | * @param $p_tar_mode |
2098 | - * @param $p_remove_path |
|
2098 | + * @param string $p_remove_path |
|
2099 | 2099 | * |
2100 | 2100 | * @return int |
2101 | 2101 | */ |
@@ -2648,8 +2648,8 @@ discard block |
||
2648 | 2648 | * @param $p_tarname |
2649 | 2649 | * @param $p_index_string |
2650 | 2650 | * @param $p_list_detail |
2651 | - * @param $p_path |
|
2652 | - * @param $p_remove_path |
|
2651 | + * @param string $p_path |
|
2652 | + * @param string $p_remove_path |
|
2653 | 2653 | * @param $p_tar_mode |
2654 | 2654 | * |
2655 | 2655 | * @return int |
@@ -3219,7 +3219,7 @@ discard block |
||
3219 | 3219 | * @param $p_tarname |
3220 | 3220 | * @param $p_file_list |
3221 | 3221 | * @param $p_list_detail |
3222 | - * @param $p_tar_mode |
|
3222 | + * @param string $p_tar_mode |
|
3223 | 3223 | * |
3224 | 3224 | * @return int |
3225 | 3225 | */ |
@@ -3513,9 +3513,9 @@ discard block |
||
3513 | 3513 | * @param $p_tarname |
3514 | 3514 | * @param $p_file_list |
3515 | 3515 | * @param $p_list_detail |
3516 | - * @param $p_tar_mode |
|
3517 | - * @param $p_add_dir |
|
3518 | - * @param $p_remove_dir |
|
3516 | + * @param string $p_tar_mode |
|
3517 | + * @param string $p_add_dir |
|
3518 | + * @param string $p_remove_dir |
|
3519 | 3519 | * |
3520 | 3520 | * @return int |
3521 | 3521 | */ |
@@ -3922,7 +3922,7 @@ discard block |
||
3922 | 3922 | // Return Values : |
3923 | 3923 | // -------------------------------------------------------------------------------- |
3924 | 3924 | /** |
3925 | - * @param $v_binary_data |
|
3925 | + * @param string $v_binary_data |
|
3926 | 3926 | * @param $v_header |
3927 | 3927 | * |
3928 | 3928 | * @return int |
@@ -2418,7 +2418,7 @@ discard block |
||
2418 | 2418 | $p_tar_mode |
2419 | 2419 | ) { |
2420 | 2420 | TrFctStart(__FILE__, __LINE__, 'PclTarHandleExtractByIndex', |
2421 | - "archive_descr='$p_tar', index_current=$p_index_current, index_start='$p_index_start', index_stop='$p_index_stop', list, path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode"); |
|
2421 | + "archive_descr='$p_tar', index_current=$p_index_current, index_start='$p_index_start', index_stop='$p_index_stop', list, path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode"); |
|
2422 | 2422 | $v_result = 1; |
2423 | 2423 | $v_nb = 0; |
2424 | 2424 | |
@@ -2621,7 +2621,7 @@ discard block |
||
2621 | 2621 | else { |
2622 | 2622 | if (filemtime($v_header['filename']) > $v_header['mtime']) { |
2623 | 2623 | TrFctMessage(__FILE__, __LINE__, 2, |
2624 | - 'Existing file ' . $v_header['filename'] . ' is newer (' . date('l dS of F Y h:i:s A', filemtime($v_header['filename'])) . ') than the extracted file (' . date('l dS of F Y h:i:s A', $v_header['mtime']) . ')'); |
|
2624 | + 'Existing file ' . $v_header['filename'] . ' is newer (' . date('l dS of F Y h:i:s A', filemtime($v_header['filename'])) . ') than the extracted file (' . date('l dS of F Y h:i:s A', $v_header['mtime']) . ')'); |
|
2625 | 2625 | |
2626 | 2626 | // ----- Change the file status |
2627 | 2627 | $v_header['status'] = 'newer_exist'; |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | // This library should be called by each script before the include of PhpZip |
61 | 61 | // Library in order to limit the potential 'lib' directory path problem. |
62 | 62 | if (!defined('PCLERROR_LIB')) { |
63 | - include $gPcltarLibDir . '/pclerror.lib.php'; |
|
63 | + include $gPcltarLibDir.'/pclerror.lib.php'; |
|
64 | 64 | } |
65 | 65 | if (!defined('PCLTRACE_LIB')) { |
66 | - include $gPcltarLibDir . '/pcltrace.lib.php'; |
|
66 | + include $gPcltarLibDir.'/pcltrace.lib.php'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // -------------------------------------------------------------------------------- |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | if (!is_file($p_tarname)) { |
824 | 824 | PclErrorLog(-4, "Archive '$p_tarname' does not exist"); |
825 | 825 | } else { |
826 | - PclErrorLog(-6, "Archive '$p_tarname' has invalid size " . filesize($p_tarname) . '(not a 512 block multiple)'); |
|
826 | + PclErrorLog(-6, "Archive '$p_tarname' has invalid size ".filesize($p_tarname).'(not a 512 block multiple)'); |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | // ----- Return |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | if (!is_file($p_tarname_add)) { |
840 | 840 | PclErrorLog(-4, "Archive '$p_tarname_add' does not exist"); |
841 | 841 | } else { |
842 | - PclErrorLog(-6, "Archive '$p_tarname_add' has invalid size " . filesize($p_tarname_add) . '(not a 512 block multiple)'); |
|
842 | + PclErrorLog(-6, "Archive '$p_tarname_add' has invalid size ".filesize($p_tarname_add).'(not a 512 block multiple)'); |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | // ----- Return |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | } |
863 | 863 | |
864 | 864 | // ----- Open a temporary file in write mode |
865 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
865 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
866 | 866 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
867 | 867 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
868 | 868 | // ----- Close tar file |
@@ -915,9 +915,9 @@ discard block |
||
915 | 915 | } |
916 | 916 | |
917 | 917 | // ----- Go to the beginning of last block |
918 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position before :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
918 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position before :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
919 | 919 | fseek($p_tar, $v_size - 512); |
920 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position after :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
920 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position after :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
921 | 921 | } // ----- Look for unknown type |
922 | 922 | else { |
923 | 923 | // ----- Error log |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | if (!is_file($p_tarname)) { |
1209 | 1209 | PclErrorLog(-4, "Archive '$p_tarname' does not exist"); |
1210 | 1210 | } else { |
1211 | - PclErrorLog(-6, "Archive '$p_tarname' has invalid size " . filesize($p_tarname) . '(not a 512 block multiple)'); |
|
1211 | + PclErrorLog(-6, "Archive '$p_tarname' has invalid size ".filesize($p_tarname).'(not a 512 block multiple)'); |
|
1212 | 1212 | } |
1213 | 1213 | |
1214 | 1214 | // ----- Return |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | } |
1232 | 1232 | |
1233 | 1233 | // ----- Open a temporary file in write mode |
1234 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
1234 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
1235 | 1235 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
1236 | 1236 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
1237 | 1237 | // ----- Close tar file |
@@ -1316,9 +1316,9 @@ discard block |
||
1316 | 1316 | } |
1317 | 1317 | |
1318 | 1318 | // ----- Go to the beginning of last block |
1319 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position before :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1319 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position before :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1320 | 1320 | fseek($p_tar, $v_size - 512); |
1321 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position after :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1321 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position after :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1322 | 1322 | |
1323 | 1323 | // ----- Call the adding fct inside the tar |
1324 | 1324 | if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir)) == 1) { |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | // ----- Check the parameters |
1386 | 1386 | if ($p_tar == 0) { |
1387 | 1387 | // ----- Error log |
1388 | - PclErrorLog(-3, 'Invalid file descriptor in file ' . __FILE__ . ', line ' . __LINE__); |
|
1388 | + PclErrorLog(-3, 'Invalid file descriptor in file '.__FILE__.', line '.__LINE__); |
|
1389 | 1389 | |
1390 | 1390 | // ----- Return |
1391 | 1391 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | return PclErrorCode(); |
1441 | 1441 | } |
1442 | 1442 | |
1443 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position before header =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1443 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position before header ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1444 | 1444 | |
1445 | 1445 | // ----- Add the file |
1446 | 1446 | if (($v_result = PclTarHandleAddFile($p_tar, $p_filename, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) { |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | // ----- Look for path |
1461 | 1461 | $v_path = ''; |
1462 | 1462 | if ($p_filename !== '.') { |
1463 | - $v_path = $p_filename . '/'; |
|
1463 | + $v_path = $p_filename.'/'; |
|
1464 | 1464 | } |
1465 | 1465 | |
1466 | 1466 | // ----- Read the directory for files and sub-directories |
@@ -1469,11 +1469,11 @@ discard block |
||
1469 | 1469 | $p_hitem = readdir($p_hdir); // '..' directory |
1470 | 1470 | while ($p_hitem = readdir($p_hdir)) { |
1471 | 1471 | // ----- Look for a file |
1472 | - if (is_file($v_path . $p_hitem)) { |
|
1473 | - TrFctMessage(__FILE__, __LINE__, 4, "Add the file '" . $v_path . $p_hitem . "'"); |
|
1472 | + if (is_file($v_path.$p_hitem)) { |
|
1473 | + TrFctMessage(__FILE__, __LINE__, 4, "Add the file '".$v_path.$p_hitem."'"); |
|
1474 | 1474 | |
1475 | 1475 | // ----- Add the file |
1476 | - if (($v_result = PclTarHandleAddFile($p_tar, $v_path . $p_hitem, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) { |
|
1476 | + if (($v_result = PclTarHandleAddFile($p_tar, $v_path.$p_hitem, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) { |
|
1477 | 1477 | // ----- Return status |
1478 | 1478 | TrFctEnd(__FILE__, __LINE__, $v_result); |
1479 | 1479 | |
@@ -1484,10 +1484,10 @@ discard block |
||
1484 | 1484 | $p_list_detail[$v_nb++] = $v_header; |
1485 | 1485 | } // ----- Recursive call to PclTarHandleAddFile() |
1486 | 1486 | else { |
1487 | - TrFctMessage(__FILE__, __LINE__, 4, "'" . $v_path . $p_hitem . "' is a directory"); |
|
1487 | + TrFctMessage(__FILE__, __LINE__, 4, "'".$v_path.$p_hitem."' is a directory"); |
|
1488 | 1488 | |
1489 | 1489 | // ----- Need an array as parameter |
1490 | - $p_temp_list[0] = $v_path . $p_hitem; |
|
1490 | + $p_temp_list[0] = $v_path.$p_hitem; |
|
1491 | 1491 | $v_result = PclTarHandleAddList($p_tar, $p_temp_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir); |
1492 | 1492 | } |
1493 | 1493 | } |
@@ -1495,7 +1495,7 @@ discard block |
||
1495 | 1495 | // ----- Free memory for the recursive loop |
1496 | 1496 | unset($p_temp_list, $p_hdir, $p_hitem); |
1497 | 1497 | } else { |
1498 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1498 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1499 | 1499 | } |
1500 | 1500 | } |
1501 | 1501 | |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | // ----- Check the parameters |
1532 | 1532 | if ($p_tar == 0) { |
1533 | 1533 | // ----- Error log |
1534 | - PclErrorLog(-3, 'Invalid file descriptor in file ' . __FILE__ . ', line ' . __LINE__); |
|
1534 | + PclErrorLog(-3, 'Invalid file descriptor in file '.__FILE__.', line '.__LINE__); |
|
1535 | 1535 | |
1536 | 1536 | // ----- Return |
1537 | 1537 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -1559,7 +1559,7 @@ discard block |
||
1559 | 1559 | |
1560 | 1560 | if ((0 === strpos($p_filename, './')) || (0 === strpos($p_remove_dir, './'))) { |
1561 | 1561 | if ((0 === strpos($p_filename, './')) && (0 !== strpos($p_remove_dir, './'))) { |
1562 | - $p_remove_dir = './' . $p_remove_dir; |
|
1562 | + $p_remove_dir = './'.$p_remove_dir; |
|
1563 | 1563 | } |
1564 | 1564 | if ((0 !== strpos($p_filename, './')) && (0 === strpos($p_remove_dir, './'))) { |
1565 | 1565 | $p_remove_dir = substr($p_remove_dir, 2); |
@@ -1573,9 +1573,9 @@ discard block |
||
1573 | 1573 | } |
1574 | 1574 | if ($p_add_dir != '') { |
1575 | 1575 | if (substr($p_add_dir, -1) === '/') { |
1576 | - $v_stored_filename = $p_add_dir . $v_stored_filename; |
|
1576 | + $v_stored_filename = $p_add_dir.$v_stored_filename; |
|
1577 | 1577 | } else { |
1578 | - $v_stored_filename = $p_add_dir . '/' . $v_stored_filename; |
|
1578 | + $v_stored_filename = $p_add_dir.'/'.$v_stored_filename; |
|
1579 | 1579 | } |
1580 | 1580 | TrFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'"); |
1581 | 1581 | } |
@@ -1612,7 +1612,7 @@ discard block |
||
1612 | 1612 | return $v_result; |
1613 | 1613 | } |
1614 | 1614 | |
1615 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after header =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1615 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after header ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1616 | 1616 | |
1617 | 1617 | // ----- Read the file by 512 octets blocks |
1618 | 1618 | $i = 0; |
@@ -1630,7 +1630,7 @@ discard block |
||
1630 | 1630 | // ----- Close the file |
1631 | 1631 | fclose($v_file); |
1632 | 1632 | |
1633 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1633 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1634 | 1634 | } // ----- Look for a directory |
1635 | 1635 | else { |
1636 | 1636 | // ----- Call the header generation |
@@ -1641,7 +1641,7 @@ discard block |
||
1641 | 1641 | return $v_result; |
1642 | 1642 | } |
1643 | 1643 | |
1644 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after header =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1644 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after header ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
1645 | 1645 | } |
1646 | 1646 | |
1647 | 1647 | // ----- Return |
@@ -1688,7 +1688,7 @@ discard block |
||
1688 | 1688 | // ----- Check the parameters |
1689 | 1689 | if (($p_tar == 0) || ($p_filename == '')) { |
1690 | 1690 | // ----- Error log |
1691 | - PclErrorLog(-3, 'Invalid file descriptor in file ' . __FILE__ . ', line ' . __LINE__); |
|
1691 | + PclErrorLog(-3, 'Invalid file descriptor in file '.__FILE__.', line '.__LINE__); |
|
1692 | 1692 | |
1693 | 1693 | // ----- Return |
1694 | 1694 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -1701,7 +1701,7 @@ discard block |
||
1701 | 1701 | $p_stored_filename = $p_filename; |
1702 | 1702 | } |
1703 | 1703 | $v_reduce_filename = PclTarHandlePathReduction($p_stored_filename); |
1704 | - TrFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_reduce_filename', strlen " . strlen($v_reduce_filename)); |
|
1704 | + TrFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_reduce_filename', strlen ".strlen($v_reduce_filename)); |
|
1705 | 1705 | |
1706 | 1706 | // ----- Get file info |
1707 | 1707 | $v_info = stat($p_filename); |
@@ -1902,7 +1902,7 @@ discard block |
||
1902 | 1902 | // ----- Check the path |
1903 | 1903 | //if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../"))) |
1904 | 1904 | if ($p_path == '') { |
1905 | - $p_path = './' . $p_path; |
|
1905 | + $p_path = './'.$p_path; |
|
1906 | 1906 | } |
1907 | 1907 | |
1908 | 1908 | // ----- Look for path to remove format (should end by /) |
@@ -1997,29 +1997,29 @@ discard block |
||
1997 | 1997 | continue; |
1998 | 1998 | } |
1999 | 1999 | |
2000 | - TrFctMessage(__FILE__, __LINE__, 2, "Found file '" . $v_header['filename'] . "', size '" . $v_header['size'] . "'"); |
|
2000 | + TrFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); |
|
2001 | 2001 | |
2002 | 2002 | // ----- Look for partial extract |
2003 | 2003 | if ((!$v_extract_all) && is_array($p_file_list)) { |
2004 | - TrFctMessage(__FILE__, __LINE__, 2, 'Look if the file ' . $v_header['filename'] . ' need to be extracted'); |
|
2004 | + TrFctMessage(__FILE__, __LINE__, 2, 'Look if the file '.$v_header['filename'].' need to be extracted'); |
|
2005 | 2005 | |
2006 | 2006 | // ----- By default no unzip if the file is not found |
2007 | 2007 | $v_extract_file = false; |
2008 | 2008 | |
2009 | 2009 | // ----- Look into the file list |
2010 | 2010 | for ($i = 0, $iMax = count($p_file_list); $i < $iMax; ++$i) { |
2011 | - TrFctMessage(__FILE__, __LINE__, 2, 'Compare archived file ' . $v_header['filename'] . " from asked list file '" . $p_file_list[$i] . "'"); |
|
2011 | + TrFctMessage(__FILE__, __LINE__, 2, 'Compare archived file '.$v_header['filename']." from asked list file '".$p_file_list[$i]."'"); |
|
2012 | 2012 | |
2013 | 2013 | // ----- Look if it is a directory |
2014 | 2014 | if (substr($p_file_list[$i], -1) === '/') { |
2015 | - TrFctMessage(__FILE__, __LINE__, 3, 'Compare file ' . $v_header['filename'] . " with directory '$p_file_list[$i]'"); |
|
2015 | + TrFctMessage(__FILE__, __LINE__, 3, 'Compare file '.$v_header['filename']." with directory '$p_file_list[$i]'"); |
|
2016 | 2016 | |
2017 | 2017 | // ----- Look if the directory is in the filename path |
2018 | 2018 | if ((strlen($v_header['filename']) > strlen($p_file_list[$i])) |
2019 | 2019 | && (0 === strpos($v_header['filename'], $p_file_list[$i])) |
2020 | 2020 | ) { |
2021 | 2021 | // ----- The file is in the directory, so extract it |
2022 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . " is in directory '$p_file_list[$i]' : extract it"); |
|
2022 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename']." is in directory '$p_file_list[$i]' : extract it"); |
|
2023 | 2023 | $v_extract_file = true; |
2024 | 2024 | |
2025 | 2025 | // ----- End of loop |
@@ -2029,7 +2029,7 @@ discard block |
||
2029 | 2029 | else { |
2030 | 2030 | if ($p_file_list[$i] == $v_header['filename']) { |
2031 | 2031 | // ----- File found |
2032 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' should be extracted'); |
|
2032 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' should be extracted'); |
|
2033 | 2033 | $v_extract_file = true; |
2034 | 2034 | |
2035 | 2035 | // ----- End of loop |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | |
2041 | 2041 | // ----- Trace |
2042 | 2042 | if (!$v_extract_file) { |
2043 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' should not be extracted'); |
|
2043 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' should not be extracted'); |
|
2044 | 2044 | } |
2045 | 2045 | } else { |
2046 | 2046 | // ----- All files need to be extracted |
@@ -2051,10 +2051,10 @@ discard block |
||
2051 | 2051 | if ($v_extract_file && (!$v_listing)) { |
2052 | 2052 | // ----- Look for path to remove |
2053 | 2053 | if (($p_remove_path != '') && (0 === strpos($v_header['filename'], $p_remove_path))) { |
2054 | - TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file " . $v_header['filename'] . ''); |
|
2054 | + TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file ".$v_header['filename'].''); |
|
2055 | 2055 | // ----- Remove the path |
2056 | 2056 | $v_header['filename'] = substr($v_header['filename'], $p_remove_path_size); |
2057 | - TrFctMessage(__FILE__, __LINE__, 3, 'Reslting file is ' . $v_header['filename'] . ''); |
|
2057 | + TrFctMessage(__FILE__, __LINE__, 3, 'Reslting file is '.$v_header['filename'].''); |
|
2058 | 2058 | } |
2059 | 2059 | |
2060 | 2060 | // ----- Add the path to the file |
@@ -2068,22 +2068,22 @@ discard block |
||
2068 | 2068 | |
2069 | 2069 | // ----- Add the path |
2070 | 2070 | if (0 === strpos($v_header['filename'], '/')) { |
2071 | - $v_header['filename'] = $p_path . $v_header['filename']; |
|
2071 | + $v_header['filename'] = $p_path.$v_header['filename']; |
|
2072 | 2072 | } else { |
2073 | - $v_header['filename'] = $p_path . '/' . $v_header['filename']; |
|
2073 | + $v_header['filename'] = $p_path.'/'.$v_header['filename']; |
|
2074 | 2074 | } |
2075 | 2075 | } |
2076 | 2076 | |
2077 | 2077 | // ----- Trace |
2078 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
2078 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
2079 | 2079 | |
2080 | 2080 | // ----- Check that the file does not exists |
2081 | 2081 | if (file_exists($v_header['filename'])) { |
2082 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' already exists'); |
|
2082 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' already exists'); |
|
2083 | 2083 | |
2084 | 2084 | // ----- Look if file is a directory |
2085 | 2085 | if (is_dir($v_header['filename'])) { |
2086 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is a directory'); |
|
2086 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is a directory'); |
|
2087 | 2087 | |
2088 | 2088 | // ----- Change the file status |
2089 | 2089 | $v_header['status'] = 'already_a_directory'; |
@@ -2094,7 +2094,7 @@ discard block |
||
2094 | 2094 | } // ----- Look if file is write protected |
2095 | 2095 | else { |
2096 | 2096 | if (!s_writable($v_header['filename'])) { |
2097 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is write protected'); |
|
2097 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is write protected'); |
|
2098 | 2098 | |
2099 | 2099 | // ----- Change the file status |
2100 | 2100 | $v_header['status'] = 'write_protected'; |
@@ -2128,7 +2128,7 @@ discard block |
||
2128 | 2128 | } |
2129 | 2129 | |
2130 | 2130 | if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1) { |
2131 | - TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for ' . $v_header['filename'] . ''); |
|
2131 | + TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for '.$v_header['filename'].''); |
|
2132 | 2132 | |
2133 | 2133 | // ----- Change the file status |
2134 | 2134 | $v_header['status'] = 'path_creation_fail'; |
@@ -2143,7 +2143,7 @@ discard block |
||
2143 | 2143 | if ($v_extract_file && ($v_header['typeflag'] != '5')) { |
2144 | 2144 | // ----- Open the destination file in write mode |
2145 | 2145 | if (($v_dest_file = @fopen($v_header['filename'], 'wb')) == 0) { |
2146 | - TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode'); |
|
2146 | + TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening '.$v_header['filename'].' in write binary mode'); |
|
2147 | 2147 | |
2148 | 2148 | // ----- Change the file status |
2149 | 2149 | $v_header['status'] = 'write_error'; |
@@ -2156,12 +2156,12 @@ discard block |
||
2156 | 2156 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
2157 | 2157 | } |
2158 | 2158 | } else { |
2159 | - TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of ' . $v_header['filename'] . ''); |
|
2159 | + TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of '.$v_header['filename'].''); |
|
2160 | 2160 | |
2161 | 2161 | // ----- Read data |
2162 | 2162 | $n = floor($v_header['size'] / 512); |
2163 | 2163 | for ($i = 0; $i < $n; ++$i) { |
2164 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($i + 1)); |
|
2164 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($i + 1)); |
|
2165 | 2165 | if ($p_tar_mode === 'tar') { |
2166 | 2166 | $v_content = fread($v_tar, 512); |
2167 | 2167 | } else { |
@@ -2170,7 +2170,7 @@ discard block |
||
2170 | 2170 | fwrite($v_dest_file, $v_content, 512); |
2171 | 2171 | } |
2172 | 2172 | if (($v_header['size'] % 512) != 0) { |
2173 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read last ' . ($v_header['size'] % 512) . ' bytes in a 512 block'); |
|
2173 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read last '.($v_header['size'] % 512).' bytes in a 512 block'); |
|
2174 | 2174 | if ($p_tar_mode === 'tar') { |
2175 | 2175 | $v_content = fread($v_tar, 512); |
2176 | 2176 | } else { |
@@ -2198,7 +2198,7 @@ discard block |
||
2198 | 2198 | } |
2199 | 2199 | |
2200 | 2200 | // ----- Error log |
2201 | - PclErrorLog(-7, 'Extracted file ' . $v_header['filename'] . " does not have the correct file size '" . filesize($v_filename) . "' ('" . $v_header['size'] . "' expected). Archive may be corrupted."); |
|
2201 | + PclErrorLog(-7, 'Extracted file '.$v_header['filename']." does not have the correct file size '".filesize($v_filename)."' ('".$v_header['size']."' expected). Archive may be corrupted."); |
|
2202 | 2202 | |
2203 | 2203 | // ----- Return |
2204 | 2204 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -2209,7 +2209,7 @@ discard block |
||
2209 | 2209 | // ----- Trace |
2210 | 2210 | TrFctMessage(__FILE__, __LINE__, 2, 'Extraction done'); |
2211 | 2211 | } else { |
2212 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file ' . $v_header['filename'] . ' skipped.'); |
|
2212 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file '.$v_header['filename'].' skipped.'); |
|
2213 | 2213 | |
2214 | 2214 | // ----- Jump to next file |
2215 | 2215 | TrFctMessage(__FILE__, __LINE__, 2, 'Jump to next file'); |
@@ -2222,8 +2222,8 @@ discard block |
||
2222 | 2222 | } // ----- Look for file that is not to be unzipped |
2223 | 2223 | else { |
2224 | 2224 | // ----- Trace |
2225 | - TrFctMessage(__FILE__, __LINE__, 2, 'Jump file ' . $v_header['filename'] . ''); |
|
2226 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
2225 | + TrFctMessage(__FILE__, __LINE__, 2, 'Jump file '.$v_header['filename'].''); |
|
2226 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
2227 | 2227 | |
2228 | 2228 | // ----- Jump to next file |
2229 | 2229 | if ($p_tar_mode === 'tar') { |
@@ -2232,7 +2232,7 @@ discard block |
||
2232 | 2232 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
2233 | 2233 | } |
2234 | 2234 | |
2235 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
2235 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
2236 | 2236 | } |
2237 | 2237 | |
2238 | 2238 | if ($p_tar_mode === 'tar') { |
@@ -2243,7 +2243,7 @@ discard block |
||
2243 | 2243 | |
2244 | 2244 | // ----- File name and properties are logged if listing mode or file is extracted |
2245 | 2245 | if ($v_listing || $v_extract_file || $v_extraction_stopped) { |
2246 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
2246 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
2247 | 2247 | |
2248 | 2248 | // ----- Log extracted files |
2249 | 2249 | if (($v_file_dir = dirname($v_header['filename'])) == $v_header['filename']) { |
@@ -2318,7 +2318,7 @@ discard block |
||
2318 | 2318 | || ((0 !== strpos($p_path, '/')) && (0 !== strpos($p_path, '../')) |
2319 | 2319 | && (0 !== strpos($p_path, './'))) |
2320 | 2320 | ) { |
2321 | - $p_path = './' . $p_path; |
|
2321 | + $p_path = './'.$p_path; |
|
2322 | 2322 | } |
2323 | 2323 | |
2324 | 2324 | // ----- Look for path to remove format (should end by /) |
@@ -2466,14 +2466,14 @@ discard block |
||
2466 | 2466 | continue; |
2467 | 2467 | } |
2468 | 2468 | |
2469 | - TrFctMessage(__FILE__, __LINE__, 2, 'Found file ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
2469 | + TrFctMessage(__FILE__, __LINE__, 2, 'Found file '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
2470 | 2470 | |
2471 | 2471 | // ----- Look if file is in the range to be extracted |
2472 | 2472 | if (($p_index_current >= $p_index_start) && ($p_index_current <= $p_index_stop)) { |
2473 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' is in the range to be extracted'); |
|
2473 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' is in the range to be extracted'); |
|
2474 | 2474 | $v_extract_file = true; |
2475 | 2475 | } else { |
2476 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' is out of the range'); |
|
2476 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' is out of the range'); |
|
2477 | 2477 | $v_extract_file = false; |
2478 | 2478 | } |
2479 | 2479 | |
@@ -2488,8 +2488,8 @@ discard block |
||
2488 | 2488 | } // ----- Look for file that is not to be extracted |
2489 | 2489 | else { |
2490 | 2490 | // ----- Trace |
2491 | - TrFctMessage(__FILE__, __LINE__, 2, 'Jump file ' . $v_header['filename'] . ''); |
|
2492 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
2491 | + TrFctMessage(__FILE__, __LINE__, 2, 'Jump file '.$v_header['filename'].''); |
|
2492 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
2493 | 2493 | |
2494 | 2494 | // ----- Jump to next file |
2495 | 2495 | if ($p_tar_mode === 'tar') { |
@@ -2498,7 +2498,7 @@ discard block |
||
2498 | 2498 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
2499 | 2499 | } |
2500 | 2500 | |
2501 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
2501 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
2502 | 2502 | } |
2503 | 2503 | |
2504 | 2504 | if ($p_tar_mode === 'tar') { |
@@ -2509,7 +2509,7 @@ discard block |
||
2509 | 2509 | |
2510 | 2510 | // ----- File name and properties are logged if listing mode or file is extracted |
2511 | 2511 | if ($v_extract_file) { |
2512 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
2512 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
2513 | 2513 | |
2514 | 2514 | // ----- Log extracted files |
2515 | 2515 | if (($v_file_dir = dirname($v_header['filename'])) == $v_header['filename']) { |
@@ -2566,10 +2566,10 @@ discard block |
||
2566 | 2566 | |
2567 | 2567 | // ----- Look for path to remove |
2568 | 2568 | if (($p_remove_path != '') && (0 === strpos($v_header['filename'], $p_remove_path))) { |
2569 | - TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file " . $v_header['filename'] . ''); |
|
2569 | + TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file ".$v_header['filename'].''); |
|
2570 | 2570 | // ----- Remove the path |
2571 | 2571 | $v_header['filename'] = substr($v_header['filename'], $p_remove_path_size); |
2572 | - TrFctMessage(__FILE__, __LINE__, 3, 'Resulting file is ' . $v_header['filename'] . ''); |
|
2572 | + TrFctMessage(__FILE__, __LINE__, 3, 'Resulting file is '.$v_header['filename'].''); |
|
2573 | 2573 | } |
2574 | 2574 | |
2575 | 2575 | // ----- Add the path to the file |
@@ -2583,22 +2583,22 @@ discard block |
||
2583 | 2583 | |
2584 | 2584 | // ----- Add the path |
2585 | 2585 | if (0 === strpos($v_header['filename'], '/')) { |
2586 | - $v_header['filename'] = $p_path . $v_header['filename']; |
|
2586 | + $v_header['filename'] = $p_path.$v_header['filename']; |
|
2587 | 2587 | } else { |
2588 | - $v_header['filename'] = $p_path . '/' . $v_header['filename']; |
|
2588 | + $v_header['filename'] = $p_path.'/'.$v_header['filename']; |
|
2589 | 2589 | } |
2590 | 2590 | } |
2591 | 2591 | |
2592 | 2592 | // ----- Trace |
2593 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
2593 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
2594 | 2594 | |
2595 | 2595 | // ----- Check that the file does not exists |
2596 | 2596 | if (file_exists($v_header['filename'])) { |
2597 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' already exists'); |
|
2597 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' already exists'); |
|
2598 | 2598 | |
2599 | 2599 | // ----- Look if file is a directory |
2600 | 2600 | if (is_dir($v_header['filename'])) { |
2601 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is a directory'); |
|
2601 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is a directory'); |
|
2602 | 2602 | |
2603 | 2603 | // ----- Change the file status |
2604 | 2604 | $v_header['status'] = 'already_a_directory'; |
@@ -2609,7 +2609,7 @@ discard block |
||
2609 | 2609 | } // ----- Look if file is write protected |
2610 | 2610 | else { |
2611 | 2611 | if (!s_writable($v_header['filename'])) { |
2612 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is write protected'); |
|
2612 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is write protected'); |
|
2613 | 2613 | |
2614 | 2614 | // ----- Change the file status |
2615 | 2615 | $v_header['status'] = 'write_protected'; |
@@ -2621,7 +2621,7 @@ discard block |
||
2621 | 2621 | else { |
2622 | 2622 | if (filemtime($v_header['filename']) > $v_header['mtime']) { |
2623 | 2623 | TrFctMessage(__FILE__, __LINE__, 2, |
2624 | - 'Existing file ' . $v_header['filename'] . ' is newer (' . date('l dS of F Y h:i:s A', filemtime($v_header['filename'])) . ') than the extracted file (' . date('l dS of F Y h:i:s A', $v_header['mtime']) . ')'); |
|
2624 | + 'Existing file '.$v_header['filename'].' is newer ('.date('l dS of F Y h:i:s A', filemtime($v_header['filename'])).') than the extracted file ('.date('l dS of F Y h:i:s A', $v_header['mtime']).')'); |
|
2625 | 2625 | |
2626 | 2626 | // ----- Change the file status |
2627 | 2627 | $v_header['status'] = 'newer_exist'; |
@@ -2645,7 +2645,7 @@ discard block |
||
2645 | 2645 | } |
2646 | 2646 | |
2647 | 2647 | if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1) { |
2648 | - TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for ' . $v_header['filename'] . ''); |
|
2648 | + TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for '.$v_header['filename'].''); |
|
2649 | 2649 | |
2650 | 2650 | // ----- Change the file status |
2651 | 2651 | $v_header['status'] = 'path_creation_fail'; |
@@ -2660,7 +2660,7 @@ discard block |
||
2660 | 2660 | if ($v_extract_file && ($v_header['typeflag'] != '5')) { |
2661 | 2661 | // ----- Open the destination file in write mode |
2662 | 2662 | if (($v_dest_file = @fopen($v_header['filename'], 'wb')) == 0) { |
2663 | - TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode'); |
|
2663 | + TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening '.$v_header['filename'].' in write binary mode'); |
|
2664 | 2664 | |
2665 | 2665 | // ----- Change the file status |
2666 | 2666 | $v_header['status'] = 'write_error'; |
@@ -2673,12 +2673,12 @@ discard block |
||
2673 | 2673 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
2674 | 2674 | } |
2675 | 2675 | } else { |
2676 | - TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of ' . $v_header['filename'] . ''); |
|
2676 | + TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of '.$v_header['filename'].''); |
|
2677 | 2677 | |
2678 | 2678 | // ----- Read data |
2679 | 2679 | $n = floor($v_header['size'] / 512); |
2680 | 2680 | for ($i = 0; $i < $n; ++$i) { |
2681 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($i + 1)); |
|
2681 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($i + 1)); |
|
2682 | 2682 | if ($p_tar_mode === 'tar') { |
2683 | 2683 | $v_content = fread($v_tar, 512); |
2684 | 2684 | } else { |
@@ -2687,7 +2687,7 @@ discard block |
||
2687 | 2687 | fwrite($v_dest_file, $v_content, 512); |
2688 | 2688 | } |
2689 | 2689 | if (($v_header['size'] % 512) != 0) { |
2690 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read last ' . ($v_header['size'] % 512) . ' bytes in a 512 block'); |
|
2690 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read last '.($v_header['size'] % 512).' bytes in a 512 block'); |
|
2691 | 2691 | if ($p_tar_mode === 'tar') { |
2692 | 2692 | $v_content = fread($v_tar, 512); |
2693 | 2693 | } else { |
@@ -2708,7 +2708,7 @@ discard block |
||
2708 | 2708 | clearstatcache(); |
2709 | 2709 | if (filesize($v_header['filename']) != $v_header['size']) { |
2710 | 2710 | // ----- Error log |
2711 | - PclErrorLog(-7, 'Extracted file ' . $v_header['filename'] . " does not have the correct file size '" . filesize($v_filename) . "' ('" . $v_header['size'] . "' expected). Archive may be corrupted."); |
|
2711 | + PclErrorLog(-7, 'Extracted file '.$v_header['filename']." does not have the correct file size '".filesize($v_filename)."' ('".$v_header['size']."' expected). Archive may be corrupted."); |
|
2712 | 2712 | |
2713 | 2713 | // ----- Return |
2714 | 2714 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -2719,7 +2719,7 @@ discard block |
||
2719 | 2719 | // ----- Trace |
2720 | 2720 | TrFctMessage(__FILE__, __LINE__, 2, 'Extraction done'); |
2721 | 2721 | } else { |
2722 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file ' . $v_header['filename'] . ' skipped.'); |
|
2722 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file '.$v_header['filename'].' skipped.'); |
|
2723 | 2723 | |
2724 | 2724 | // ----- Jump to next file |
2725 | 2725 | TrFctMessage(__FILE__, __LINE__, 2, 'Jump to next file'); |
@@ -2773,7 +2773,7 @@ discard block |
||
2773 | 2773 | } |
2774 | 2774 | |
2775 | 2775 | // ----- Open a temporary file in write mode |
2776 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
2776 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
2777 | 2777 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
2778 | 2778 | if (($v_temp_tar = @fopen($v_temp_tarname, 'wb')) == 0) { |
2779 | 2779 | // ----- Close tar file |
@@ -2802,7 +2802,7 @@ discard block |
||
2802 | 2802 | } |
2803 | 2803 | |
2804 | 2804 | // ----- Open a temporary file in write mode |
2805 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
2805 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
2806 | 2806 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
2807 | 2807 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
2808 | 2808 | // ----- Close tar file |
@@ -2859,7 +2859,7 @@ discard block |
||
2859 | 2859 | continue; |
2860 | 2860 | } |
2861 | 2861 | |
2862 | - TrFctMessage(__FILE__, __LINE__, 2, 'Found file ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
2862 | + TrFctMessage(__FILE__, __LINE__, 2, 'Found file '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
2863 | 2863 | |
2864 | 2864 | // ----- Look for filenames to delete |
2865 | 2865 | for ($i = 0, $v_delete_file = false; ($i < count($p_file_list)) && (!$v_delete_file); ++$i) { |
@@ -2867,12 +2867,12 @@ discard block |
||
2867 | 2867 | // if ($p_file_list[$i] == $v_header['filename']) |
2868 | 2868 | if (($v_len = strcmp($p_file_list[$i], $v_header['filename'])) <= 0) { |
2869 | 2869 | if ($v_len == 0) { |
2870 | - TrFctMessage(__FILE__, __LINE__, 3, 'Found that ' . $v_header['filename'] . ' need to be deleted'); |
|
2870 | + TrFctMessage(__FILE__, __LINE__, 3, 'Found that '.$v_header['filename'].' need to be deleted'); |
|
2871 | 2871 | $v_delete_file = true; |
2872 | 2872 | } else { |
2873 | - TrFctMessage(__FILE__, __LINE__, 3, 'Look if ' . $v_header['filename'] . " is a file in $p_file_list[$i]"); |
|
2873 | + TrFctMessage(__FILE__, __LINE__, 3, 'Look if '.$v_header['filename']." is a file in $p_file_list[$i]"); |
|
2874 | 2874 | if (substr($v_header['filename'], strlen($p_file_list[$i]), 1) === '/') { |
2875 | - TrFctMessage(__FILE__, __LINE__, 3, '' . $v_header['filename'] . " is a file in $p_file_list[$i]"); |
|
2875 | + TrFctMessage(__FILE__, __LINE__, 3, ''.$v_header['filename']." is a file in $p_file_list[$i]"); |
|
2876 | 2876 | $v_delete_file = true; |
2877 | 2877 | } |
2878 | 2878 | } |
@@ -2881,7 +2881,7 @@ discard block |
||
2881 | 2881 | |
2882 | 2882 | // ----- Copy files that do not need to be deleted |
2883 | 2883 | if (!$v_delete_file) { |
2884 | - TrFctMessage(__FILE__, __LINE__, 2, 'Keep file ' . $v_header['filename'] . ''); |
|
2884 | + TrFctMessage(__FILE__, __LINE__, 2, 'Keep file '.$v_header['filename'].''); |
|
2885 | 2885 | |
2886 | 2886 | // ----- Write the file header |
2887 | 2887 | if ($p_tar_mode === 'tar') { |
@@ -2893,7 +2893,7 @@ discard block |
||
2893 | 2893 | // ----- Write the file data |
2894 | 2894 | $n = ceil($v_header['size'] / 512); |
2895 | 2895 | for ($i = 0; $i < $n; ++$i) { |
2896 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($i + 1)); |
|
2896 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($i + 1)); |
|
2897 | 2897 | if ($p_tar_mode === 'tar') { |
2898 | 2898 | $v_content = fread($v_tar, 512); |
2899 | 2899 | fwrite($v_temp_tar, $v_content, 512); |
@@ -2904,7 +2904,7 @@ discard block |
||
2904 | 2904 | } |
2905 | 2905 | |
2906 | 2906 | // ----- File name and properties are logged if listing mode or file is extracted |
2907 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
2907 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
2908 | 2908 | |
2909 | 2909 | // ----- Add the array describing the file into the list |
2910 | 2910 | $p_list_detail[$v_nb] = $v_header; |
@@ -2915,8 +2915,8 @@ discard block |
||
2915 | 2915 | } // ----- Look for file that is to be deleted |
2916 | 2916 | else { |
2917 | 2917 | // ----- Trace |
2918 | - TrFctMessage(__FILE__, __LINE__, 2, 'Start deletion of ' . $v_header['filename'] . ''); |
|
2919 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
2918 | + TrFctMessage(__FILE__, __LINE__, 2, 'Start deletion of '.$v_header['filename'].''); |
|
2919 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
2920 | 2920 | |
2921 | 2921 | // ----- Jump to next file |
2922 | 2922 | if ($p_tar_mode === 'tar') { |
@@ -2925,7 +2925,7 @@ discard block |
||
2925 | 2925 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
2926 | 2926 | } |
2927 | 2927 | |
2928 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
2928 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
2929 | 2929 | } |
2930 | 2930 | |
2931 | 2931 | // ----- Look for end of file |
@@ -3011,7 +3011,7 @@ discard block |
||
3011 | 3011 | } |
3012 | 3012 | |
3013 | 3013 | // ----- Open a temporary file in write mode |
3014 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
3014 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
3015 | 3015 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
3016 | 3016 | if (($v_temp_tar = @fopen($v_temp_tarname, 'wb')) == 0) { |
3017 | 3017 | // ----- Close tar file |
@@ -3040,7 +3040,7 @@ discard block |
||
3040 | 3040 | } |
3041 | 3041 | |
3042 | 3042 | // ----- Open a temporary file in write mode |
3043 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
3043 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
3044 | 3044 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
3045 | 3045 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
3046 | 3046 | // ----- Close tar file |
@@ -3075,9 +3075,9 @@ discard block |
||
3075 | 3075 | } |
3076 | 3076 | if ($p_add_dir != '') { |
3077 | 3077 | if (substr($p_add_dir, -1) === '/') { |
3078 | - $v_stored_list[$i] = $p_add_dir . $v_stored_list[$i]; |
|
3078 | + $v_stored_list[$i] = $p_add_dir.$v_stored_list[$i]; |
|
3079 | 3079 | } else { |
3080 | - $v_stored_list[$i] = $p_add_dir . '/' . $v_stored_list[$i]; |
|
3080 | + $v_stored_list[$i] = $p_add_dir.'/'.$v_stored_list[$i]; |
|
3081 | 3081 | } |
3082 | 3082 | TrFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_file_list[$i]' = '$v_stored_list[$i]'"); |
3083 | 3083 | } |
@@ -3132,7 +3132,7 @@ discard block |
||
3132 | 3132 | continue; |
3133 | 3133 | } |
3134 | 3134 | |
3135 | - TrFctMessage(__FILE__, __LINE__, 2, 'Found file ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
3135 | + TrFctMessage(__FILE__, __LINE__, 2, 'Found file '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
3136 | 3136 | |
3137 | 3137 | // ----- Look for filenames to update |
3138 | 3138 | for ($i = 0, $v_update_file = false, $v_found_file = false; ($i < count($v_stored_list)) && (!$v_update_file); ++$i) { |
@@ -3141,8 +3141,8 @@ discard block |
||
3141 | 3141 | // ----- Compare the file names |
3142 | 3142 | if ($v_stored_list[$i] == $v_header['filename']) { |
3143 | 3143 | TrFctMessage(__FILE__, __LINE__, 3, "File '$v_stored_list[$i]' is present in archive"); |
3144 | - TrFctMessage(__FILE__, __LINE__, 3, "File '$v_stored_list[$i]' mtime=" . filemtime($p_file_list[$i]) . ' ' . date('l dS of F Y h:i:s A', filemtime($p_file_list[$i]))); |
|
3145 | - TrFctMessage(__FILE__, __LINE__, 3, 'Archived mtime=' . $v_header['mtime'] . ' ' . date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
3144 | + TrFctMessage(__FILE__, __LINE__, 3, "File '$v_stored_list[$i]' mtime=".filemtime($p_file_list[$i]).' '.date('l dS of F Y h:i:s A', filemtime($p_file_list[$i]))); |
|
3145 | + TrFctMessage(__FILE__, __LINE__, 3, 'Archived mtime='.$v_header['mtime'].' '.date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
3146 | 3146 | |
3147 | 3147 | // ----- Store found informations |
3148 | 3148 | $v_found_file = true; |
@@ -3160,13 +3160,13 @@ discard block |
||
3160 | 3160 | // ----- Flag the name in order not to add the file at the end |
3161 | 3161 | $v_found_list[$i] = 1; |
3162 | 3162 | } else { |
3163 | - TrFctMessage(__FILE__, __LINE__, 4, "File '$p_file_list[$i]' is not " . $v_header['filename'] . ''); |
|
3163 | + TrFctMessage(__FILE__, __LINE__, 4, "File '$p_file_list[$i]' is not ".$v_header['filename'].''); |
|
3164 | 3164 | } |
3165 | 3165 | } |
3166 | 3166 | |
3167 | 3167 | // ----- Copy files that do not need to be updated |
3168 | 3168 | if (!$v_update_file) { |
3169 | - TrFctMessage(__FILE__, __LINE__, 2, 'Keep file ' . $v_header['filename'] . ''); |
|
3169 | + TrFctMessage(__FILE__, __LINE__, 2, 'Keep file '.$v_header['filename'].''); |
|
3170 | 3170 | |
3171 | 3171 | // ----- Write the file header |
3172 | 3172 | if ($p_tar_mode === 'tar') { |
@@ -3178,7 +3178,7 @@ discard block |
||
3178 | 3178 | // ----- Write the file data |
3179 | 3179 | $n = ceil($v_header['size'] / 512); |
3180 | 3180 | for ($j = 0; $j < $n; ++$j) { |
3181 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($j + 1)); |
|
3181 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($j + 1)); |
|
3182 | 3182 | if ($p_tar_mode === 'tar') { |
3183 | 3183 | $v_content = fread($v_tar, 512); |
3184 | 3184 | fwrite($v_temp_tar, $v_content, 512); |
@@ -3189,7 +3189,7 @@ discard block |
||
3189 | 3189 | } |
3190 | 3190 | |
3191 | 3191 | // ----- File name and properties are logged if listing mode or file is extracted |
3192 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
3192 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
3193 | 3193 | |
3194 | 3194 | // ----- Add the array describing the file into the list |
3195 | 3195 | $p_list_detail[$v_nb] = $v_header; |
@@ -3224,7 +3224,7 @@ discard block |
||
3224 | 3224 | } |
3225 | 3225 | |
3226 | 3226 | // ----- Trace |
3227 | - TrFctMessage(__FILE__, __LINE__, 2, 'Skip old file ' . $v_header['filename'] . ''); |
|
3227 | + TrFctMessage(__FILE__, __LINE__, 2, 'Skip old file '.$v_header['filename'].''); |
|
3228 | 3228 | |
3229 | 3229 | // ----- Jump to next file |
3230 | 3230 | if ($p_tar_mode === 'tar') { |
@@ -3361,10 +3361,10 @@ discard block |
||
3361 | 3361 | if (strlen($v_binary_data) != 512) { |
3362 | 3362 | $v_header['filename'] = ''; |
3363 | 3363 | $v_header['status'] = 'invalid_header'; |
3364 | - TrFctMessage(__FILE__, __LINE__, 2, 'Invalid block size : ' . strlen($v_binary_data)); |
|
3364 | + TrFctMessage(__FILE__, __LINE__, 2, 'Invalid block size : '.strlen($v_binary_data)); |
|
3365 | 3365 | |
3366 | 3366 | // ----- Error log |
3367 | - PclErrorLog(-10, 'Invalid block size : ' . strlen($v_binary_data)); |
|
3367 | + PclErrorLog(-10, 'Invalid block size : '.strlen($v_binary_data)); |
|
3368 | 3368 | |
3369 | 3369 | // ----- Return |
3370 | 3370 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -3394,9 +3394,9 @@ discard block |
||
3394 | 3394 | |
3395 | 3395 | // ----- Extract the checksum for check |
3396 | 3396 | $v_header['checksum'] = octdec(trim($v_data['checksum'])); |
3397 | - TrFctMessage(__FILE__, __LINE__, 3, 'File checksum : ' . $v_header['checksum'] . ''); |
|
3397 | + TrFctMessage(__FILE__, __LINE__, 3, 'File checksum : '.$v_header['checksum'].''); |
|
3398 | 3398 | if ($v_header['checksum'] != $v_checksum) { |
3399 | - TrFctMessage(__FILE__, __LINE__, 2, "File checksum is invalid : $v_checksum calculated, " . $v_header['checksum'] . ' expected'); |
|
3399 | + TrFctMessage(__FILE__, __LINE__, 2, "File checksum is invalid : $v_checksum calculated, ".$v_header['checksum'].' expected'); |
|
3400 | 3400 | |
3401 | 3401 | $v_header['filename'] = ''; |
3402 | 3402 | $v_header['status'] = 'invalid_header'; |
@@ -3411,7 +3411,7 @@ discard block |
||
3411 | 3411 | } |
3412 | 3412 | |
3413 | 3413 | // ----- Error log |
3414 | - PclErrorLog(-13, "Invalid checksum : $v_checksum calculated, " . $v_header['checksum'] . ' expected'); |
|
3414 | + PclErrorLog(-13, "Invalid checksum : $v_checksum calculated, ".$v_header['checksum'].' expected'); |
|
3415 | 3415 | |
3416 | 3416 | // ----- Return |
3417 | 3417 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -3422,22 +3422,22 @@ discard block |
||
3422 | 3422 | |
3423 | 3423 | // ----- Extract the properties |
3424 | 3424 | $v_header['filename'] = trim($v_data['filename']); |
3425 | - TrFctMessage(__FILE__, __LINE__, 2, 'Name : ' . $v_header['filename'] . ''); |
|
3425 | + TrFctMessage(__FILE__, __LINE__, 2, 'Name : '.$v_header['filename'].''); |
|
3426 | 3426 | $v_header['mode'] = octdec(trim($v_data['mode'])); |
3427 | - TrFctMessage(__FILE__, __LINE__, 2, "Mode : '" . decoct($v_header['mode']) . "'"); |
|
3427 | + TrFctMessage(__FILE__, __LINE__, 2, "Mode : '".decoct($v_header['mode'])."'"); |
|
3428 | 3428 | $v_header['uid'] = octdec(trim($v_data['uid'])); |
3429 | - TrFctMessage(__FILE__, __LINE__, 2, "Uid : '" . $v_header['uid'] . "'"); |
|
3429 | + TrFctMessage(__FILE__, __LINE__, 2, "Uid : '".$v_header['uid']."'"); |
|
3430 | 3430 | $v_header['gid'] = octdec(trim($v_data['gid'])); |
3431 | - TrFctMessage(__FILE__, __LINE__, 2, "Gid : '" . $v_header['gid'] . "'"); |
|
3431 | + TrFctMessage(__FILE__, __LINE__, 2, "Gid : '".$v_header['gid']."'"); |
|
3432 | 3432 | $v_header['size'] = octdec(trim($v_data['size'])); |
3433 | - TrFctMessage(__FILE__, __LINE__, 2, "Size : '" . $v_header['size'] . "'"); |
|
3433 | + TrFctMessage(__FILE__, __LINE__, 2, "Size : '".$v_header['size']."'"); |
|
3434 | 3434 | $v_header['mtime'] = octdec(trim($v_data['mtime'])); |
3435 | - TrFctMessage(__FILE__, __LINE__, 2, 'Date : ' . date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
3435 | + TrFctMessage(__FILE__, __LINE__, 2, 'Date : '.date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
3436 | 3436 | if (($v_header['typeflag'] = $v_data['typeflag']) == '5') { |
3437 | 3437 | $v_header['size'] = 0; |
3438 | - TrFctMessage(__FILE__, __LINE__, 2, "Size (folder) : '" . $v_header['size'] . "'"); |
|
3438 | + TrFctMessage(__FILE__, __LINE__, 2, "Size (folder) : '".$v_header['size']."'"); |
|
3439 | 3439 | } |
3440 | - TrFctMessage(__FILE__, __LINE__, 2, 'File typeflag : ' . $v_header['typeflag'] . ''); |
|
3440 | + TrFctMessage(__FILE__, __LINE__, 2, 'File typeflag : '.$v_header['typeflag'].''); |
|
3441 | 3441 | /* ----- All these fields are removed form the header because they do not carry interesting info |
3442 | 3442 | $v_header[link] = trim($v_data[link]); |
3443 | 3443 | TrFctMessage(__FILE__, __LINE__, 2, "Linkname : $v_header[linkname]"); |
@@ -3617,7 +3617,7 @@ discard block |
||
3617 | 3617 | // ----- Ignore only the double '//' in path, |
3618 | 3618 | // but not the first and last '/' |
3619 | 3619 | } else { |
3620 | - $v_result = $v_list[$i] . ($i != (count($v_list) - 1) ? '/' . $v_result : ''); |
|
3620 | + $v_result = $v_list[$i].($i != (count($v_list) - 1) ? '/'.$v_result : ''); |
|
3621 | 3621 | } |
3622 | 3622 | } |
3623 | 3623 | } |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | // $p_level : Level of trace required. |
149 | 149 | // -------------------------------------------------------------------------------- |
150 | 150 | /** |
151 | - * @param $p_file |
|
152 | - * @param $p_line |
|
153 | - * @param $p_name |
|
151 | + * @param string $p_file |
|
152 | + * @param integer $p_line |
|
153 | + * @param string $p_name |
|
154 | 154 | * @param string $p_param |
155 | 155 | * @param string $p_message |
156 | 156 | */ |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | // $p_level : Level of trace required. |
221 | 221 | // -------------------------------------------------------------------------------- |
222 | 222 | /** |
223 | - * @param $p_file |
|
224 | - * @param $p_line |
|
223 | + * @param string $p_file |
|
224 | + * @param integer $p_line |
|
225 | 225 | * @param int $p_return |
226 | 226 | * @param string $p_message |
227 | 227 | */ |
@@ -290,9 +290,9 @@ discard block |
||
290 | 290 | // Parameters : |
291 | 291 | // -------------------------------------------------------------------------------- |
292 | 292 | /** |
293 | - * @param $p_file |
|
294 | - * @param $p_line |
|
295 | - * @param $p_level |
|
293 | + * @param string $p_file |
|
294 | + * @param integer $p_line |
|
295 | + * @param integer $p_level |
|
296 | 296 | * @param string $p_message |
297 | 297 | */ |
298 | 298 | function TrFctMessage($p_file, $p_line, $p_level, $p_message = "") |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | if (!isset($g_pcl_trace_name)) { |
171 | 171 | $g_pcl_trace_name = $p_name; |
172 | 172 | } else { |
173 | - $g_pcl_trace_name .= ',' . $p_name; |
|
173 | + $g_pcl_trace_name .= ','.$p_name; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | // ----- Update the function entry |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | echo '<tr>'; |
399 | 399 | echo '<td><table width=100% border=0 cellspacing=0 cellpadding=0><tr>'; |
400 | 400 | $n = ($g_pcl_trace_entries[$i]['index'] + 1) * 10; |
401 | - echo '<td width=' . $n . '><table width=100% border=0 cellspacing=0 cellpadding=0><tr>'; |
|
401 | + echo '<td width='.$n.'><table width=100% border=0 cellspacing=0 cellpadding=0><tr>'; |
|
402 | 402 | |
403 | 403 | for ($j = 0; $j <= $g_pcl_trace_entries[$i]['index']; ++$j) { |
404 | 404 | if ($j == $g_pcl_trace_entries[$i]['index']) { |
@@ -415,25 +415,25 @@ discard block |
||
415 | 415 | echo '<td width=2></td>'; |
416 | 416 | switch ($g_pcl_trace_entries[$i]['type']) { |
417 | 417 | case 1: |
418 | - echo "<td><span style='font-size: x-small; font-family: $v_font; '>" . $g_pcl_trace_entries[$i]['name'] . '(' . $g_pcl_trace_entries[$i]['param'] . ')</span></td>'; |
|
418 | + echo "<td><span style='font-size: x-small; font-family: $v_font; '>".$g_pcl_trace_entries[$i]['name'].'('.$g_pcl_trace_entries[$i]['param'].')</span></td>'; |
|
419 | 419 | break; |
420 | 420 | case 2: |
421 | - echo "<td><span style='font-size: x-small; font-family: $v_font; '>" . $g_pcl_trace_entries[$i]['name'] . '()=' . $g_pcl_trace_entries[$i]['param'] . '</span></td>'; |
|
421 | + echo "<td><span style='font-size: x-small; font-family: $v_font; '>".$g_pcl_trace_entries[$i]['name'].'()='.$g_pcl_trace_entries[$i]['param'].'</span></td>'; |
|
422 | 422 | break; |
423 | 423 | case 3: |
424 | 424 | case 4: |
425 | 425 | echo '<td><table width=100% border=0 cellspacing=0 cellpadding=0><td width=20></td><td>'; |
426 | - echo "<span style='font-size: x-small; font-family: $v_font; '>" . $g_pcl_trace_entries[$i]['message'] . '</span>'; |
|
426 | + echo "<span style='font-size: x-small; font-family: $v_font; '>".$g_pcl_trace_entries[$i]['message'].'</span>'; |
|
427 | 427 | echo '</td></table></td>'; |
428 | 428 | break; |
429 | 429 | default: |
430 | - echo "<td><span style='font-size: x-small; font-family: $v_font; '>" . $g_pcl_trace_entries[$i]['name'] . '(' . $g_pcl_trace_entries[$i]['param'] . ')</span></td>'; |
|
430 | + echo "<td><span style='font-size: x-small; font-family: $v_font; '>".$g_pcl_trace_entries[$i]['name'].'('.$g_pcl_trace_entries[$i]['param'].')</span></td>'; |
|
431 | 431 | } |
432 | 432 | echo '</tr></table></td>'; |
433 | 433 | echo '<td width=5></td>'; |
434 | - echo '<td><span style="font-size: xx-small; font-family: $v_font; ">' . basename($g_pcl_trace_entries[$i]['file']) . '</span></td>'; |
|
434 | + echo '<td><span style="font-size: xx-small; font-family: $v_font; ">'.basename($g_pcl_trace_entries[$i]['file']).'</span></td>'; |
|
435 | 435 | echo '<td width=5></td>'; |
436 | - echo '<td><span style="font-size: xx-small; font-family: $v_font; ">' . $g_pcl_trace_entries[$i]['line'] . '</span></td>'; |
|
436 | + echo '<td><span style="font-size: xx-small; font-family: $v_font; ">'.$g_pcl_trace_entries[$i]['line'].'</span></td>'; |
|
437 | 437 | echo '</tr>'; |
438 | 438 | } |
439 | 439 | |
@@ -477,12 +477,12 @@ discard block |
||
477 | 477 | echo '---'; |
478 | 478 | } |
479 | 479 | if ($p_entry['type'] == 1) { |
480 | - echo '<b>' . $p_entry['name'] . '</b>(' . $p_entry['param'] . ') : ' . $p_entry['message'] . ' [' . $p_entry['file'] . ', ' . $p_entry['line'] . ']<br>'; |
|
480 | + echo '<b>'.$p_entry['name'].'</b>('.$p_entry['param'].') : '.$p_entry['message'].' ['.$p_entry['file'].', '.$p_entry['line'].']<br>'; |
|
481 | 481 | } else { |
482 | 482 | if ($p_entry[type] == 2) { |
483 | - echo '<b>' . $p_entry['name'] . '</b>()=' . $p_entry['param'] . ' : ' . $p_entry['message'] . ' [' . $p_entry['file'] . ', ' . $p_entry['line'] . ']<br>'; |
|
483 | + echo '<b>'.$p_entry['name'].'</b>()='.$p_entry['param'].' : '.$p_entry['message'].' ['.$p_entry['file'].', '.$p_entry['line'].']<br>'; |
|
484 | 484 | } else { |
485 | - echo $p_entry['message'] . ' [' . $p_entry['file'] . ', ' . $p_entry['line'] . ']<br>'; |
|
485 | + echo $p_entry['message'].' ['.$p_entry['file'].', '.$p_entry['line'].']<br>'; |
|
486 | 486 | } |
487 | 487 | } |
488 | 488 | } |