@@ -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 |
@@ -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 |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | if (!is_file($p_tarname_add)) { |
| 839 | 839 | PclErrorLog(-4, "Archive '$p_tarname_add' does not exist"); |
| 840 | 840 | } else { |
| 841 | - PclErrorLog(-6, "Archive '$p_tarname_add' has invalid size " . filesize($p_tarname_add) . '(not a 512 block multiple)'); |
|
| 841 | + PclErrorLog(-6, "Archive '$p_tarname_add' has invalid size ".filesize($p_tarname_add).'(not a 512 block multiple)'); |
|
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | // ----- Return |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | // ----- Open a temporary file in write mode |
| 864 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
| 864 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
| 865 | 865 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
| 866 | 866 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
| 867 | 867 | // ----- Close tar file |
@@ -914,9 +914,9 @@ discard block |
||
| 914 | 914 | } |
| 915 | 915 | |
| 916 | 916 | // ----- Go to the beginning of last block |
| 917 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position before :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 917 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position before :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 918 | 918 | fseek($p_tar, $v_size - 512); |
| 919 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position after :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 919 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position after :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 920 | 920 | } // ----- Look for unknown type |
| 921 | 921 | else { |
| 922 | 922 | // ----- Error log |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | if (!is_file($p_tarname)) { |
| 1208 | 1208 | PclErrorLog(-4, "Archive '$p_tarname' does not exist"); |
| 1209 | 1209 | } else { |
| 1210 | - PclErrorLog(-6, "Archive '$p_tarname' has invalid size " . filesize($p_tarname) . '(not a 512 block multiple)'); |
|
| 1210 | + PclErrorLog(-6, "Archive '$p_tarname' has invalid size ".filesize($p_tarname).'(not a 512 block multiple)'); |
|
| 1211 | 1211 | } |
| 1212 | 1212 | |
| 1213 | 1213 | // ----- Return |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | // ----- Open a temporary file in write mode |
| 1233 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
| 1233 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
| 1234 | 1234 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
| 1235 | 1235 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
| 1236 | 1236 | // ----- Close tar file |
@@ -1315,9 +1315,9 @@ discard block |
||
| 1315 | 1315 | } |
| 1316 | 1316 | |
| 1317 | 1317 | // ----- Go to the beginning of last block |
| 1318 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position before :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1318 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position before :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1319 | 1319 | fseek($p_tar, $v_size - 512); |
| 1320 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position after :' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1320 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position after :'.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1321 | 1321 | |
| 1322 | 1322 | // ----- Call the adding fct inside the tar |
| 1323 | 1323 | if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir)) == 1) { |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | // ----- Check the parameters |
| 1385 | 1385 | if ($p_tar == 0) { |
| 1386 | 1386 | // ----- Error log |
| 1387 | - PclErrorLog(-3, 'Invalid file descriptor in file ' . __FILE__ . ', line ' . __LINE__); |
|
| 1387 | + PclErrorLog(-3, 'Invalid file descriptor in file '.__FILE__.', line '.__LINE__); |
|
| 1388 | 1388 | |
| 1389 | 1389 | // ----- Return |
| 1390 | 1390 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -1439,7 +1439,7 @@ discard block |
||
| 1439 | 1439 | return PclErrorCode(); |
| 1440 | 1440 | } |
| 1441 | 1441 | |
| 1442 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position before header =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1442 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position before header ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1443 | 1443 | |
| 1444 | 1444 | // ----- Add the file |
| 1445 | 1445 | if (($v_result = PclTarHandleAddFile($p_tar, $p_filename, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) { |
@@ -1459,7 +1459,7 @@ discard block |
||
| 1459 | 1459 | // ----- Look for path |
| 1460 | 1460 | $v_path = ''; |
| 1461 | 1461 | if ($p_filename !== '.') { |
| 1462 | - $v_path = $p_filename . '/'; |
|
| 1462 | + $v_path = $p_filename.'/'; |
|
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | 1465 | // ----- Read the directory for files and sub-directories |
@@ -1468,11 +1468,11 @@ discard block |
||
| 1468 | 1468 | $p_hitem = readdir($p_hdir); // '..' directory |
| 1469 | 1469 | while ($p_hitem = readdir($p_hdir)) { |
| 1470 | 1470 | // ----- Look for a file |
| 1471 | - if (is_file($v_path . $p_hitem)) { |
|
| 1472 | - TrFctMessage(__FILE__, __LINE__, 4, "Add the file '" . $v_path . $p_hitem . "'"); |
|
| 1471 | + if (is_file($v_path.$p_hitem)) { |
|
| 1472 | + TrFctMessage(__FILE__, __LINE__, 4, "Add the file '".$v_path.$p_hitem."'"); |
|
| 1473 | 1473 | |
| 1474 | 1474 | // ----- Add the file |
| 1475 | - if (($v_result = PclTarHandleAddFile($p_tar, $v_path . $p_hitem, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) { |
|
| 1475 | + if (($v_result = PclTarHandleAddFile($p_tar, $v_path.$p_hitem, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) { |
|
| 1476 | 1476 | // ----- Return status |
| 1477 | 1477 | TrFctEnd(__FILE__, __LINE__, $v_result); |
| 1478 | 1478 | |
@@ -1483,10 +1483,10 @@ discard block |
||
| 1483 | 1483 | $p_list_detail[$v_nb++] = $v_header; |
| 1484 | 1484 | } // ----- Recursive call to PclTarHandleAddFile() |
| 1485 | 1485 | else { |
| 1486 | - TrFctMessage(__FILE__, __LINE__, 4, "'" . $v_path . $p_hitem . "' is a directory"); |
|
| 1486 | + TrFctMessage(__FILE__, __LINE__, 4, "'".$v_path.$p_hitem."' is a directory"); |
|
| 1487 | 1487 | |
| 1488 | 1488 | // ----- Need an array as parameter |
| 1489 | - $p_temp_list[0] = $v_path . $p_hitem; |
|
| 1489 | + $p_temp_list[0] = $v_path.$p_hitem; |
|
| 1490 | 1490 | $v_result = PclTarHandleAddList($p_tar, $p_temp_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir); |
| 1491 | 1491 | } |
| 1492 | 1492 | } |
@@ -1494,7 +1494,7 @@ discard block |
||
| 1494 | 1494 | // ----- Free memory for the recursive loop |
| 1495 | 1495 | unset($p_temp_list, $p_hdir, $p_hitem); |
| 1496 | 1496 | } else { |
| 1497 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1497 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1498 | 1498 | } |
| 1499 | 1499 | } |
| 1500 | 1500 | |
@@ -1530,7 +1530,7 @@ discard block |
||
| 1530 | 1530 | // ----- Check the parameters |
| 1531 | 1531 | if ($p_tar == 0) { |
| 1532 | 1532 | // ----- Error log |
| 1533 | - PclErrorLog(-3, 'Invalid file descriptor in file ' . __FILE__ . ', line ' . __LINE__); |
|
| 1533 | + PclErrorLog(-3, 'Invalid file descriptor in file '.__FILE__.', line '.__LINE__); |
|
| 1534 | 1534 | |
| 1535 | 1535 | // ----- Return |
| 1536 | 1536 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -1558,7 +1558,7 @@ discard block |
||
| 1558 | 1558 | |
| 1559 | 1559 | if ((0 === strpos($p_filename, './')) || (0 === strpos($p_remove_dir, './'))) { |
| 1560 | 1560 | if ((0 === strpos($p_filename, './')) && (0 !== strpos($p_remove_dir, './'))) { |
| 1561 | - $p_remove_dir = './' . $p_remove_dir; |
|
| 1561 | + $p_remove_dir = './'.$p_remove_dir; |
|
| 1562 | 1562 | } |
| 1563 | 1563 | if ((0 !== strpos($p_filename, './')) && (0 === strpos($p_remove_dir, './'))) { |
| 1564 | 1564 | $p_remove_dir = substr($p_remove_dir, 2); |
@@ -1572,9 +1572,9 @@ discard block |
||
| 1572 | 1572 | } |
| 1573 | 1573 | if ($p_add_dir != '') { |
| 1574 | 1574 | if (substr($p_add_dir, -1) === '/') { |
| 1575 | - $v_stored_filename = $p_add_dir . $v_stored_filename; |
|
| 1575 | + $v_stored_filename = $p_add_dir.$v_stored_filename; |
|
| 1576 | 1576 | } else { |
| 1577 | - $v_stored_filename = $p_add_dir . '/' . $v_stored_filename; |
|
| 1577 | + $v_stored_filename = $p_add_dir.'/'.$v_stored_filename; |
|
| 1578 | 1578 | } |
| 1579 | 1579 | TrFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'"); |
| 1580 | 1580 | } |
@@ -1611,7 +1611,7 @@ discard block |
||
| 1611 | 1611 | return $v_result; |
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after header =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1614 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after header ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1615 | 1615 | |
| 1616 | 1616 | // ----- Read the file by 512 octets blocks |
| 1617 | 1617 | $i = 0; |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | // ----- Close the file |
| 1630 | 1630 | fclose($v_file); |
| 1631 | 1631 | |
| 1632 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1632 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after blocks ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1633 | 1633 | } // ----- Look for a directory |
| 1634 | 1634 | else { |
| 1635 | 1635 | // ----- Call the header generation |
@@ -1640,7 +1640,7 @@ discard block |
||
| 1640 | 1640 | return $v_result; |
| 1641 | 1641 | } |
| 1642 | 1642 | |
| 1643 | - TrFctMessage(__FILE__, __LINE__, 4, 'File position after header =' . ($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1643 | + TrFctMessage(__FILE__, __LINE__, 4, 'File position after header ='.($p_mode === 'tar' ? ftell($p_tar) : gztell($p_tar))); |
|
| 1644 | 1644 | } |
| 1645 | 1645 | |
| 1646 | 1646 | // ----- Return |
@@ -1687,7 +1687,7 @@ discard block |
||
| 1687 | 1687 | // ----- Check the parameters |
| 1688 | 1688 | if (($p_tar == 0) || ($p_filename == '')) { |
| 1689 | 1689 | // ----- Error log |
| 1690 | - PclErrorLog(-3, 'Invalid file descriptor in file ' . __FILE__ . ', line ' . __LINE__); |
|
| 1690 | + PclErrorLog(-3, 'Invalid file descriptor in file '.__FILE__.', line '.__LINE__); |
|
| 1691 | 1691 | |
| 1692 | 1692 | // ----- Return |
| 1693 | 1693 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -1700,7 +1700,7 @@ discard block |
||
| 1700 | 1700 | $p_stored_filename = $p_filename; |
| 1701 | 1701 | } |
| 1702 | 1702 | $v_reduce_filename = PclTarHandlePathReduction($p_stored_filename); |
| 1703 | - TrFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_reduce_filename', strlen " . strlen($v_reduce_filename)); |
|
| 1703 | + TrFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_reduce_filename', strlen ".strlen($v_reduce_filename)); |
|
| 1704 | 1704 | |
| 1705 | 1705 | // ----- Get file info |
| 1706 | 1706 | $v_info = stat($p_filename); |
@@ -1901,7 +1901,7 @@ discard block |
||
| 1901 | 1901 | // ----- Check the path |
| 1902 | 1902 | //if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../"))) |
| 1903 | 1903 | if ($p_path == '') { |
| 1904 | - $p_path = './' . $p_path; |
|
| 1904 | + $p_path = './'.$p_path; |
|
| 1905 | 1905 | } |
| 1906 | 1906 | |
| 1907 | 1907 | // ----- Look for path to remove format (should end by /) |
@@ -1996,28 +1996,28 @@ discard block |
||
| 1996 | 1996 | continue; |
| 1997 | 1997 | } |
| 1998 | 1998 | |
| 1999 | - TrFctMessage(__FILE__, __LINE__, 2, "Found file '" . $v_header['filename'] . "', size '" . $v_header['size'] . "'"); |
|
| 1999 | + TrFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); |
|
| 2000 | 2000 | |
| 2001 | 2001 | // ----- Look for partial extract |
| 2002 | 2002 | if ((!$v_extract_all) && is_array($p_file_list)) { |
| 2003 | - TrFctMessage(__FILE__, __LINE__, 2, 'Look if the file ' . $v_header['filename'] . ' need to be extracted'); |
|
| 2003 | + TrFctMessage(__FILE__, __LINE__, 2, 'Look if the file '.$v_header['filename'].' need to be extracted'); |
|
| 2004 | 2004 | |
| 2005 | 2005 | // ----- By default no unzip if the file is not found |
| 2006 | 2006 | $v_extract_file = false; |
| 2007 | 2007 | |
| 2008 | 2008 | // ----- Look into the file list |
| 2009 | 2009 | for ($i = 0, $iMax = count($p_file_list); $i < $iMax; ++$i) { |
| 2010 | - TrFctMessage(__FILE__, __LINE__, 2, 'Compare archived file ' . $v_header['filename'] . " from asked list file '" . $p_file_list[$i] . "'"); |
|
| 2010 | + TrFctMessage(__FILE__, __LINE__, 2, 'Compare archived file '.$v_header['filename']." from asked list file '".$p_file_list[$i]."'"); |
|
| 2011 | 2011 | |
| 2012 | 2012 | // ----- Look if it is a directory |
| 2013 | 2013 | if (substr($p_file_list[$i], -1) === '/') { |
| 2014 | - TrFctMessage(__FILE__, __LINE__, 3, 'Compare file ' . $v_header['filename'] . " with directory '$p_file_list[$i]'"); |
|
| 2014 | + TrFctMessage(__FILE__, __LINE__, 3, 'Compare file '.$v_header['filename']." with directory '$p_file_list[$i]'"); |
|
| 2015 | 2015 | |
| 2016 | 2016 | // ----- Look if the directory is in the filename path |
| 2017 | 2017 | if ((strlen($v_header['filename']) > strlen($p_file_list[$i])) |
| 2018 | 2018 | && (0 === strpos($v_header['filename'], $p_file_list[$i]))) { |
| 2019 | 2019 | // ----- The file is in the directory, so extract it |
| 2020 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . " is in directory '$p_file_list[$i]' : extract it"); |
|
| 2020 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename']." is in directory '$p_file_list[$i]' : extract it"); |
|
| 2021 | 2021 | $v_extract_file = true; |
| 2022 | 2022 | |
| 2023 | 2023 | // ----- End of loop |
@@ -2027,7 +2027,7 @@ discard block |
||
| 2027 | 2027 | else { |
| 2028 | 2028 | if ($p_file_list[$i] == $v_header['filename']) { |
| 2029 | 2029 | // ----- File found |
| 2030 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' should be extracted'); |
|
| 2030 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' should be extracted'); |
|
| 2031 | 2031 | $v_extract_file = true; |
| 2032 | 2032 | |
| 2033 | 2033 | // ----- End of loop |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | |
| 2039 | 2039 | // ----- Trace |
| 2040 | 2040 | if (!$v_extract_file) { |
| 2041 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' should not be extracted'); |
|
| 2041 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' should not be extracted'); |
|
| 2042 | 2042 | } |
| 2043 | 2043 | } else { |
| 2044 | 2044 | // ----- All files need to be extracted |
@@ -2049,10 +2049,10 @@ discard block |
||
| 2049 | 2049 | if ($v_extract_file && (!$v_listing)) { |
| 2050 | 2050 | // ----- Look for path to remove |
| 2051 | 2051 | if (($p_remove_path != '') && (0 === strpos($v_header['filename'], $p_remove_path))) { |
| 2052 | - TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file " . $v_header['filename'] . ''); |
|
| 2052 | + TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file ".$v_header['filename'].''); |
|
| 2053 | 2053 | // ----- Remove the path |
| 2054 | 2054 | $v_header['filename'] = substr($v_header['filename'], $p_remove_path_size); |
| 2055 | - TrFctMessage(__FILE__, __LINE__, 3, 'Reslting file is ' . $v_header['filename'] . ''); |
|
| 2055 | + TrFctMessage(__FILE__, __LINE__, 3, 'Reslting file is '.$v_header['filename'].''); |
|
| 2056 | 2056 | } |
| 2057 | 2057 | |
| 2058 | 2058 | // ----- Add the path to the file |
@@ -2066,22 +2066,22 @@ discard block |
||
| 2066 | 2066 | |
| 2067 | 2067 | // ----- Add the path |
| 2068 | 2068 | if (0 === strpos($v_header['filename'], '/')) { |
| 2069 | - $v_header['filename'] = $p_path . $v_header['filename']; |
|
| 2069 | + $v_header['filename'] = $p_path.$v_header['filename']; |
|
| 2070 | 2070 | } else { |
| 2071 | - $v_header['filename'] = $p_path . '/' . $v_header['filename']; |
|
| 2071 | + $v_header['filename'] = $p_path.'/'.$v_header['filename']; |
|
| 2072 | 2072 | } |
| 2073 | 2073 | } |
| 2074 | 2074 | |
| 2075 | 2075 | // ----- Trace |
| 2076 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
| 2076 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
| 2077 | 2077 | |
| 2078 | 2078 | // ----- Check that the file does not exists |
| 2079 | 2079 | if (file_exists($v_header['filename'])) { |
| 2080 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' already exists'); |
|
| 2080 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' already exists'); |
|
| 2081 | 2081 | |
| 2082 | 2082 | // ----- Look if file is a directory |
| 2083 | 2083 | if (is_dir($v_header['filename'])) { |
| 2084 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is a directory'); |
|
| 2084 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is a directory'); |
|
| 2085 | 2085 | |
| 2086 | 2086 | // ----- Change the file status |
| 2087 | 2087 | $v_header['status'] = 'already_a_directory'; |
@@ -2092,7 +2092,7 @@ discard block |
||
| 2092 | 2092 | } // ----- Look if file is write protected |
| 2093 | 2093 | else { |
| 2094 | 2094 | if (!s_writable($v_header['filename'])) { |
| 2095 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is write protected'); |
|
| 2095 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is write protected'); |
|
| 2096 | 2096 | |
| 2097 | 2097 | // ----- Change the file status |
| 2098 | 2098 | $v_header['status'] = 'write_protected'; |
@@ -2126,7 +2126,7 @@ discard block |
||
| 2126 | 2126 | } |
| 2127 | 2127 | |
| 2128 | 2128 | if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1) { |
| 2129 | - TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for ' . $v_header['filename'] . ''); |
|
| 2129 | + TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for '.$v_header['filename'].''); |
|
| 2130 | 2130 | |
| 2131 | 2131 | // ----- Change the file status |
| 2132 | 2132 | $v_header['status'] = 'path_creation_fail'; |
@@ -2141,7 +2141,7 @@ discard block |
||
| 2141 | 2141 | if ($v_extract_file && ($v_header['typeflag'] != '5')) { |
| 2142 | 2142 | // ----- Open the destination file in write mode |
| 2143 | 2143 | if (($v_dest_file = @fopen($v_header['filename'], 'wb')) == 0) { |
| 2144 | - TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode'); |
|
| 2144 | + TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening '.$v_header['filename'].' in write binary mode'); |
|
| 2145 | 2145 | |
| 2146 | 2146 | // ----- Change the file status |
| 2147 | 2147 | $v_header['status'] = 'write_error'; |
@@ -2154,12 +2154,12 @@ discard block |
||
| 2154 | 2154 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
| 2155 | 2155 | } |
| 2156 | 2156 | } else { |
| 2157 | - TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of ' . $v_header['filename'] . ''); |
|
| 2157 | + TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of '.$v_header['filename'].''); |
|
| 2158 | 2158 | |
| 2159 | 2159 | // ----- Read data |
| 2160 | 2160 | $n = floor($v_header['size'] / 512); |
| 2161 | 2161 | for ($i = 0; $i < $n; ++$i) { |
| 2162 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($i + 1)); |
|
| 2162 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($i + 1)); |
|
| 2163 | 2163 | if ($p_tar_mode === 'tar') { |
| 2164 | 2164 | $v_content = fread($v_tar, 512); |
| 2165 | 2165 | } else { |
@@ -2168,7 +2168,7 @@ discard block |
||
| 2168 | 2168 | fwrite($v_dest_file, $v_content, 512); |
| 2169 | 2169 | } |
| 2170 | 2170 | if (($v_header['size'] % 512) != 0) { |
| 2171 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read last ' . ($v_header['size'] % 512) . ' bytes in a 512 block'); |
|
| 2171 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read last '.($v_header['size'] % 512).' bytes in a 512 block'); |
|
| 2172 | 2172 | if ($p_tar_mode === 'tar') { |
| 2173 | 2173 | $v_content = fread($v_tar, 512); |
| 2174 | 2174 | } else { |
@@ -2196,7 +2196,7 @@ discard block |
||
| 2196 | 2196 | } |
| 2197 | 2197 | |
| 2198 | 2198 | // ----- Error log |
| 2199 | - 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."); |
|
| 2199 | + 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."); |
|
| 2200 | 2200 | |
| 2201 | 2201 | // ----- Return |
| 2202 | 2202 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -2207,7 +2207,7 @@ discard block |
||
| 2207 | 2207 | // ----- Trace |
| 2208 | 2208 | TrFctMessage(__FILE__, __LINE__, 2, 'Extraction done'); |
| 2209 | 2209 | } else { |
| 2210 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file ' . $v_header['filename'] . ' skipped.'); |
|
| 2210 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file '.$v_header['filename'].' skipped.'); |
|
| 2211 | 2211 | |
| 2212 | 2212 | // ----- Jump to next file |
| 2213 | 2213 | TrFctMessage(__FILE__, __LINE__, 2, 'Jump to next file'); |
@@ -2220,8 +2220,8 @@ discard block |
||
| 2220 | 2220 | } // ----- Look for file that is not to be unzipped |
| 2221 | 2221 | else { |
| 2222 | 2222 | // ----- Trace |
| 2223 | - TrFctMessage(__FILE__, __LINE__, 2, 'Jump file ' . $v_header['filename'] . ''); |
|
| 2224 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
| 2223 | + TrFctMessage(__FILE__, __LINE__, 2, 'Jump file '.$v_header['filename'].''); |
|
| 2224 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
| 2225 | 2225 | |
| 2226 | 2226 | // ----- Jump to next file |
| 2227 | 2227 | if ($p_tar_mode === 'tar') { |
@@ -2230,7 +2230,7 @@ discard block |
||
| 2230 | 2230 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
| 2231 | 2231 | } |
| 2232 | 2232 | |
| 2233 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
| 2233 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
| 2234 | 2234 | } |
| 2235 | 2235 | |
| 2236 | 2236 | if ($p_tar_mode === 'tar') { |
@@ -2241,7 +2241,7 @@ discard block |
||
| 2241 | 2241 | |
| 2242 | 2242 | // ----- File name and properties are logged if listing mode or file is extracted |
| 2243 | 2243 | if ($v_listing || $v_extract_file || $v_extraction_stopped) { |
| 2244 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
| 2244 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
| 2245 | 2245 | |
| 2246 | 2246 | // ----- Log extracted files |
| 2247 | 2247 | if (($v_file_dir = dirname($v_header['filename'])) == $v_header['filename']) { |
@@ -2315,7 +2315,7 @@ discard block |
||
| 2315 | 2315 | if (($p_path === '') |
| 2316 | 2316 | || ((0 !== strpos($p_path, '/')) && (0 !== strpos($p_path, '../')) |
| 2317 | 2317 | && (0 !== strpos($p_path, './')))) { |
| 2318 | - $p_path = './' . $p_path; |
|
| 2318 | + $p_path = './'.$p_path; |
|
| 2319 | 2319 | } |
| 2320 | 2320 | |
| 2321 | 2321 | // ----- Look for path to remove format (should end by /) |
@@ -2462,14 +2462,14 @@ discard block |
||
| 2462 | 2462 | continue; |
| 2463 | 2463 | } |
| 2464 | 2464 | |
| 2465 | - TrFctMessage(__FILE__, __LINE__, 2, 'Found file ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
| 2465 | + TrFctMessage(__FILE__, __LINE__, 2, 'Found file '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
| 2466 | 2466 | |
| 2467 | 2467 | // ----- Look if file is in the range to be extracted |
| 2468 | 2468 | if (($p_index_current >= $p_index_start) && ($p_index_current <= $p_index_stop)) { |
| 2469 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' is in the range to be extracted'); |
|
| 2469 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' is in the range to be extracted'); |
|
| 2470 | 2470 | $v_extract_file = true; |
| 2471 | 2471 | } else { |
| 2472 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' is out of the range'); |
|
| 2472 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' is out of the range'); |
|
| 2473 | 2473 | $v_extract_file = false; |
| 2474 | 2474 | } |
| 2475 | 2475 | |
@@ -2484,8 +2484,8 @@ discard block |
||
| 2484 | 2484 | } // ----- Look for file that is not to be extracted |
| 2485 | 2485 | else { |
| 2486 | 2486 | // ----- Trace |
| 2487 | - TrFctMessage(__FILE__, __LINE__, 2, 'Jump file ' . $v_header['filename'] . ''); |
|
| 2488 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
| 2487 | + TrFctMessage(__FILE__, __LINE__, 2, 'Jump file '.$v_header['filename'].''); |
|
| 2488 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
| 2489 | 2489 | |
| 2490 | 2490 | // ----- Jump to next file |
| 2491 | 2491 | if ($p_tar_mode === 'tar') { |
@@ -2494,7 +2494,7 @@ discard block |
||
| 2494 | 2494 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
| 2495 | 2495 | } |
| 2496 | 2496 | |
| 2497 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
| 2497 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
| 2498 | 2498 | } |
| 2499 | 2499 | |
| 2500 | 2500 | if ($p_tar_mode === 'tar') { |
@@ -2505,7 +2505,7 @@ discard block |
||
| 2505 | 2505 | |
| 2506 | 2506 | // ----- File name and properties are logged if listing mode or file is extracted |
| 2507 | 2507 | if ($v_extract_file) { |
| 2508 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
| 2508 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
| 2509 | 2509 | |
| 2510 | 2510 | // ----- Log extracted files |
| 2511 | 2511 | if (($v_file_dir = dirname($v_header['filename'])) == $v_header['filename']) { |
@@ -2562,10 +2562,10 @@ discard block |
||
| 2562 | 2562 | |
| 2563 | 2563 | // ----- Look for path to remove |
| 2564 | 2564 | if (($p_remove_path != '') && (0 === strpos($v_header['filename'], $p_remove_path))) { |
| 2565 | - TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file " . $v_header['filename'] . ''); |
|
| 2565 | + TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file ".$v_header['filename'].''); |
|
| 2566 | 2566 | // ----- Remove the path |
| 2567 | 2567 | $v_header['filename'] = substr($v_header['filename'], $p_remove_path_size); |
| 2568 | - TrFctMessage(__FILE__, __LINE__, 3, 'Resulting file is ' . $v_header['filename'] . ''); |
|
| 2568 | + TrFctMessage(__FILE__, __LINE__, 3, 'Resulting file is '.$v_header['filename'].''); |
|
| 2569 | 2569 | } |
| 2570 | 2570 | |
| 2571 | 2571 | // ----- Add the path to the file |
@@ -2579,22 +2579,22 @@ discard block |
||
| 2579 | 2579 | |
| 2580 | 2580 | // ----- Add the path |
| 2581 | 2581 | if (0 === strpos($v_header['filename'], '/')) { |
| 2582 | - $v_header['filename'] = $p_path . $v_header['filename']; |
|
| 2582 | + $v_header['filename'] = $p_path.$v_header['filename']; |
|
| 2583 | 2583 | } else { |
| 2584 | - $v_header['filename'] = $p_path . '/' . $v_header['filename']; |
|
| 2584 | + $v_header['filename'] = $p_path.'/'.$v_header['filename']; |
|
| 2585 | 2585 | } |
| 2586 | 2586 | } |
| 2587 | 2587 | |
| 2588 | 2588 | // ----- Trace |
| 2589 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
| 2589 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extracting file (with path) '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
| 2590 | 2590 | |
| 2591 | 2591 | // ----- Check that the file does not exists |
| 2592 | 2592 | if (file_exists($v_header['filename'])) { |
| 2593 | - TrFctMessage(__FILE__, __LINE__, 2, 'File ' . $v_header['filename'] . ' already exists'); |
|
| 2593 | + TrFctMessage(__FILE__, __LINE__, 2, 'File '.$v_header['filename'].' already exists'); |
|
| 2594 | 2594 | |
| 2595 | 2595 | // ----- Look if file is a directory |
| 2596 | 2596 | if (is_dir($v_header['filename'])) { |
| 2597 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is a directory'); |
|
| 2597 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is a directory'); |
|
| 2598 | 2598 | |
| 2599 | 2599 | // ----- Change the file status |
| 2600 | 2600 | $v_header['status'] = 'already_a_directory'; |
@@ -2605,7 +2605,7 @@ discard block |
||
| 2605 | 2605 | } // ----- Look if file is write protected |
| 2606 | 2606 | else { |
| 2607 | 2607 | if (!s_writable($v_header['filename'])) { |
| 2608 | - TrFctMessage(__FILE__, __LINE__, 2, 'Existing file ' . $v_header['filename'] . ' is write protected'); |
|
| 2608 | + TrFctMessage(__FILE__, __LINE__, 2, 'Existing file '.$v_header['filename'].' is write protected'); |
|
| 2609 | 2609 | |
| 2610 | 2610 | // ----- Change the file status |
| 2611 | 2611 | $v_header['status'] = 'write_protected'; |
@@ -2616,7 +2616,7 @@ discard block |
||
| 2616 | 2616 | } // ----- Look if the extracted file is older |
| 2617 | 2617 | else { |
| 2618 | 2618 | if (filemtime($v_header['filename']) > $v_header['mtime']) { |
| 2619 | - TrFctMessage(__FILE__, __LINE__, 2, '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']) . ')'); |
|
| 2619 | + TrFctMessage(__FILE__, __LINE__, 2, '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']).')'); |
|
| 2620 | 2620 | |
| 2621 | 2621 | // ----- Change the file status |
| 2622 | 2622 | $v_header['status'] = 'newer_exist'; |
@@ -2640,7 +2640,7 @@ discard block |
||
| 2640 | 2640 | } |
| 2641 | 2641 | |
| 2642 | 2642 | if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1) { |
| 2643 | - TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for ' . $v_header['filename'] . ''); |
|
| 2643 | + TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for '.$v_header['filename'].''); |
|
| 2644 | 2644 | |
| 2645 | 2645 | // ----- Change the file status |
| 2646 | 2646 | $v_header['status'] = 'path_creation_fail'; |
@@ -2655,7 +2655,7 @@ discard block |
||
| 2655 | 2655 | if ($v_extract_file && ($v_header['typeflag'] != '5')) { |
| 2656 | 2656 | // ----- Open the destination file in write mode |
| 2657 | 2657 | if (($v_dest_file = @fopen($v_header['filename'], 'wb')) == 0) { |
| 2658 | - TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode'); |
|
| 2658 | + TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening '.$v_header['filename'].' in write binary mode'); |
|
| 2659 | 2659 | |
| 2660 | 2660 | // ----- Change the file status |
| 2661 | 2661 | $v_header['status'] = 'write_error'; |
@@ -2668,12 +2668,12 @@ discard block |
||
| 2668 | 2668 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
| 2669 | 2669 | } |
| 2670 | 2670 | } else { |
| 2671 | - TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of ' . $v_header['filename'] . ''); |
|
| 2671 | + TrFctMessage(__FILE__, __LINE__, 2, 'Start extraction of '.$v_header['filename'].''); |
|
| 2672 | 2672 | |
| 2673 | 2673 | // ----- Read data |
| 2674 | 2674 | $n = floor($v_header['size'] / 512); |
| 2675 | 2675 | for ($i = 0; $i < $n; ++$i) { |
| 2676 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($i + 1)); |
|
| 2676 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($i + 1)); |
|
| 2677 | 2677 | if ($p_tar_mode === 'tar') { |
| 2678 | 2678 | $v_content = fread($v_tar, 512); |
| 2679 | 2679 | } else { |
@@ -2682,7 +2682,7 @@ discard block |
||
| 2682 | 2682 | fwrite($v_dest_file, $v_content, 512); |
| 2683 | 2683 | } |
| 2684 | 2684 | if (($v_header['size'] % 512) != 0) { |
| 2685 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read last ' . ($v_header['size'] % 512) . ' bytes in a 512 block'); |
|
| 2685 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read last '.($v_header['size'] % 512).' bytes in a 512 block'); |
|
| 2686 | 2686 | if ($p_tar_mode === 'tar') { |
| 2687 | 2687 | $v_content = fread($v_tar, 512); |
| 2688 | 2688 | } else { |
@@ -2703,7 +2703,7 @@ discard block |
||
| 2703 | 2703 | clearstatcache(); |
| 2704 | 2704 | if (filesize($v_header['filename']) != $v_header['size']) { |
| 2705 | 2705 | // ----- Error log |
| 2706 | - 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."); |
|
| 2706 | + 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."); |
|
| 2707 | 2707 | |
| 2708 | 2708 | // ----- Return |
| 2709 | 2709 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -2714,7 +2714,7 @@ discard block |
||
| 2714 | 2714 | // ----- Trace |
| 2715 | 2715 | TrFctMessage(__FILE__, __LINE__, 2, 'Extraction done'); |
| 2716 | 2716 | } else { |
| 2717 | - TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file ' . $v_header['filename'] . ' skipped.'); |
|
| 2717 | + TrFctMessage(__FILE__, __LINE__, 2, 'Extraction of file '.$v_header['filename'].' skipped.'); |
|
| 2718 | 2718 | |
| 2719 | 2719 | // ----- Jump to next file |
| 2720 | 2720 | TrFctMessage(__FILE__, __LINE__, 2, 'Jump to next file'); |
@@ -2768,7 +2768,7 @@ discard block |
||
| 2768 | 2768 | } |
| 2769 | 2769 | |
| 2770 | 2770 | // ----- Open a temporary file in write mode |
| 2771 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
| 2771 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
| 2772 | 2772 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
| 2773 | 2773 | if (($v_temp_tar = @fopen($v_temp_tarname, 'wb')) == 0) { |
| 2774 | 2774 | // ----- Close tar file |
@@ -2797,7 +2797,7 @@ discard block |
||
| 2797 | 2797 | } |
| 2798 | 2798 | |
| 2799 | 2799 | // ----- Open a temporary file in write mode |
| 2800 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
| 2800 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
| 2801 | 2801 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
| 2802 | 2802 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
| 2803 | 2803 | // ----- Close tar file |
@@ -2854,7 +2854,7 @@ discard block |
||
| 2854 | 2854 | continue; |
| 2855 | 2855 | } |
| 2856 | 2856 | |
| 2857 | - TrFctMessage(__FILE__, __LINE__, 2, 'Found file ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
| 2857 | + TrFctMessage(__FILE__, __LINE__, 2, 'Found file '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
| 2858 | 2858 | |
| 2859 | 2859 | // ----- Look for filenames to delete |
| 2860 | 2860 | for ($i = 0, $v_delete_file = false; ($i < count($p_file_list)) && (!$v_delete_file); ++$i) { |
@@ -2862,12 +2862,12 @@ discard block |
||
| 2862 | 2862 | // if ($p_file_list[$i] == $v_header['filename']) |
| 2863 | 2863 | if (($v_len = strcmp($p_file_list[$i], $v_header['filename'])) <= 0) { |
| 2864 | 2864 | if ($v_len == 0) { |
| 2865 | - TrFctMessage(__FILE__, __LINE__, 3, 'Found that ' . $v_header['filename'] . ' need to be deleted'); |
|
| 2865 | + TrFctMessage(__FILE__, __LINE__, 3, 'Found that '.$v_header['filename'].' need to be deleted'); |
|
| 2866 | 2866 | $v_delete_file = true; |
| 2867 | 2867 | } else { |
| 2868 | - TrFctMessage(__FILE__, __LINE__, 3, 'Look if ' . $v_header['filename'] . " is a file in $p_file_list[$i]"); |
|
| 2868 | + TrFctMessage(__FILE__, __LINE__, 3, 'Look if '.$v_header['filename']." is a file in $p_file_list[$i]"); |
|
| 2869 | 2869 | if (substr($v_header['filename'], strlen($p_file_list[$i]), 1) === '/') { |
| 2870 | - TrFctMessage(__FILE__, __LINE__, 3, '' . $v_header['filename'] . " is a file in $p_file_list[$i]"); |
|
| 2870 | + TrFctMessage(__FILE__, __LINE__, 3, ''.$v_header['filename']." is a file in $p_file_list[$i]"); |
|
| 2871 | 2871 | $v_delete_file = true; |
| 2872 | 2872 | } |
| 2873 | 2873 | } |
@@ -2876,7 +2876,7 @@ discard block |
||
| 2876 | 2876 | |
| 2877 | 2877 | // ----- Copy files that do not need to be deleted |
| 2878 | 2878 | if (!$v_delete_file) { |
| 2879 | - TrFctMessage(__FILE__, __LINE__, 2, 'Keep file ' . $v_header['filename'] . ''); |
|
| 2879 | + TrFctMessage(__FILE__, __LINE__, 2, 'Keep file '.$v_header['filename'].''); |
|
| 2880 | 2880 | |
| 2881 | 2881 | // ----- Write the file header |
| 2882 | 2882 | if ($p_tar_mode === 'tar') { |
@@ -2888,7 +2888,7 @@ discard block |
||
| 2888 | 2888 | // ----- Write the file data |
| 2889 | 2889 | $n = ceil($v_header['size'] / 512); |
| 2890 | 2890 | for ($i = 0; $i < $n; ++$i) { |
| 2891 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($i + 1)); |
|
| 2891 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($i + 1)); |
|
| 2892 | 2892 | if ($p_tar_mode === 'tar') { |
| 2893 | 2893 | $v_content = fread($v_tar, 512); |
| 2894 | 2894 | fwrite($v_temp_tar, $v_content, 512); |
@@ -2899,7 +2899,7 @@ discard block |
||
| 2899 | 2899 | } |
| 2900 | 2900 | |
| 2901 | 2901 | // ----- File name and properties are logged if listing mode or file is extracted |
| 2902 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
| 2902 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
| 2903 | 2903 | |
| 2904 | 2904 | // ----- Add the array describing the file into the list |
| 2905 | 2905 | $p_list_detail[$v_nb] = $v_header; |
@@ -2910,8 +2910,8 @@ discard block |
||
| 2910 | 2910 | } // ----- Look for file that is to be deleted |
| 2911 | 2911 | else { |
| 2912 | 2912 | // ----- Trace |
| 2913 | - TrFctMessage(__FILE__, __LINE__, 2, 'Start deletion of ' . $v_header['filename'] . ''); |
|
| 2914 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
| 2913 | + TrFctMessage(__FILE__, __LINE__, 2, 'Start deletion of '.$v_header['filename'].''); |
|
| 2914 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position avant jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
| 2915 | 2915 | |
| 2916 | 2916 | // ----- Jump to next file |
| 2917 | 2917 | if ($p_tar_mode === 'tar') { |
@@ -2920,7 +2920,7 @@ discard block |
||
| 2920 | 2920 | gzseek($v_tar, gztell($v_tar) + (ceil($v_header['size'] / 512) * 512)); |
| 2921 | 2921 | } |
| 2922 | 2922 | |
| 2923 | - TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump [' . ($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)) . ']'); |
|
| 2923 | + TrFctMessage(__FILE__, __LINE__, 4, 'Position après jump ['.($p_tar_mode === 'tar' ? ftell($v_tar) : gztell($v_tar)).']'); |
|
| 2924 | 2924 | } |
| 2925 | 2925 | |
| 2926 | 2926 | // ----- Look for end of file |
@@ -3006,7 +3006,7 @@ discard block |
||
| 3006 | 3006 | } |
| 3007 | 3007 | |
| 3008 | 3008 | // ----- Open a temporary file in write mode |
| 3009 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
| 3009 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
| 3010 | 3010 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
| 3011 | 3011 | if (($v_temp_tar = @fopen($v_temp_tarname, 'wb')) == 0) { |
| 3012 | 3012 | // ----- Close tar file |
@@ -3035,7 +3035,7 @@ discard block |
||
| 3035 | 3035 | } |
| 3036 | 3036 | |
| 3037 | 3037 | // ----- Open a temporary file in write mode |
| 3038 | - $v_temp_tarname = uniqid('pcltar-', true) . '.tmp'; |
|
| 3038 | + $v_temp_tarname = uniqid('pcltar-', true).'.tmp'; |
|
| 3039 | 3039 | TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); |
| 3040 | 3040 | if (($v_temp_tar = @gzopen($v_temp_tarname, 'wb')) == 0) { |
| 3041 | 3041 | // ----- Close tar file |
@@ -3070,9 +3070,9 @@ discard block |
||
| 3070 | 3070 | } |
| 3071 | 3071 | if ($p_add_dir != '') { |
| 3072 | 3072 | if (substr($p_add_dir, -1) === '/') { |
| 3073 | - $v_stored_list[$i] = $p_add_dir . $v_stored_list[$i]; |
|
| 3073 | + $v_stored_list[$i] = $p_add_dir.$v_stored_list[$i]; |
|
| 3074 | 3074 | } else { |
| 3075 | - $v_stored_list[$i] = $p_add_dir . '/' . $v_stored_list[$i]; |
|
| 3075 | + $v_stored_list[$i] = $p_add_dir.'/'.$v_stored_list[$i]; |
|
| 3076 | 3076 | } |
| 3077 | 3077 | TrFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_file_list[$i]' = '$v_stored_list[$i]'"); |
| 3078 | 3078 | } |
@@ -3127,7 +3127,7 @@ discard block |
||
| 3127 | 3127 | continue; |
| 3128 | 3128 | } |
| 3129 | 3129 | |
| 3130 | - TrFctMessage(__FILE__, __LINE__, 2, 'Found file ' . $v_header['filename'] . ", size '" . $v_header['size'] . "'"); |
|
| 3130 | + TrFctMessage(__FILE__, __LINE__, 2, 'Found file '.$v_header['filename'].", size '".$v_header['size']."'"); |
|
| 3131 | 3131 | |
| 3132 | 3132 | // ----- Look for filenames to update |
| 3133 | 3133 | for ($i = 0, $v_update_file = false, $v_found_file = false; ($i < count($v_stored_list)) && (!$v_update_file); ++$i) { |
@@ -3136,8 +3136,8 @@ discard block |
||
| 3136 | 3136 | // ----- Compare the file names |
| 3137 | 3137 | if ($v_stored_list[$i] == $v_header['filename']) { |
| 3138 | 3138 | TrFctMessage(__FILE__, __LINE__, 3, "File '$v_stored_list[$i]' is present in archive"); |
| 3139 | - 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]))); |
|
| 3140 | - TrFctMessage(__FILE__, __LINE__, 3, 'Archived mtime=' . $v_header['mtime'] . ' ' . date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
| 3139 | + 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]))); |
|
| 3140 | + TrFctMessage(__FILE__, __LINE__, 3, 'Archived mtime='.$v_header['mtime'].' '.date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
| 3141 | 3141 | |
| 3142 | 3142 | // ----- Store found informations |
| 3143 | 3143 | $v_found_file = true; |
@@ -3155,13 +3155,13 @@ discard block |
||
| 3155 | 3155 | // ----- Flag the name in order not to add the file at the end |
| 3156 | 3156 | $v_found_list[$i] = 1; |
| 3157 | 3157 | } else { |
| 3158 | - TrFctMessage(__FILE__, __LINE__, 4, "File '$p_file_list[$i]' is not " . $v_header['filename'] . ''); |
|
| 3158 | + TrFctMessage(__FILE__, __LINE__, 4, "File '$p_file_list[$i]' is not ".$v_header['filename'].''); |
|
| 3159 | 3159 | } |
| 3160 | 3160 | } |
| 3161 | 3161 | |
| 3162 | 3162 | // ----- Copy files that do not need to be updated |
| 3163 | 3163 | if (!$v_update_file) { |
| 3164 | - TrFctMessage(__FILE__, __LINE__, 2, 'Keep file ' . $v_header['filename'] . ''); |
|
| 3164 | + TrFctMessage(__FILE__, __LINE__, 2, 'Keep file '.$v_header['filename'].''); |
|
| 3165 | 3165 | |
| 3166 | 3166 | // ----- Write the file header |
| 3167 | 3167 | if ($p_tar_mode === 'tar') { |
@@ -3173,7 +3173,7 @@ discard block |
||
| 3173 | 3173 | // ----- Write the file data |
| 3174 | 3174 | $n = ceil($v_header['size'] / 512); |
| 3175 | 3175 | for ($j = 0; $j < $n; ++$j) { |
| 3176 | - TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($j + 1)); |
|
| 3176 | + TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number '.($j + 1)); |
|
| 3177 | 3177 | if ($p_tar_mode === 'tar') { |
| 3178 | 3178 | $v_content = fread($v_tar, 512); |
| 3179 | 3179 | fwrite($v_temp_tar, $v_content, 512); |
@@ -3184,7 +3184,7 @@ discard block |
||
| 3184 | 3184 | } |
| 3185 | 3185 | |
| 3186 | 3186 | // ----- File name and properties are logged if listing mode or file is extracted |
| 3187 | - TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . ''); |
|
| 3187 | + TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file '.$v_header['filename'].''); |
|
| 3188 | 3188 | |
| 3189 | 3189 | // ----- Add the array describing the file into the list |
| 3190 | 3190 | $p_list_detail[$v_nb] = $v_header; |
@@ -3219,7 +3219,7 @@ discard block |
||
| 3219 | 3219 | } |
| 3220 | 3220 | |
| 3221 | 3221 | // ----- Trace |
| 3222 | - TrFctMessage(__FILE__, __LINE__, 2, 'Skip old file ' . $v_header['filename'] . ''); |
|
| 3222 | + TrFctMessage(__FILE__, __LINE__, 2, 'Skip old file '.$v_header['filename'].''); |
|
| 3223 | 3223 | |
| 3224 | 3224 | // ----- Jump to next file |
| 3225 | 3225 | if ($p_tar_mode === 'tar') { |
@@ -3356,10 +3356,10 @@ discard block |
||
| 3356 | 3356 | if (strlen($v_binary_data) != 512) { |
| 3357 | 3357 | $v_header['filename'] = ''; |
| 3358 | 3358 | $v_header['status'] = 'invalid_header'; |
| 3359 | - TrFctMessage(__FILE__, __LINE__, 2, 'Invalid block size : ' . strlen($v_binary_data)); |
|
| 3359 | + TrFctMessage(__FILE__, __LINE__, 2, 'Invalid block size : '.strlen($v_binary_data)); |
|
| 3360 | 3360 | |
| 3361 | 3361 | // ----- Error log |
| 3362 | - PclErrorLog(-10, 'Invalid block size : ' . strlen($v_binary_data)); |
|
| 3362 | + PclErrorLog(-10, 'Invalid block size : '.strlen($v_binary_data)); |
|
| 3363 | 3363 | |
| 3364 | 3364 | // ----- Return |
| 3365 | 3365 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -3389,9 +3389,9 @@ discard block |
||
| 3389 | 3389 | |
| 3390 | 3390 | // ----- Extract the checksum for check |
| 3391 | 3391 | $v_header['checksum'] = octdec(trim($v_data['checksum'])); |
| 3392 | - TrFctMessage(__FILE__, __LINE__, 3, 'File checksum : ' . $v_header['checksum'] . ''); |
|
| 3392 | + TrFctMessage(__FILE__, __LINE__, 3, 'File checksum : '.$v_header['checksum'].''); |
|
| 3393 | 3393 | if ($v_header['checksum'] != $v_checksum) { |
| 3394 | - TrFctMessage(__FILE__, __LINE__, 2, "File checksum is invalid : $v_checksum calculated, " . $v_header['checksum'] . ' expected'); |
|
| 3394 | + TrFctMessage(__FILE__, __LINE__, 2, "File checksum is invalid : $v_checksum calculated, ".$v_header['checksum'].' expected'); |
|
| 3395 | 3395 | |
| 3396 | 3396 | $v_header['filename'] = ''; |
| 3397 | 3397 | $v_header['status'] = 'invalid_header'; |
@@ -3406,7 +3406,7 @@ discard block |
||
| 3406 | 3406 | } |
| 3407 | 3407 | |
| 3408 | 3408 | // ----- Error log |
| 3409 | - PclErrorLog(-13, "Invalid checksum : $v_checksum calculated, " . $v_header['checksum'] . ' expected'); |
|
| 3409 | + PclErrorLog(-13, "Invalid checksum : $v_checksum calculated, ".$v_header['checksum'].' expected'); |
|
| 3410 | 3410 | |
| 3411 | 3411 | // ----- Return |
| 3412 | 3412 | TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); |
@@ -3417,22 +3417,22 @@ discard block |
||
| 3417 | 3417 | |
| 3418 | 3418 | // ----- Extract the properties |
| 3419 | 3419 | $v_header['filename'] = trim($v_data['filename']); |
| 3420 | - TrFctMessage(__FILE__, __LINE__, 2, 'Name : ' . $v_header['filename'] . ''); |
|
| 3420 | + TrFctMessage(__FILE__, __LINE__, 2, 'Name : '.$v_header['filename'].''); |
|
| 3421 | 3421 | $v_header['mode'] = octdec(trim($v_data['mode'])); |
| 3422 | - TrFctMessage(__FILE__, __LINE__, 2, "Mode : '" . decoct($v_header['mode']) . "'"); |
|
| 3422 | + TrFctMessage(__FILE__, __LINE__, 2, "Mode : '".decoct($v_header['mode'])."'"); |
|
| 3423 | 3423 | $v_header['uid'] = octdec(trim($v_data['uid'])); |
| 3424 | - TrFctMessage(__FILE__, __LINE__, 2, "Uid : '" . $v_header['uid'] . "'"); |
|
| 3424 | + TrFctMessage(__FILE__, __LINE__, 2, "Uid : '".$v_header['uid']."'"); |
|
| 3425 | 3425 | $v_header['gid'] = octdec(trim($v_data['gid'])); |
| 3426 | - TrFctMessage(__FILE__, __LINE__, 2, "Gid : '" . $v_header['gid'] . "'"); |
|
| 3426 | + TrFctMessage(__FILE__, __LINE__, 2, "Gid : '".$v_header['gid']."'"); |
|
| 3427 | 3427 | $v_header['size'] = octdec(trim($v_data['size'])); |
| 3428 | - TrFctMessage(__FILE__, __LINE__, 2, "Size : '" . $v_header['size'] . "'"); |
|
| 3428 | + TrFctMessage(__FILE__, __LINE__, 2, "Size : '".$v_header['size']."'"); |
|
| 3429 | 3429 | $v_header['mtime'] = octdec(trim($v_data['mtime'])); |
| 3430 | - TrFctMessage(__FILE__, __LINE__, 2, 'Date : ' . date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
| 3430 | + TrFctMessage(__FILE__, __LINE__, 2, 'Date : '.date('l dS of F Y h:i:s A', $v_header['mtime'])); |
|
| 3431 | 3431 | if (($v_header['typeflag'] = $v_data['typeflag']) == '5') { |
| 3432 | 3432 | $v_header['size'] = 0; |
| 3433 | - TrFctMessage(__FILE__, __LINE__, 2, "Size (folder) : '" . $v_header['size'] . "'"); |
|
| 3433 | + TrFctMessage(__FILE__, __LINE__, 2, "Size (folder) : '".$v_header['size']."'"); |
|
| 3434 | 3434 | } |
| 3435 | - TrFctMessage(__FILE__, __LINE__, 2, 'File typeflag : ' . $v_header['typeflag'] . ''); |
|
| 3435 | + TrFctMessage(__FILE__, __LINE__, 2, 'File typeflag : '.$v_header['typeflag'].''); |
|
| 3436 | 3436 | /* ----- All these fields are removed form the header because they do not carry interesting info |
| 3437 | 3437 | $v_header[link] = trim($v_data[link]); |
| 3438 | 3438 | TrFctMessage(__FILE__, __LINE__, 2, "Linkname : $v_header[linkname]"); |
@@ -3612,7 +3612,7 @@ discard block |
||
| 3612 | 3612 | // ----- Ignore only the double '//' in path, |
| 3613 | 3613 | // but not the first and last '/' |
| 3614 | 3614 | } else { |
| 3615 | - $v_result = $v_list[$i] . ($i != (count($v_list) - 1) ? '/' . $v_result : ''); |
|
| 3615 | + $v_result = $v_list[$i].($i != (count($v_list) - 1) ? '/'.$v_result : ''); |
|
| 3616 | 3616 | } |
| 3617 | 3617 | } |
| 3618 | 3618 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public $entry; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * @param $calendar |
|
| 22 | + * @param Calendar_Day $calendar |
|
| 23 | 23 | */ |
| 24 | 24 | public function __construct($calendar) |
| 25 | 25 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * @return mixed |
|
| 38 | + * @return boolean |
|
| 39 | 39 | */ |
| 40 | 40 | public function getEntry() |
| 41 | 41 | { |
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | if (!@include 'Calendar/Calendar.php') { |
| 7 | 7 | define('CALENDAR_ROOT', '../../'); |
| 8 | 8 | } |
| 9 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 10 | -require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 11 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
| 9 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 10 | +require_once CALENDAR_ROOT.'Hour.php'; |
|
| 11 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
| 12 | 12 | |
| 13 | 13 | // Decorator to "attach" functionality to selected hours |
| 14 | 14 | |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | FROM |
| 55 | 55 | diary |
| 56 | 56 | WHERE |
| 57 | - eventtime >= '" . $Day->thisDay(true) . "' |
|
| 57 | + eventtime >= '" . $Day->thisDay(true)."' |
|
| 58 | 58 | AND |
| 59 | - eventtime < '" . $Day->nextDay(true) . "';"; |
|
| 59 | + eventtime < '" . $Day->nextDay(true)."';"; |
|
| 60 | 60 | |
| 61 | 61 | // An array simulating data from a database |
| 62 | 62 | $result = array( |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // If the hour is selected, call the decorator method... |
| 114 | 114 | if ($Hour->isSelected()) { |
| 115 | - echo '<td bgcolor="silver">' . $Hour->getEntry() . "</td>\n"; |
|
| 115 | + echo '<td bgcolor="silver">'.$Hour->getEntry()."</td>\n"; |
|
| 116 | 116 | } else { |
| 117 | 117 | echo "<td> </td>\n"; |
| 118 | 118 | } |
@@ -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 | |
@@ -255,6 +255,10 @@ |
||
| 255 | 255 | * @param $max |
| 256 | 256 | * @return mixed |
| 257 | 257 | */ |
| 258 | + |
|
| 259 | + /** |
|
| 260 | + * @param integer $min |
|
| 261 | + */ |
|
| 258 | 262 | public static function bornerValeur($val, $min, $max) |
| 259 | 263 | { |
| 260 | 264 | if ($val < $min) { |
@@ -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); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | /** |
| 179 | 179 | * Set the value. |
| 180 | 180 | * |
| 181 | - * @param $value int |
|
| 181 | + * @param integer $value int |
|
| 182 | 182 | */ |
| 183 | 183 | public function setValue($value) |
| 184 | 184 | { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | /** |
| 198 | 198 | * Set the min value. |
| 199 | 199 | * |
| 200 | - * @param $min int |
|
| 200 | + * @param integer $min int |
|
| 201 | 201 | */ |
| 202 | 202 | public function setMin($min) |
| 203 | 203 | { |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | /** |
| 216 | 216 | * Set the max value - must be more great then min. |
| 217 | 217 | * |
| 218 | - * @param $max int |
|
| 218 | + * @param integer $max int |
|
| 219 | 219 | */ |
| 220 | 220 | public function setMax($max) |
| 221 | 221 | { |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * Set the small increment when click a short time on up down nutton |
| 236 | 236 | * must be " > 0 ". |
| 237 | 237 | * |
| 238 | - * @param $smallIncrement |
|
| 238 | + * @param integer $smallIncrement |
|
| 239 | 239 | * |
| 240 | 240 | * @internal param int $value |
| 241 | 241 | */ |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | /** |
| 260 | 260 | * Set the large increment when click a long time on up down nutton. |
| 261 | 261 | * |
| 262 | - * @param $largeIncrement int |
|
| 262 | + * @param integer $largeIncrement int |
|
| 263 | 263 | */ |
| 264 | 264 | public function setLargeIncrement($largeIncrement) |
| 265 | 265 | { |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * Set the size in nb car of the input text for the value |
| 283 | 283 | * must be 2 car min. |
| 284 | 284 | * |
| 285 | - * @param $size mixed |
|
| 285 | + * @param integer $size mixed |
|
| 286 | 286 | */ |
| 287 | 287 | public function setSize($size) |
| 288 | 288 | { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | /** |
| 308 | 308 | * Set the shortname of the folder images. |
| 309 | 309 | * |
| 310 | - * @param $folder string |
|
| 310 | + * @param string $folder string |
|
| 311 | 311 | */ |
| 312 | 312 | public function setImgFolder($folder) |
| 313 | 313 | { |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | /** |
| 328 | 328 | * Set the label of unites between value and buttons. |
| 329 | 329 | * |
| 330 | - * @param $unite string |
|
| 330 | + * @param string $unite string |
|
| 331 | 331 | */ |
| 332 | 332 | public function setUnite($unite) |
| 333 | 333 | { |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | /** |
| 346 | 346 | * Set the style CSS of the text. |
| 347 | 347 | * |
| 348 | - * @param $style string |
|
| 348 | + * @param string $style string |
|
| 349 | 349 | */ |
| 350 | 350 | public function setStyleText($style) |
| 351 | 351 | { |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | /** |
| 366 | 366 | * Set the style CSS of the frame. |
| 367 | 367 | * |
| 368 | - * @param $style string |
|
| 368 | + * @param string $style string |
|
| 369 | 369 | */ |
| 370 | 370 | public function setStyleBordure($style) |
| 371 | 371 | { |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | /** |
| 386 | 386 | * Set MinMaxVisible : show the button to go min and max value. |
| 387 | 387 | * |
| 388 | - * @param $visible bool |
|
| 388 | + * @param boolean $visible bool |
|
| 389 | 389 | */ |
| 390 | 390 | public function setMinMaxVisible($visible) |
| 391 | 391 | { |
@@ -494,6 +494,11 @@ discard block |
||
| 494 | 494 | * @param string $default |
| 495 | 495 | * @return string |
| 496 | 496 | */ |
| 497 | + |
|
| 498 | + /** |
|
| 499 | + * @param string $attribut |
|
| 500 | + * @param string $value |
|
| 501 | + */ |
|
| 497 | 502 | public function htmlAddAttribut($attribut, $value, $default = '') |
| 498 | 503 | { |
| 499 | 504 | $r = ''; |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | if (!@include 'Calendar/Calendar.php') { |
| 6 | 6 | define('CALENDAR_ROOT', '../../'); |
| 7 | 7 | } |
| 8 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 8 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 9 | 9 | |
| 10 | 10 | $Day = new Calendar_Day(2003, 10, 23); |
| 11 | 11 | |
@@ -39,32 +39,32 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | switch (@$_GET['view']) { |
| 42 | - default: |
|
| 43 | - $_GET['view'] = 'calendar_year'; |
|
| 44 | - case 'calendar_year': |
|
| 45 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
| 46 | - $c = new Calendar_Year($_GET['y']); |
|
| 47 | - break; |
|
| 48 | - case 'calendar_month': |
|
| 49 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
| 50 | - $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
| 51 | - break; |
|
| 52 | - case 'calendar_day': |
|
| 53 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 54 | - $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
| 55 | - break; |
|
| 56 | - case 'calendar_hour': |
|
| 57 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 58 | - $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
| 59 | - break; |
|
| 60 | - case 'calendar_minute': |
|
| 61 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 62 | - $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
| 63 | - break; |
|
| 64 | - case 'calendar_second': |
|
| 65 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
| 66 | - $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
| 67 | - break; |
|
| 42 | + default: |
|
| 43 | + $_GET['view'] = 'calendar_year'; |
|
| 44 | + case 'calendar_year': |
|
| 45 | + require_once CALENDAR_ROOT . 'Year.php'; |
|
| 46 | + $c = new Calendar_Year($_GET['y']); |
|
| 47 | + break; |
|
| 48 | + case 'calendar_month': |
|
| 49 | + require_once CALENDAR_ROOT . 'Month.php'; |
|
| 50 | + $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
| 51 | + break; |
|
| 52 | + case 'calendar_day': |
|
| 53 | + require_once CALENDAR_ROOT . 'Day.php'; |
|
| 54 | + $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
| 55 | + break; |
|
| 56 | + case 'calendar_hour': |
|
| 57 | + require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 58 | + $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
| 59 | + break; |
|
| 60 | + case 'calendar_minute': |
|
| 61 | + require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 62 | + $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
| 63 | + break; |
|
| 64 | + case 'calendar_second': |
|
| 65 | + require_once CALENDAR_ROOT . 'Second.php'; |
|
| 66 | + $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
| 67 | + break; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // Convert timestamp to human readable date |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | { |
| 10 | 10 | list($usec, $sec) = explode(' ', microtime()); |
| 11 | 11 | |
| 12 | - return (float)$usec + (float)$sec; |
|
| 12 | + return (float) $usec + (float) $sec; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | // Switch to PEAR::Date engine |
@@ -42,27 +42,27 @@ discard block |
||
| 42 | 42 | default: |
| 43 | 43 | $_GET['view'] = 'calendar_year'; |
| 44 | 44 | case 'calendar_year': |
| 45 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
| 45 | + require_once CALENDAR_ROOT.'Year.php'; |
|
| 46 | 46 | $c = new Calendar_Year($_GET['y']); |
| 47 | 47 | break; |
| 48 | 48 | case 'calendar_month': |
| 49 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
| 49 | + require_once CALENDAR_ROOT.'Month.php'; |
|
| 50 | 50 | $c = new Calendar_Month($_GET['y'], $_GET['m']); |
| 51 | 51 | break; |
| 52 | 52 | case 'calendar_day': |
| 53 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 53 | + require_once CALENDAR_ROOT.'Day.php'; |
|
| 54 | 54 | $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
| 55 | 55 | break; |
| 56 | 56 | case 'calendar_hour': |
| 57 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 57 | + require_once CALENDAR_ROOT.'Hour.php'; |
|
| 58 | 58 | $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
| 59 | 59 | break; |
| 60 | 60 | case 'calendar_minute': |
| 61 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 61 | + require_once CALENDAR_ROOT.'Minute.php'; |
|
| 62 | 62 | $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
| 63 | 63 | break; |
| 64 | 64 | case 'calendar_second': |
| 65 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
| 65 | + require_once CALENDAR_ROOT.'Second.php'; |
|
| 66 | 66 | $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
| 67 | 67 | break; |
| 68 | 68 | } |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | $date = new Date($c->getTimestamp()); |
| 72 | 72 | |
| 73 | 73 | echo '<h1>Using PEAR::Date engine</h1>'; |
| 74 | -echo 'Viewing: ' . @$_GET['view'] . '<br>'; |
|
| 75 | -echo 'The time is now: ' . $date->format('%Y %a %e %T') . '<br >'; |
|
| 74 | +echo 'Viewing: '.@$_GET['view'].'<br>'; |
|
| 75 | +echo 'The time is now: '.$date->format('%Y %a %e %T').'<br >'; |
|
| 76 | 76 | |
| 77 | 77 | $i = 1; |
| 78 | 78 | echo '<h1>First Iteration</h1>'; |
@@ -82,15 +82,15 @@ discard block |
||
| 82 | 82 | $c->build(); |
| 83 | 83 | while ($e = $c->fetch()) { |
| 84 | 84 | $class = strtolower(get_class($e)); |
| 85 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 86 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 87 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 85 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 86 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 87 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 88 | 88 | if (($i % 10) == 0) { |
| 89 | 89 | echo '<br>'; |
| 90 | 90 | } |
| 91 | 91 | ++$i; |
| 92 | 92 | } |
| 93 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 93 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
| 94 | 94 | |
| 95 | 95 | $i = 1; |
| 96 | 96 | echo '<h1>Second Iteration</h1>'; |
@@ -99,12 +99,12 @@ discard block |
||
| 99 | 99 | $start = getmicrotime(); |
| 100 | 100 | while ($e = $c->fetch()) { |
| 101 | 101 | $class = strtolower(get_class($e)); |
| 102 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 103 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 104 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 102 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 103 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 104 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 105 | 105 | if (($i % 10) == 0) { |
| 106 | 106 | echo '<br>'; |
| 107 | 107 | } |
| 108 | 108 | ++$i; |
| 109 | 109 | } |
| 110 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 110 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
| 22 | 22 | $event = $eventHandler->getEvent($itemId, 0, true); |
| 23 | 23 | $item['name'] = $event->getVar('event_title'); |
| 24 | - $item['url'] = XOOPS_URL . '/modules/extcal/event.php?event=' . $event->getVar('event_id'); |
|
| 24 | + $item['url'] = XOOPS_URL.'/modules/extcal/event.php?event='.$event->getVar('event_id'); |
|
| 25 | 25 | |
| 26 | 26 | return $item; |
| 27 | 27 | } |
@@ -536,7 +536,7 @@ |
||
| 536 | 536 | |
| 537 | 537 | /** |
| 538 | 538 | * @param $objects |
| 539 | - * @param array $externalKeys |
|
| 539 | + * @param string[] $externalKeys |
|
| 540 | 540 | * @param string $format |
| 541 | 541 | * |
| 542 | 542 | * @return array |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | if (is_array($this->keyName)) { |
| 101 | 101 | $criteria = new CriteriaCompo(); |
| 102 | 102 | for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) { |
| 103 | - $criteria->add(new Criteria($this->keyName[$i], (int)$id[$i])); |
|
| 103 | + $criteria->add(new Criteria($this->keyName[$i], (int) $id[$i])); |
|
| 104 | 104 | } |
| 105 | 105 | } else { |
| 106 | - $criteria = new Criteria($this->keyName, (int)$id); |
|
| 106 | + $criteria = new Criteria($this->keyName, (int) $id); |
|
| 107 | 107 | } |
| 108 | 108 | $criteria->setLimit(1); |
| 109 | 109 | $objectArray = $this->getObjects($criteria, false, true); |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $ret = array(); |
| 129 | 129 | $limit = $start = 0; |
| 130 | - $sql = 'SELECT * FROM ' . $this->table; |
|
| 130 | + $sql = 'SELECT * FROM '.$this->table; |
|
| 131 | 131 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 132 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 132 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 133 | 133 | if ($criteria->getSort() != '') { |
| 134 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 134 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 135 | 135 | } |
| 136 | 136 | $limit = $criteria->getLimit(); |
| 137 | 137 | $start = $criteria->getStart(); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $ret[] = $obj; |
| 167 | 167 | } else { |
| 168 | 168 | $row = array(); |
| 169 | - $vars =& $obj->getVars(); |
|
| 169 | + $vars = & $obj->getVars(); |
|
| 170 | 170 | foreach (array_keys($vars) as $i) { |
| 171 | 171 | $row[$i] = $obj->getVar($i); |
| 172 | 172 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $ret[$myrow[$this->keyName]] = $obj; |
| 178 | 178 | } else { |
| 179 | 179 | $row = array(); |
| 180 | - $vars =& $obj->getVars(); |
|
| 180 | + $vars = & $obj->getVars(); |
|
| 181 | 181 | foreach (array_keys($vars) as $i) { |
| 182 | 182 | $row[$i] = $obj->getVar($i); |
| 183 | 183 | } |
@@ -210,15 +210,15 @@ discard block |
||
| 210 | 210 | $criteria->setSort($this->identifierName); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - $sql = 'SELECT ' . $this->keyName; |
|
| 213 | + $sql = 'SELECT '.$this->keyName; |
|
| 214 | 214 | if (!empty($this->identifierName)) { |
| 215 | - $sql .= ', ' . $this->identifierName; |
|
| 215 | + $sql .= ', '.$this->identifierName; |
|
| 216 | 216 | } |
| 217 | - $sql .= ' FROM ' . $this->table; |
|
| 217 | + $sql .= ' FROM '.$this->table; |
|
| 218 | 218 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 219 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 219 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 220 | 220 | if ($criteria->getSort() != '') { |
| 221 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 221 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 222 | 222 | } |
| 223 | 223 | $limit = $criteria->getLimit(); |
| 224 | 224 | $start = $criteria->getStart(); |
@@ -251,12 +251,12 @@ discard block |
||
| 251 | 251 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 252 | 252 | if ($criteria->groupby != '') { |
| 253 | 253 | $groupby = true; |
| 254 | - $field = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 254 | + $field = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | - $sql = 'SELECT ' . $field . 'COUNT(*) FROM ' . $this->table; |
|
| 257 | + $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table; |
|
| 258 | 258 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 259 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 259 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 260 | 260 | if ($criteria->groupby != '') { |
| 261 | 261 | $sql .= $criteria->getGroupby(); |
| 262 | 262 | } |
@@ -292,13 +292,13 @@ discard block |
||
| 292 | 292 | if (is_array($this->keyName)) { |
| 293 | 293 | $clause = array(); |
| 294 | 294 | for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) { |
| 295 | - $clause[] = $this->keyName[$i] . ' = ' . $id[$i]; |
|
| 295 | + $clause[] = $this->keyName[$i].' = '.$id[$i]; |
|
| 296 | 296 | } |
| 297 | 297 | $whereclause = implode(' AND ', $clause); |
| 298 | 298 | } else { |
| 299 | - $whereclause = $this->keyName . ' = ' . $id; |
|
| 299 | + $whereclause = $this->keyName.' = '.$id; |
|
| 300 | 300 | } |
| 301 | - $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $whereclause; |
|
| 301 | + $sql = 'DELETE FROM '.$this->table.' WHERE '.$whereclause; |
|
| 302 | 302 | if (false !== $force) { |
| 303 | 303 | $result = $this->db->queryF($sql); |
| 304 | 304 | } else { |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | if (!($obj instanceof $this->className && class_exists($this->className))) { |
| 332 | - $obj->setErrors(get_class($obj) . ' Differs from ' . $this->className); |
|
| 332 | + $obj->setErrors(get_class($obj).' Differs from '.$this->className); |
|
| 333 | 333 | |
| 334 | 334 | return false; |
| 335 | 335 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | foreach ($obj->cleanVars as $k => $v) { |
| 342 | 342 | if ($obj->vars[$k]['data_type'] == XOBJ_DTYPE_INT) { |
| 343 | - $cleanvars[$k] = (int)$v; |
|
| 343 | + $cleanvars[$k] = (int) $v; |
|
| 344 | 344 | } elseif (is_array($v)) { |
| 345 | 345 | $cleanvars[$k] = $this->db->quoteString(implode(',', $v)); |
| 346 | 346 | } else { |
@@ -350,12 +350,12 @@ discard block |
||
| 350 | 350 | if ($obj->isNew()) { |
| 351 | 351 | if (!is_array($this->keyName)) { |
| 352 | 352 | if ($cleanvars[$this->keyName] < 1) { |
| 353 | - $cleanvars[$this->keyName] = $this->db->genId($this->table . '_' . $this->keyName . '_seq'); |
|
| 353 | + $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq'); |
|
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | - $sql = 'INSERT INTO ' . $this->table . ' (' . implode(',', array_keys($cleanvars)) . ') VALUES (' . implode(',', array_values($cleanvars)) . ')'; |
|
| 356 | + $sql = 'INSERT INTO '.$this->table.' ('.implode(',', array_keys($cleanvars)).') VALUES ('.implode(',', array_values($cleanvars)).')'; |
|
| 357 | 357 | } else { |
| 358 | - $sql = 'UPDATE ' . $this->table . ' SET'; |
|
| 358 | + $sql = 'UPDATE '.$this->table.' SET'; |
|
| 359 | 359 | foreach ($cleanvars as $key => $value) { |
| 360 | 360 | if ((!is_array($this->keyName) && $key == $this->keyName) |
| 361 | 361 | || (is_array($this->keyName) |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | if (isset($notfirst)) { |
| 367 | 367 | $sql .= ','; |
| 368 | 368 | } |
| 369 | - $sql .= ' ' . $key . ' = ' . $value; |
|
| 369 | + $sql .= ' '.$key.' = '.$value; |
|
| 370 | 370 | $notfirst = true; |
| 371 | 371 | } |
| 372 | 372 | if (is_array($this->keyName)) { |
@@ -375,12 +375,12 @@ discard block |
||
| 375 | 375 | if ($i > 0) { |
| 376 | 376 | $whereclause .= ' AND '; |
| 377 | 377 | } |
| 378 | - $whereclause .= $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
| 378 | + $whereclause .= $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
| 379 | 379 | } |
| 380 | 380 | } else { |
| 381 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
| 381 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
| 382 | 382 | } |
| 383 | - $sql .= ' WHERE ' . $whereclause; |
|
| 383 | + $sql .= ' WHERE '.$whereclause; |
|
| 384 | 384 | } |
| 385 | 385 | if (false !== $force) { |
| 386 | 386 | $result = $this->db->queryF($sql); |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | */ |
| 410 | 410 | public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) |
| 411 | 411 | { |
| 412 | - $setClause = $fieldname . ' = '; |
|
| 412 | + $setClause = $fieldname.' = '; |
|
| 413 | 413 | if (is_numeric($fieldvalue)) { |
| 414 | 414 | $setClause .= $fieldvalue; |
| 415 | 415 | } elseif (is_array($fieldvalue)) { |
@@ -417,9 +417,9 @@ discard block |
||
| 417 | 417 | } else { |
| 418 | 418 | $setClause .= $this->db->quoteString($fieldvalue); |
| 419 | 419 | } |
| 420 | - $sql = 'UPDATE ' . $this->table . ' SET ' . $setClause; |
|
| 420 | + $sql = 'UPDATE '.$this->table.' SET '.$setClause; |
|
| 421 | 421 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 422 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 422 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 423 | 423 | } |
| 424 | 424 | if (false !== $force) { |
| 425 | 425 | $result = $this->db->queryF($sql); |
@@ -443,9 +443,9 @@ discard block |
||
| 443 | 443 | */ |
| 444 | 444 | public function updateFieldValue($fieldname, $fieldvalue, $criteria = null, $force = true) |
| 445 | 445 | { |
| 446 | - $sql = 'UPDATE ' . $this->table . ' SET ' . $fieldname . ' = ' . $fieldvalue; |
|
| 446 | + $sql = 'UPDATE '.$this->table.' SET '.$fieldname.' = '.$fieldvalue; |
|
| 447 | 447 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 448 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 448 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 449 | 449 | } |
| 450 | 450 | if (false !== $force) { |
| 451 | 451 | $result = $this->db->queryF($sql); |
@@ -472,8 +472,8 @@ discard block |
||
| 472 | 472 | public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) |
| 473 | 473 | { |
| 474 | 474 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 475 | - $sql = 'DELETE FROM ' . $this->table; |
|
| 476 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 475 | + $sql = 'DELETE FROM '.$this->table; |
|
| 476 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 477 | 477 | if (!$this->db->query($sql)) { |
| 478 | 478 | return false; |
| 479 | 479 | } |
@@ -607,8 +607,8 @@ discard block |
||
| 607 | 607 | */ |
| 608 | 608 | public function updateCounter($fieldname, $criteria, $op = '+') |
| 609 | 609 | { |
| 610 | - $sql = 'UPDATE ' . $this->table . ' SET ' . $fieldname . ' = ' . $fieldname . $op . '1'; |
|
| 611 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 610 | + $sql = 'UPDATE '.$this->table.' SET '.$fieldname.' = '.$fieldname.$op.'1'; |
|
| 611 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 612 | 612 | $result = $this->db->queryF($sql); |
| 613 | 613 | if (!$result) { |
| 614 | 614 | return false; |
@@ -630,12 +630,12 @@ discard block |
||
| 630 | 630 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 631 | 631 | if ($criteria->groupby != '') { |
| 632 | 632 | $groupby = true; |
| 633 | - $field = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 633 | + $field = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 634 | 634 | } |
| 635 | 635 | } |
| 636 | - $sql = 'SELECT ' . $field . "SUM($sum) FROM " . $this->table; |
|
| 636 | + $sql = 'SELECT '.$field."SUM($sum) FROM ".$this->table; |
|
| 637 | 637 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 638 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 638 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 639 | 639 | if ($criteria->groupby != '') { |
| 640 | 640 | $sql .= $criteria->getGroupby(); |
| 641 | 641 | } |
@@ -671,12 +671,12 @@ discard block |
||
| 671 | 671 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 672 | 672 | if ($criteria->groupby != '') { |
| 673 | 673 | $groupby = true; |
| 674 | - $field = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 674 | + $field = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 675 | 675 | } |
| 676 | 676 | } |
| 677 | - $sql = 'SELECT ' . $field . "MAX($max) FROM " . $this->table; |
|
| 677 | + $sql = 'SELECT '.$field."MAX($max) FROM ".$this->table; |
|
| 678 | 678 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 679 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 679 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 680 | 680 | if ($criteria->groupby != '') { |
| 681 | 681 | $sql .= $criteria->getGroupby(); |
| 682 | 682 | } |
@@ -709,9 +709,9 @@ discard block |
||
| 709 | 709 | { |
| 710 | 710 | $field = ''; |
| 711 | 711 | |
| 712 | - $sql = 'SELECT ' . $field . "AVG($avg) FROM " . $this->table; |
|
| 712 | + $sql = 'SELECT '.$field."AVG($avg) FROM ".$this->table; |
|
| 713 | 713 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 714 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 714 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 715 | 715 | } |
| 716 | 716 | $result = $this->db->query($sql); |
| 717 | 717 | if (!$result) { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | /** |
| 137 | 137 | * Returns the date as an associative array (helper method). |
| 138 | 138 | * |
| 139 | - * @param mixed $stamp timestamp (leave empty for current timestamp) |
|
| 139 | + * @param integer $stamp timestamp (leave empty for current timestamp) |
|
| 140 | 140 | * |
| 141 | 141 | * @return array |
| 142 | 142 | */ |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | * |
| 243 | 243 | * @param array $sDates array containing Calendar objects to select (optional) |
| 244 | 244 | * |
| 245 | - * @return bool |
|
| 245 | + * @return boolean|null |
|
| 246 | 246 | * @abstract |
| 247 | 247 | */ |
| 248 | 248 | public function build($sDates = array()) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function __construct(&$calendar) |
| 82 | 82 | { |
| 83 | - $this->calendar =& $calendar; |
|
| 83 | + $this->calendar = & $calendar; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -403,8 +403,8 @@ discard block |
||
| 403 | 403 | if (method_exists($this->calendar, 'prevWeek')) { |
| 404 | 404 | return $this->calendar->prevWeek($format); |
| 405 | 405 | } else { |
| 406 | - require_once __DIR__ . '/PEAR.php'; |
|
| 407 | - PEAR::raiseError('Cannot call prevWeek on Calendar object of type: ' . get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::prevWeek()'); |
|
| 406 | + require_once __DIR__.'/PEAR.php'; |
|
| 407 | + PEAR::raiseError('Cannot call prevWeek on Calendar object of type: '.get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::prevWeek()'); |
|
| 408 | 408 | |
| 409 | 409 | return false; |
| 410 | 410 | } |
@@ -422,8 +422,8 @@ discard block |
||
| 422 | 422 | if (method_exists($this->calendar, 'thisWeek')) { |
| 423 | 423 | return $this->calendar->thisWeek($format); |
| 424 | 424 | } else { |
| 425 | - require_once __DIR__ . '/PEAR.php'; |
|
| 426 | - PEAR::raiseError('Cannot call thisWeek on Calendar object of type: ' . get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::thisWeek()'); |
|
| 425 | + require_once __DIR__.'/PEAR.php'; |
|
| 426 | + PEAR::raiseError('Cannot call thisWeek on Calendar object of type: '.get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::thisWeek()'); |
|
| 427 | 427 | |
| 428 | 428 | return false; |
| 429 | 429 | } |
@@ -441,8 +441,8 @@ discard block |
||
| 441 | 441 | if (method_exists($this->calendar, 'nextWeek')) { |
| 442 | 442 | return $this->calendar->nextWeek($format); |
| 443 | 443 | } else { |
| 444 | - require_once __DIR__ . '/PEAR.php'; |
|
| 445 | - PEAR::raiseError('Cannot call thisWeek on Calendar object of type: ' . get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::nextWeek()'); |
|
| 444 | + require_once __DIR__.'/PEAR.php'; |
|
| 445 | + PEAR::raiseError('Cannot call thisWeek on Calendar object of type: '.get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::nextWeek()'); |
|
| 446 | 446 | |
| 447 | 447 | return false; |
| 448 | 448 | } |