Files
objects/standalone/test.php
2014-12-03 20:27:47 +01:00

78 lines
16 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
//error_reporting(-1);
error_reporting(0);
date_default_timezone_set('Europe/Paris');
$now = new DateTime();
$mins = $now->getOffset() / 60;
$sgn = ($mins < 0 ? -1 : 1);
$mins = abs($mins);
$hrs = floor($mins / 60);
$mins -= $hrs * 60;
$offset = sprintf('%+d:%02d', $hrs*$sgn, $mins);
echo '$mins='.$mins.'<br />hours='.$hrs.'<br />Offset='.$offset;
// $sFileContent = file_get_contents('dump');
// //$sFileContent = substr($sFileContent, 0, 1000);
// //echo strlen($sFileContent);
// $asToMatch = array(6632, 6656, 6657, 6675, 6680, 6682, 6683, 6686, 6691, 6693, 6697, 6699, 6700, 6751, 6753, 6830, 6855, 6902, 6912, 6920, 6923, 6934, 6947, 6975, 6992, 7022, 7036, 7047, 7049, 7085, 7087, 7106, 7113, 7128, 7138, 7238, 7268, 7285, 7287, 7322, 7325, 7330, 7344, 7355, 7362, 7363, 7383, 7388, 7448, 7488, 7493, 7494, 7495, 7496, 7498, 7506, 7507, 7560, 7597, 7640, 7654, 7659, 7662, 7694, 7698, 7711, 7713, 7731, 7732, 7733, 7743, 7769, 7772, 7826, 7852, 7954, 7983, 7986, 8007, 8008, 8028, 8125, 8166, 8189, 8212, 8213, 8270, 8278, 8279, 8326, 8327, 8332, 8339, 8360, 8442, 8467, 8473, 8490, 8529, 8554, 8557, 8559, 8567, 8568, 8608, 8632, 8691, 8728, 8731, 8762, 8769, 8789, 8799, 8808, 8809, 8815, 8834, 8841, 8844, 8850, 8852, 8863, 8865, 8874, 8887, 8892, 8896, 8900, 8903, 8906, 8917, 8944, 8945, 8957, 8959, 8965, 8983, 8989, 9031, 9041, 9046, 9047, 9048, 9051, 9063, 9076, 9080, 9085, 9089, 9090, 9099, 9102, 9115, 9152, 9156, 9169, 9207, 9249, 9252, 9258, 9267, 9298, 9300, 9373, 9381, 9402, 9403, 9407, 9477, 9519, 9521, 9541, 9543, 9631, 9642, 9644, 9654, 9676, 9680, 9695, 9700, 9707, 9735, 9740, 9747, 9751, 9752, 9756, 9757, 9781, 9785, 9792, 9796, 9798, 9806, 9808, 9809, 9816, 9825, 9826, 9836, 9840, 9844, 9849, 9856, 9871, 9889, 9956, 9968, 10019, 10033, 10066, 10086, 10088, 10091, 10094, 10100, 10102, 10106, 10113, 10155, 10161, 10198, 10199, 10200, 10201, 10243, 10246, 10260, 10337, 10400, 10415, 10436, 10462, 10464, 10508, 10510, 10511, 10523, 10542, 10545, 10552, 10554, 10563, 10568, 10574, 10670, 10729, 10740, 10745, 10756, 10757, 10765, 10769, 10770, 10776, 10815, 10818, 10822, 10837, 10877, 10913, 10916, 10978, 10991, 11020, 11025, 11026, 11048, 11164, 11176, 11190, 11240, 11244, 11245, 11246, 11247, 11248, 11249, 11253, 11258, 11260, 11276, 11284, 11285, 11292, 11295, 11298, 11302, 11332, 11363, 11364, 11366, 11367, 11368, 11369, 11377, 11386, 11392, 11402, 11405, 11410, 11416, 11417, 11420, 11423, 11426, 11427, 11430, 11433, 11454, 11460, 11502, 11584, 11590, 11593, 11598, 11637, 11650, 11667, 11681, 11682, 11716, 11718, 11741, 11747, 11775, 11820, 11823, 11840, 11884, 12037, 12147, 12162, 12193, 12246, 12250, 12302, 12307, 12323, 12331, 12345, 12365, 12369, 12388, 12399, 12409, 12410, 12414, 12415, 12417, 12427, 12449, 12471, 12472, 12478, 12481, 12486, 12491, 12556, 12561, 12574, 12587, 12605, 12608, 12637, 12666, 12694, 12706, 12716, 12727, 12779, 12791, 12811, 12817, 12822, 12833, 12837, 12841, 12846, 12863, 12876, 12880, 12921, 12935, 12955, 12956, 12961, 12964, 12984, 12992, 13012, 13017, 13051, 13068, 13079, 13093, 13098, 13117, 13127, 13154, 13156, 13194, 13250, 13297, 13310, 13334, 13335, 13346, 13384, 13391, 13396, 13404, 13418, 13442, 13445, 13446, 13452, 13453, 13506, 13583, 13597, 13636, 13657, 13795, 13814, 13818, 13820, 13828, 13837, 13838, 13866, 13868, 13884, 13937, 13940, 13957, 13990, 13992, 13993, 13995, 13996, 14005, 14018, 14021, 14030, 14032, 14035, 14055, 14119, 14121, 14122, 14130, 14133, 14152, 14173, 14187, 14188, 14201, 14204, 14207, 14208, 14267, 14282, 14304, 14311, 14327, 14403, 14417, 14423, 14427, 14443, 14470, 14560, 14592, 14619, 14645, 14647, 14670, 14680, 14708, 14714, 14719, 14721, 14724, 14731, 14748, 14771, 14796, 14800, 14801, 14803, 14809, 14811, 14827, 14837, 14844, 14853, 14873, 14875, 14883, 14886, 14889, 14893, 14902, 14906, 14938, 14939, 14944, 14952, 14967, 14987, 14989, 15000, 15014, 15023, 15049, 15069, 15070, 15082, 15086, 15097, 15104, 15113, 15118, 15124, 15129, 15130, 15131, 15135, 15151, 15166, 15175, 15177, 15184, 15186, 15206, 15211, 15216, 15246, 15255, 15269, 15284, 15288, 15293, 15384, 15430, 15435, 15438, 15441, 15447, 15459, 15497, 15510, 15513, 15532, 15539, 15550, 15573, 15589, 15595, 15640, 15645, 15666, 15698, 15702, 15703, 15704, 15705, 15707, 15717, 15721, 15722, 15767, 15770, 15816, 15818, 15836, 15844, 15851, 15856, 15859, 15864, 15865, 15889, 15890, 15902, 15907, 15920, 15933, 15951, 15955, 15956, 15976, 15987, 16013, 16029, 16042, 16054, 16059, 16062, 16074, 16091, 16095, 16098, 16111, 16117, 16127, 16130, 16187, 16226, 16266, 16282, 16289, 16304, 16310, 16349, 16368, 16374, 16381, 16395, 16419, 16433, 16463, 16504, 16533, 16534, 16553, 16565, 16612, 16614, 16622, 16635, 16660, 16664, 16666, 16695, 16697, 16710, 16740, 16767, 16768, 16777, 16779, 16787, 16805, 16847, 16858, 16864, 16875, 16929, 16940, 16942, 16955, 17013, 17019, 17043, 17046, 17158, 17185, 17210, 17218, 17222, 17223, 17249, 17253, 17268, 17307, 17311, 17326, 17350, 17351, 17393, 17394, 17401, 17403, 17411, 17432, 17433, 17442, 17443, 17574, 17630, 17642, 17653, 17655, 17657, 17688, 17740, 17742, 17761, 17775, 17776, 17784, 17802, 17804, 17809, 17823, 17846, 17888, 17904, 17930, 17934, 17956, 18015, 18016, 18026, 18032, 18052, 18089, 18091, 18095, 18142, 18174, 18225, 18227, 18237, 18285, 18303, 18326, 18339, 18364, 18370, 18403, 18430, 18482, 18495, 18496, 18503, 18504, 18525, 18536, 18541, 18547, 18548, 18551, 18600, 18604, 18618, 18623, 18659, 18662, 18668, 18683, 18685, 18700, 18704, 18732, 18733, 18739, 18758, 18781, 18794, 18797, 18802, 18806, 18814, 18815, 18819, 18832, 18886, 18904, 18912, 18918, 18934, 18950, 18951, 18956, 18957, 18970, 18971, 18986, 18993, 19002, 19017, 19021, 19031, 19032, 19033, 19041, 19066, 19067, 19075, 19085, 19088, 19090, 19091, 19093, 19106, 19109, 19112, 19116, 19126, 19136, 19181, 19198, 19199, 19218, 19273, 19286, 19299, 19320, 19342, 19350, 19367, 19380, 19390, 19391, 19396, 19431, 19435, 19441, 19442, 19444, 19462, 19476, 19488, 19502, 19550, 19558, 19567, 19583, 19608, 19645, 19648, 19652, 19675, 19682, 19709, 19745, 19846, 19868, 19883, 19892, 19900, 19987, 19988, 20003, 20045, 20055, 20068, 20080, 20117, 20138, 20139, 20140, 20155, 20177, 20179, 20182, 20183, 20188, 20190, 20207, 20216, 20231, 20242, 20245, 20252, 20257, 20260, 20264, 20294, 20300, 20309, 20338, 20366, 20386, 20396, 20397, 20427, 20429, 20438, 20453, 20469, 20493, 20495, 20498, 20505, 20508, 20509, 20513, 20514, 20530, 20531, 20539, 20540, 20579, 20585, 20589, 20593, 20637, 20700, 20705, 20708, 20754, 20755, 20769, 20781, 20805, 20811, 20830, 20853, 20854, 20856, 20883, 20885, 20887, 20890, 20918, 20965, 20990, 21011, 21017, 21025, 21049, 21060, 21064, 21111, 21121, 21131, 21141, 21143, 21147, 21172, 21178, 21273, 21287, 21319, 21329, 21332, 21350, 21365, 21368, 21370, 21372, 21378, 21384, 21431, 21432, 21439, 21441, 21443, 21446, 21456, 21459, 21469, 21471, 21497, 21531, 21537, 21546, 21552, 21557, 21558, 21559, 21567, 21571, 21577, 21581, 21586, 21592, 21625, 21641, 21643, 21656, 21660, 21663, 21664, 21670, 21673, 21721, 21768, 21802, 21809, 21821, 21828, 21831, 21846, 21847, 21868, 21870, 21900, 21904, 21912, 21914, 21929, 21958, 22018, 22023, 22081, 22096, 22104, 22109, 22125, 22128, 22129, 22130, 22131, 22137, 22147, 22182, 22187, 22202, 22210, 22225, 22230, 22251, 22273, 22296, 22338, 22360, 22363, 22364, 22370, 22402, 22422, 22448, 22468, 22480, 22489, 22490, 22516, 22517, 22518, 22545, 22557, 22582, 22592, 22597, 22627, 22665, 22681, 22685, 22705, 22721, 22727, 22744, 22783, 22814, 22848, 22856, 22910, 22915, 22918, 22932, 22936, 22950, 22955, 22973, 22977, 22987, 23011, 23015, 23017, 23020, 23021, 23032, 23046, 23050, 23054, 23064, 23071, 23072, 23079, 23082, 23084, 23085, 23096, 23116, 23118, 23131, 23137, 23140, 23143, 23145, 23172, 23178, 23205, 23229, 23233, 23241, 23292, 23296, 23301, 23307, 23337, 23346, 23365, 23372, 23382, 23396, 23408, 23456, 23470, 23486, 23528, 23558, 23572, 23611, 23618, 23644, 23652, 23654, 23657, 23660, 23670, 23672, 23733, 23740, 23758, 23765, 23782, 23857, 23913, 23916, 23917, 23951, 23981, 23991, 23993, 23994, 24005, 24022, 24023, 24039, 24112, 24115, 24126, 24135, 24144, 24168, 24183, 24227, 24257, 24263, 24270, 24279, 24315, 24369, 24370, 24376, 24423, 24440, 24453, 24464, 24486, 24524, 24534, 24536, 24556, 24560, 24562, 24569, 24572, 24574, 24592, 24602, 24603, 24609, 24610, 24631, 24633, 24645, 24672, 24691, 24697, 24719, 24720, 24732, 24739, 24740, 24743, 24747, 24749, 24767, 24768, 24786, 24800, 24806, 24819, 24839, 24841, 24846, 24855, 24878, 24887, 24894, 24897, 24921, 24950, 24955, 24962, 24963, 24964, 24967, 24968, 24975, 24976, 25001, 25038, 25056, 25088, 25095, 25101, 25103, 25145, 25161, 25164, 25172, 25185, 25191, 25212, 25218, 25236, 25248, 25287, 25298, 25301, 25306, 25349, 25350, 25360, 25426, 25429, 25464, 25501, 25518, 25553, 25583, 25624, 25657, 25689, 25697, 25698, 25704, 25732, 25779, 25791, 25825, 25832, 25837, 25844, 25888, 25895, 25896, 25916, 25921, 25933, 25935, 25989, 25992, 25994, 25996, 26009, 26011, 26020, 26031, 26038, 26057, 26059, 26083, 26084, 26091, 26111, 26114, 26119, 26120, 26123, 26136, 26141, 26153, 26154, 26166, 26182, 26183, 26190, 26249, 26252, 26254, 26255, 26287, 26289, 26309, 26315, 26316, 26412, 26430, 26443, 26455, 26456, 26459, 26460, 26472, 26473, 26475, 26522, 26524, 26526, 26538, 26567, 26632, 26635, 26661, 26684, 26708, 26718, 26737, 26739, 26747, 26748, 26755, 26768, 26772, 26776, 26783, 26791, 26802, 26817, 26819, 26821, 26829, 26832, 26842, 26882, 26883, 26884, 26888, 26892, 26899, 26922, 26986, 26989, 26991, 27017, 27021, 27028, 27067, 27080, 27128, 27131, 27142, 27150, 27183, 27204, 27206, 27207, 27218, 27226, 27227, 27231, 27243, 27248, 27261, 27285, 27293, 27320, 27324, 27325, 27333, 27334, 27357, 27359, 27443, 27455, 27460, 27461, 27464, 27475, 27476, 27502, 27538, 27540, 27570, 27574, 27579, 27587, 27600, 27617, 27626, 27627, 27635, 27637, 27639, 27640, 27676, 27680, 27703, 27707, 27738, 27750, 27751, 27760, 27761, 27768, 27792, 27805, 27840, 27845, 27851, 27853, 27862, 27867, 27892, 27895, 27901, 27904, 27905, 27907, 27921, 27926, 27943, 27957, 27964, 27965, 27981, 27985, 27988, 28013, 28014, 28018, 28019, 28025, 28031, 28036, 28037, 28041, 28042, 28058, 28066, 28099, 28101, 28106, 28114, 28118, 28127, 28148, 28150, 28157, 28158, 28181, 28206, 28217, 28247, 28276, 28283, 28284, 28285, 28289, 28304, 28312, 28317, 28328, 28330, 28346, 28348, 28351, 28358, 28365, 28366, 28399, 28420, 28440, 28445, 28449, 28453, 28457, 28478, 28500, 28501, 28505, 28506, 28509, 28512, 28513, 28515, 28520, 28522, 28526, 28540, 28548, 28549, 28557, 28561, 28562, 28580, 28586, 28599, 28602, 28611, 28634, 28639, 28648, 28653, 28663, 28682, 28686, 28691, 28710, 28719, 28724, 28741, 28742, 28750, 28756, 28793, 28808, 28888, 28931, 28960, 28962, 28975, 28977, 28989, 29002, 29007, 29009, 29015, 29020, 29024, 29027, 29072, 29077, 29087, 29099, 29110, 29111, 29127, 29145, 29167, 29175, 29180, 29181, 29183, 29195, 29196, 29208, 29225, 29236, 29240, 29243, 29245, 29257, 29265, 29273, 29276, 29284, 29291, 29292, 29297, 29298, 29299, 29304, 29317, 29320, 29334, 29335, 29348, 29351, 29352, 29357, 29379, 29387, 29388, 29393, 29405, 29410, 29411, 29418, 29428, 29465, 29579, 29602, 29611, 29647, 29648, 29649, 29674, 29679, 29740, 29741, 29750, 29753, 29764, 29772, 29776, 29797, 29798, 29804, 29813, 29815, 29821, 29822, 29823, 29825, 29833, 29857, 29874, 29878, 29885, 29895, 29902, 29906, 29914, 29923, 29940, 29944, 29947, 29960, 29984, 29988, 29992, 30008, 30021, 30046, 30047, 30058, 30064, 30068, 30073, 30139, 30144, 30158, 30167, 30168, 30171, 30190, 30208, 30219, 30267, 30276, 30302, 30315, 30318, 30354, 30355, 30365, 30370, 30372, 30374, 30377, 30394, 30402, 30408, 30409, 30410, 30415, 30457, 30468, 30474, 30475, 30480, 30484, 30490, 30500, 30523, 30536, 30553, 30554, 30555, 30556, 30571, 30573, 30578, 30605, 30626, 30627, 30635, 30638, 30640, 30647, 30654, 30672, 30688, 30691, 30707, 30744, 30752, 30764, 30775, 30776, 30785, 30789, 30790, 30800, 30802, 30831, 30896, 30898, 30902, 30913, 30919, 30924, 30929, 30953, 30969, 30990, 30991, 30992, 30993, 30994, 30996, 31054, 31061, 31062, 31063, 31116, 31117, 31132, 31133, 31138, 31139, 31166, 31167, 31170, 31177, 31293, 31322, 31339, 31342, 31343, 31345, 31353, 31354, 31361, 31362, 31391, 31396, 31398, 31427, 31459, 31460, 31485, 31523, 31525, 31533, 31534, 31536, 31572, 31583, 31602, 31622, 31666, 31677, 31707, 31709, 31710, 31774, 31787, 31796, 31822, 31823, 31838, 31864, 31868, 31873, 31874, 31884, 31885, 31918, 31932, 31941, 31948, 31962, 31981, 31988, 31997, 32011, 32012, 32066, 32070, 32084, 32085, 32128, 32154, 32182, 32197, 32201, 32232, 32256, 32277, 32301, 32311, 32312, 32313, 32335, 32351, 32359, 32385, 32386, 32387, 32398, 32399, 32423, 32432, 32445, 32449, 32458, 32465, 32490, 32500, 32537, 32548, 32554, 32574, 32577, 32617, 32670, 32683, 32687, 32698, 32728, 32729, 32739, 32747, 32750, 32754, 32771, 32774, 32775, 32796, 32815, 32820, 32831, 32832, 32843, 32847, 32862, 32864, 32876, 32878, 32946, 32956, 32985, 32986, 32990, 33020, 33047, 33054, 33103, 33122, 33123, 33135, 33155, 33156, 33171, 33180, 33181, 33182, 33215, 33216, 33217, 33218, 33219, 33220, 33221, 33222, 33223, 33224, 33225, 33226, 33227, 33228, 33229, 33230, 33231, 33232, 33233, 33234, 33235, 33236, 33237, 33238, 33239, 33240, 33241, 33242, 33243, 33244, 33245, 33246, 33247, 33248, 33249, 33250, 33251, 33252, 33253, 33254, 33255, 33256, 33257, 33258, 33259, 33260, 33261, 33262, 33263, 33264, 33265, 33266);
// //preg_match_all("/\((?P<id_message>\d+)\,([^)]+)\,\'(?P<year>\d{4})\-(?P<month>\d{2})\-(?P<day>\d{2})\ (?P<hour>\d{2})\:(?P<minute>\d{2})\:(?P<second>\d{2})\'\)/", $sFileContent, $asMatches);
// //(6632,7,'Dany','En tout cas elle a ̮̩t̮̩ maligne pour pas ̮̻tre lÃÆÃ pour le lavage de l\'appart ;)','U','2011-05-27 08:50:58')
// preg_match_all("/\((?P<id_message>\d+)\,(.+)\,\'(?P<year>\d{4})\-(?P<month>\d{2})\-(?P<day>\d{2})\ (?P<hour>\d{2})\:(?P<minute>\d{2})\:(?P<second>\d{2})\'\)/U", $sFileContent, $asMatches);
// $asMat = array();
// foreach($asMatches as $iKey=>$asMatch)
// {
// if(!is_numeric($iKey)) $asMat[$iKey] = $asMatch;
// }
// $sResult = '';
// foreach($asMat['id_message'] as $iKey=>$iMsgId)
// {
// $sLed = $asMat['year'][$iKey].'-'.$asMat['month'][$iKey].'-'.$asMat['day'][$iKey].' '.$asMat['hour'][$iKey].':'.$asMat['minute'][$iKey].':'.$asMat['second'][$iKey];
// if(strlen($sLed)==19 && in_array($iMsgId, $asToMatch)) $sResult .= "\nUPDATE messages2 SET led = '".$sLed."', date = DATE('".$sLed."') WHERE id_message = ".$iMsgId." LIMIT 1;";
// //if($iMsgId==6632) $sResult .= "\nUPDATE messages2 SET led = '".$sLed."', date = DATE('".$sLed."') WHERE id_message = ".$iMsgId." LIMIT 1;";
// }
// echo $sResult;
// $sSAPDomain = 'http://scn.sap.com';
// $sSAPBlogUrl = $sSAPDomain.'/community/data-warehousing/netweaver-bw/blog';
// $oDom = new DOMDocument;
// $oDom->loadHTML(file_get_contents($sSAPBlogUrl));
// $aoArticles = $oDom->getElementsByTagName('body')->item(0)->getElementsByTagName('header');
// foreach($aoArticles as $oArticle)
// {
// if($oArticle->getAttribute('class')=='jive-blog-post-subject')
// {
// $asArticleInfo = array();
// $aoLinks = $oArticle->getElementsByTagName('a');
// foreach($aoLinks as $oLink)
// {
// switch($oLink->getAttribute('class'))
// {
// //Title & link
// case 'font-color-normal':
// $asArticleInfo['item_title'] = ucfirst(trim($oLink->nodeValue));
// $asArticleInfo['item_title'] = substr($asArticleInfo['item_title'], -1)=='.'?substr($asArticleInfo['item_title'], 0, -1):$asArticleInfo['item_title'];
// $asArticleInfo['item_link'] = $oLink->getAttribute('href');
// $asArticleInfo['item_date'] = substr(str_replace(array($sSAPBlogUrl.'/', '/'), array('', '-'), $asArticleInfo['item_link']), 0, 10);
// break;
// //Author
// case 'jiveTT-hover-user jive-username-link':
// $asArticleInfo['author_name'] = ucwords(trim($oLink->nodeValue));
// $asArticleInfo['author_link'] = $sSAPDomain.$oLink->getAttribute('href');
// break;
// }
// }
// $asArticles[] = $asArticleInfo;
// }
// }
// print_r($asArticles);
//
//print_r($_SERVER);
?>