@@ -441,17 +441,17 @@ discard block |
||
441 | 441 | * List of vowels and vowel sounds |
442 | 442 | */ |
443 | 443 | $v = array('a', 'e', 'i', 'o', 'u', 'ae', 'ou', 'io', |
444 | - 'ea', 'ou', 'ia', 'ai' |
|
445 | - ); |
|
444 | + 'ea', 'ou', 'ia', 'ai' |
|
445 | + ); |
|
446 | 446 | |
447 | 447 | /** |
448 | 448 | * List of consonants and consonant sounds |
449 | 449 | */ |
450 | 450 | $c = array('b', 'c', 'd', 'g', 'h', 'j', 'k', 'l', 'm', |
451 | - 'n', 'p', 'r', 's', 't', 'u', 'v', 'w', |
|
452 | - 'tr', 'cr', 'fr', 'dr', 'wr', 'pr', 'th', |
|
453 | - 'ch', 'ph', 'st', 'sl', 'cl' |
|
454 | - ); |
|
451 | + 'n', 'p', 'r', 's', 't', 'u', 'v', 'w', |
|
452 | + 'tr', 'cr', 'fr', 'dr', 'wr', 'pr', 'th', |
|
453 | + 'ch', 'ph', 'st', 'sl', 'cl' |
|
454 | + ); |
|
455 | 455 | |
456 | 456 | $v_count = 12; |
457 | 457 | $c_count = 29; |
@@ -484,50 +484,50 @@ discard block |
||
484 | 484 | /** |
485 | 485 | * List of character which could be use in the password |
486 | 486 | */ |
487 | - switch($chars) { |
|
487 | + switch($chars) { |
|
488 | 488 | |
489 | - case 'alphanumeric': |
|
489 | + case 'alphanumeric': |
|
490 | 490 | $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; |
491 | - $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 62; |
|
492 | - break; |
|
491 | + $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 62; |
|
492 | + break; |
|
493 | 493 | |
494 | - case 'alphabetical': |
|
494 | + case 'alphabetical': |
|
495 | 495 | $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
496 | - $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 52; |
|
497 | - break; |
|
496 | + $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 52; |
|
497 | + break; |
|
498 | 498 | |
499 | - case 'numeric': |
|
499 | + case 'numeric': |
|
500 | 500 | $chars = '0123456789'; |
501 | - $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 10; |
|
502 | - break; |
|
501 | + $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 10; |
|
502 | + break; |
|
503 | 503 | |
504 | - case '': |
|
504 | + case '': |
|
505 | 505 | $chars = '_#@%&ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; |
506 | - $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 67; |
|
507 | - break; |
|
506 | + $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 67; |
|
507 | + break; |
|
508 | 508 | |
509 | - default: |
|
509 | + default: |
|
510 | 510 | /** |
511 | 511 | * Some characters shouldn't be used |
512 | 512 | */ |
513 | 513 | $chars = trim($chars); |
514 | - $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars); |
|
515 | - |
|
516 | - $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = strlen($chars); |
|
517 | - } |
|
518 | - |
|
519 | - /** |
|
520 | - * Generate password |
|
521 | - */ |
|
522 | - for ($i = 0; $i < $length; $i++) { |
|
523 | - $num = mt_rand(0, $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] - 1); |
|
524 | - $password .= $chars{$num}; |
|
525 | - } |
|
526 | - |
|
527 | - /** |
|
528 | - * Return password |
|
529 | - */ |
|
530 | - return $password; |
|
514 | + $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars); |
|
515 | + |
|
516 | + $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = strlen($chars); |
|
517 | + } |
|
518 | + |
|
519 | + /** |
|
520 | + * Generate password |
|
521 | + */ |
|
522 | + for ($i = 0; $i < $length; $i++) { |
|
523 | + $num = mt_rand(0, $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] - 1); |
|
524 | + $password .= $chars{$num}; |
|
525 | + } |
|
526 | + |
|
527 | + /** |
|
528 | + * Return password |
|
529 | + */ |
|
530 | + return $password; |
|
531 | 531 | } |
532 | 532 | } |
533 | 533 | ?> |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $this->_edits = $this->_diff3($engine->diff($orig, $final1), |
49 | - $engine->diff($orig, $final2)); |
|
49 | + $engine->diff($orig, $final2)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | if ($edit->isConflict()) { |
59 | 59 | /* FIXME: this should probably be moved somewhere else. */ |
60 | 60 | $lines = array_merge($lines, |
61 | - array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), |
|
62 | - $edit->final1, |
|
63 | - array("======="), |
|
64 | - $edit->final2, |
|
65 | - array('>>>>>>>' . ($label2 ? ' ' . $label2 : ''))); |
|
61 | + array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), |
|
62 | + $edit->final1, |
|
63 | + array("======="), |
|
64 | + $edit->final2, |
|
65 | + array('>>>>>>>' . ($label2 ? ' ' . $label2 : ''))); |
|
66 | 66 | $this->_conflictingBlocks++; |
67 | 67 | } else { |
68 | 68 | $lines = array_merge($lines, $edit->merged()); |
@@ -129,13 +129,13 @@ |
||
129 | 129 | * preserve whitespace as well. Therefore we split on words, |
130 | 130 | * but include all blocks of whitespace in the wordlist. */ |
131 | 131 | $diff = new Text_Diff('native', |
132 | - array($this->_splitOnWords($text1, $nl), |
|
132 | + array($this->_splitOnWords($text1, $nl), |
|
133 | 133 | $this->_splitOnWords($text2, $nl))); |
134 | 134 | |
135 | 135 | /* Get the diff in inline format. */ |
136 | 136 | $renderer = new Text_Diff_Renderer_inline |
137 | 137 | (array_merge($this->getParams(), |
138 | - array('split_level' => 'words'))); |
|
138 | + array('split_level' => 'words'))); |
|
139 | 139 | |
140 | 140 | /* Run the diff and get the output. */ |
141 | 141 | return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | } |
105 | 105 | /* @todo */ |
106 | 106 | $output .= $this->_block($x0, $ntrail + $xi - $x0, |
107 | - $y0, $ntrail + $yi - $y0, |
|
108 | - $block); |
|
107 | + $y0, $ntrail + $yi - $y0, |
|
108 | + $block); |
|
109 | 109 | $block = false; |
110 | 110 | } |
111 | 111 | } |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | |
137 | 137 | if (is_array($block)) { |
138 | 138 | $output .= $this->_block($x0, $xi - $x0, |
139 | - $y0, $yi - $y0, |
|
140 | - $block); |
|
139 | + $y0, $yi - $y0, |
|
140 | + $block); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | return $output . $this->_endDiff(); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * of elements as $to_lines. |
30 | 30 | */ |
31 | 31 | function Text_Diff_Mapped($from_lines, $to_lines, |
32 | - $mapped_from_lines, $mapped_to_lines) |
|
32 | + $mapped_from_lines, $mapped_to_lines) |
|
33 | 33 | { |
34 | 34 | assert(count($from_lines) == count($mapped_from_lines)); |
35 | 35 | assert(count($to_lines) == count($mapped_to_lines)); |
@@ -124,9 +124,9 @@ |
||
124 | 124 | array_push($edits, |
125 | 125 | new Text_Diff_Op_copy( |
126 | 126 | $this->_getLines($from_lines, $from_line_no, |
127 | - $from_line_no + count($from_lines) - 1), |
|
127 | + $from_line_no + count($from_lines) - 1), |
|
128 | 128 | $this->_getLines($to_lines, $to_line_no, |
129 | - $to_line_no + count($to_lines) - 1))); |
|
129 | + $to_line_no + count($to_lines) - 1))); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | return $edits; |
@@ -6,17 +6,17 @@ |
||
6 | 6 | class PEAR5 |
7 | 7 | { |
8 | 8 | /** |
9 | - * If you have a class that's mostly/entirely static, and you need static |
|
10 | - * properties, you can use this method to simulate them. Eg. in your method(s) |
|
11 | - * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar'); |
|
12 | - * You MUST use a reference, or they will not persist! |
|
13 | - * |
|
14 | - * @access public |
|
15 | - * @param string $class The calling classname, to prevent clashes |
|
16 | - * @param string $var The variable to retrieve. |
|
17 | - * @return mixed A reference to the variable. If not set it will be |
|
18 | - * auto initialised to NULL. |
|
19 | - */ |
|
9 | + * If you have a class that's mostly/entirely static, and you need static |
|
10 | + * properties, you can use this method to simulate them. Eg. in your method(s) |
|
11 | + * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar'); |
|
12 | + * You MUST use a reference, or they will not persist! |
|
13 | + * |
|
14 | + * @access public |
|
15 | + * @param string $class The calling classname, to prevent clashes |
|
16 | + * @param string $var The variable to retrieve. |
|
17 | + * @return mixed A reference to the variable. If not set it will be |
|
18 | + * auto initialised to NULL. |
|
19 | + */ |
|
20 | 20 | static function &getStaticProperty($class, $var) |
21 | 21 | { |
22 | 22 | static $properties; |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | { |
235 | 235 | $trace = $this->getTraceSafe(); |
236 | 236 | $cause = array('class' => get_class($this), |
237 | - 'message' => $this->message, |
|
238 | - 'file' => 'unknown', |
|
239 | - 'line' => 'unknown'); |
|
237 | + 'message' => $this->message, |
|
238 | + 'file' => 'unknown', |
|
239 | + 'line' => 'unknown'); |
|
240 | 240 | if (isset($trace[0])) { |
241 | 241 | if (isset($trace[0]['file'])) { |
242 | 242 | $cause['file'] = $trace[0]['file']; |
@@ -248,28 +248,28 @@ discard block |
||
248 | 248 | $this->cause->getCauseMessage($causes); |
249 | 249 | } elseif ($this->cause instanceof Exception) { |
250 | 250 | $causes[] = array('class' => get_class($this->cause), |
251 | - 'message' => $this->cause->getMessage(), |
|
252 | - 'file' => $this->cause->getFile(), |
|
253 | - 'line' => $this->cause->getLine()); |
|
251 | + 'message' => $this->cause->getMessage(), |
|
252 | + 'file' => $this->cause->getFile(), |
|
253 | + 'line' => $this->cause->getLine()); |
|
254 | 254 | } elseif (class_exists('PEAR_Error') && $this->cause instanceof PEAR_Error) { |
255 | 255 | $causes[] = array('class' => get_class($this->cause), |
256 | - 'message' => $this->cause->getMessage(), |
|
257 | - 'file' => 'unknown', |
|
258 | - 'line' => 'unknown'); |
|
256 | + 'message' => $this->cause->getMessage(), |
|
257 | + 'file' => 'unknown', |
|
258 | + 'line' => 'unknown'); |
|
259 | 259 | } elseif (is_array($this->cause)) { |
260 | 260 | foreach ($this->cause as $cause) { |
261 | 261 | if ($cause instanceof PEAR_Exception) { |
262 | 262 | $cause->getCauseMessage($causes); |
263 | 263 | } elseif ($cause instanceof Exception) { |
264 | 264 | $causes[] = array('class' => get_class($cause), |
265 | - 'message' => $cause->getMessage(), |
|
266 | - 'file' => $cause->getFile(), |
|
267 | - 'line' => $cause->getLine()); |
|
265 | + 'message' => $cause->getMessage(), |
|
266 | + 'file' => $cause->getFile(), |
|
267 | + 'line' => $cause->getLine()); |
|
268 | 268 | } elseif (class_exists('PEAR_Error') && $cause instanceof PEAR_Error) { |
269 | 269 | $causes[] = array('class' => get_class($cause), |
270 | - 'message' => $cause->getMessage(), |
|
271 | - 'file' => 'unknown', |
|
272 | - 'line' => 'unknown'); |
|
270 | + 'message' => $cause->getMessage(), |
|
271 | + 'file' => 'unknown', |
|
272 | + 'line' => 'unknown'); |
|
273 | 273 | } elseif (is_array($cause) && isset($cause['message'])) { |
274 | 274 | // PEAR_ErrorStack warning |
275 | 275 | $causes[] = array( |
@@ -327,19 +327,19 @@ discard block |
||
327 | 327 | $html = '<table style="border: 1px" cellspacing="0">' . "\n"; |
328 | 328 | foreach ($causes as $i => $cause) { |
329 | 329 | $html .= '<tr><td colspan="3" style="background: #ff9999">' |
330 | - . str_repeat('-', $i) . ' <b>' . $cause['class'] . '</b>: ' |
|
331 | - . htmlspecialchars($cause['message']) . ' in <b>' . $cause['file'] . '</b> ' |
|
332 | - . 'on line <b>' . $cause['line'] . '</b>' |
|
333 | - . "</td></tr>\n"; |
|
330 | + . str_repeat('-', $i) . ' <b>' . $cause['class'] . '</b>: ' |
|
331 | + . htmlspecialchars($cause['message']) . ' in <b>' . $cause['file'] . '</b> ' |
|
332 | + . 'on line <b>' . $cause['line'] . '</b>' |
|
333 | + . "</td></tr>\n"; |
|
334 | 334 | } |
335 | 335 | $html .= '<tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr>' . "\n" |
336 | - . '<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td>' |
|
337 | - . '<td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td>' |
|
338 | - . '<td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>' . "\n"; |
|
336 | + . '<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td>' |
|
337 | + . '<td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td>' |
|
338 | + . '<td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>' . "\n"; |
|
339 | 339 | |
340 | 340 | foreach ($trace as $k => $v) { |
341 | 341 | $html .= '<tr><td style="text-align: center;">' . $k . '</td>' |
342 | - . '<td>'; |
|
342 | + . '<td>'; |
|
343 | 343 | if (!empty($v['class'])) { |
344 | 344 | $html .= $v['class'] . $v['type']; |
345 | 345 | } |
@@ -361,15 +361,15 @@ discard block |
||
361 | 361 | } |
362 | 362 | } |
363 | 363 | $html .= '(' . implode(', ',$args) . ')' |
364 | - . '</td>' |
|
365 | - . '<td>' . (isset($v['file']) ? $v['file'] : 'unknown') |
|
366 | - . ':' . (isset($v['line']) ? $v['line'] : 'unknown') |
|
367 | - . '</td></tr>' . "\n"; |
|
364 | + . '</td>' |
|
365 | + . '<td>' . (isset($v['file']) ? $v['file'] : 'unknown') |
|
366 | + . ':' . (isset($v['line']) ? $v['line'] : 'unknown') |
|
367 | + . '</td></tr>' . "\n"; |
|
368 | 368 | } |
369 | 369 | $html .= '<tr><td style="text-align: center;">' . ($k+1) . '</td>' |
370 | - . '<td>{main}</td>' |
|
371 | - . '<td> </td></tr>' . "\n" |
|
372 | - . '</table>'; |
|
370 | + . '<td>{main}</td>' |
|
371 | + . '<td> </td></tr>' . "\n" |
|
372 | + . '</table>'; |
|
373 | 373 | return $html; |
374 | 374 | } |
375 | 375 | |
@@ -380,8 +380,8 @@ discard block |
||
380 | 380 | $causeMsg = ''; |
381 | 381 | foreach ($causes as $i => $cause) { |
382 | 382 | $causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': ' |
383 | - . $cause['message'] . ' in ' . $cause['file'] |
|
384 | - . ' on line ' . $cause['line'] . "\n"; |
|
383 | + . $cause['message'] . ' in ' . $cause['file'] |
|
384 | + . ' on line ' . $cause['line'] . "\n"; |
|
385 | 385 | } |
386 | 386 | return $causeMsg . $this->getTraceAsString(); |
387 | 387 | } |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | $href = htmlentities($this->pager->_url . str_replace('%d', $selector, $this->pager->_fileName), ENT_COMPAT, 'UTF-8'); |
154 | 154 | } |
155 | 155 | $tmp .= ' onchange="document.location.href=\'' |
156 | - . $href .'\'' |
|
157 | - . '"'; |
|
156 | + . $href .'\'' |
|
157 | + . '"'; |
|
158 | 158 | } elseif ($this->pager->_httpMethod == 'POST') { |
159 | 159 | $tmp .= " onchange='" |
160 | - . $this->pager->_generateFormOnClick($this->pager->_url, $this->pager->_linkData) |
|
161 | - . "'"; |
|
160 | + . $this->pager->_generateFormOnClick($this->pager->_url, $this->pager->_linkData) |
|
161 | + . "'"; |
|
162 | 162 | $tmp = preg_replace( |
163 | 163 | '/(input\.name = \"'.$this->pager->_sessionVar.'\"; input\.value =) \"(\d+)\";/', |
164 | 164 | '\\1 this.options[this.selectedIndex].value;', |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | // |
260 | 260 | } |
261 | 261 | $tmp .= ' onchange="javascript: document.location.href=\'' |
262 | - . $href .'\'' |
|
263 | - . '"'; |
|
262 | + . $href .'\'' |
|
263 | + . '"'; |
|
264 | 264 | } elseif ($this->pager->_httpMethod == 'POST') { |
265 | 265 | $tmp .= " onchange='" |
266 | - . $this->pager->_generateFormOnClick($this->pager->_url, $this->pager->_linkData) |
|
267 | - . "'"; |
|
266 | + . $this->pager->_generateFormOnClick($this->pager->_url, $this->pager->_linkData) |
|
267 | + . "'"; |
|
268 | 268 | $tmp = preg_replace( |
269 | 269 | '/(input\.name = \"'.$this->pager->_urlVar.'\"; input\.value =) \"(\d+)\";/', |
270 | 270 | '\\1 this.options[this.selectedIndex].value;', |