-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
language.php
1426 lines (1246 loc) · 30 KB
/
language.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @package Joomla.Platform
* @subpackage Language
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Allows for quoting in language .ini files.
*/
define('_QQ_', '"');
/**
* Languages/translation handler class
*
* @since 11.1
*/
class JLanguage
{
/**
* Array of JLanguage objects
*
* @var JLanguage[]
* @since 11.1
*/
protected static $languages = array();
/**
* Debug language, If true, highlights if string isn't found.
*
* @var boolean
* @since 11.1
*/
protected $debug = false;
/**
* The default language, used when a language file in the requested language does not exist.
*
* @var string
* @since 11.1
*/
protected $default = 'en-GB';
/**
* An array of orphaned text.
*
* @var array
* @since 11.1
*/
protected $orphans = array();
/**
* Array holding the language metadata.
*
* @var array
* @since 11.1
*/
protected $metadata = null;
/**
* Array holding the language locale or boolean null if none.
*
* @var array|boolean
* @since 11.1
*/
protected $locale = null;
/**
* The language to load.
*
* @var string
* @since 11.1
*/
protected $lang = null;
/**
* A nested array of language files that have been loaded
*
* @var array
* @since 11.1
*/
protected $paths = array();
/**
* List of language files that are in error state
*
* @var array
* @since 11.1
*/
protected $errorfiles = array();
/**
* Translations
*
* @var array
* @since 11.1
*/
protected $strings = array();
/**
* An array of used text, used during debugging.
*
* @var array
* @since 11.1
*/
protected $used = array();
/**
* Counter for number of loads.
*
* @var integer
* @since 11.1
*/
protected $counter = 0;
/**
* An array used to store overrides.
*
* @var array
* @since 11.1
*/
protected $override = array();
/**
* Name of the transliterator function for this language.
*
* @var string
* @since 11.1
*/
protected $transliterator = null;
/**
* Name of the pluralSuffixesCallback function for this language.
*
* @var callable
* @since 11.1
*/
protected $pluralSuffixesCallback = null;
/**
* Name of the ignoredSearchWordsCallback function for this language.
*
* @var callable
* @since 11.1
*/
protected $ignoredSearchWordsCallback = null;
/**
* Name of the lowerLimitSearchWordCallback function for this language.
*
* @var callable
* @since 11.1
*/
protected $lowerLimitSearchWordCallback = null;
/**
* Name of the uppperLimitSearchWordCallback function for this language.
*
* @var callable
* @since 11.1
*/
protected $upperLimitSearchWordCallback = null;
/**
* Name of the searchDisplayedCharactersNumberCallback function for this language.
*
* @var callable
* @since 11.1
*/
protected $searchDisplayedCharactersNumberCallback = null;
/**
* Constructor activating the default information of the language.
*
* @param string $lang The language
* @param boolean $debug Indicates if language debugging is enabled.
*
* @since 11.1
*/
public function __construct($lang = null, $debug = false)
{
$this->strings = array();
if ($lang == null)
{
$lang = $this->default;
}
$this->lang = $lang;
$this->metadata = $this->getMetadata($this->lang);
$this->setDebug($debug);
$filename = JPATH_BASE . "/language/overrides/$lang.override.ini";
if (file_exists($filename) && $contents = $this->parse($filename))
{
if (is_array($contents))
{
// Sort the underlying heap by key values to optimize merging
ksort($contents, SORT_STRING);
$this->override = $contents;
}
unset($contents);
}
// Look for a language specific localise class
$class = str_replace('-', '_', $lang . 'Localise');
$paths = array();
if (defined('JPATH_SITE'))
{
// Note: Manual indexing to enforce load order.
$paths[0] = JPATH_SITE . "/language/overrides/$lang.localise.php";
$paths[2] = JPATH_SITE . "/language/$lang/$lang.localise.php";
}
if (defined('JPATH_ADMINISTRATOR'))
{
// Note: Manual indexing to enforce load order.
$paths[1] = JPATH_ADMINISTRATOR . "/language/overrides/$lang.localise.php";
$paths[3] = JPATH_ADMINISTRATOR . "/language/$lang/$lang.localise.php";
}
ksort($paths);
$path = reset($paths);
while (!class_exists($class) && $path)
{
if (file_exists($path))
{
require_once $path;
}
$path = next($paths);
}
if (class_exists($class))
{
/* Class exists. Try to find
* -a transliterate method,
* -a getPluralSuffixes method,
* -a getIgnoredSearchWords method
* -a getLowerLimitSearchWord method
* -a getUpperLimitSearchWord method
* -a getSearchDisplayCharactersNumber method
*/
if (method_exists($class, 'transliterate'))
{
$this->transliterator = array($class, 'transliterate');
}
if (method_exists($class, 'getPluralSuffixes'))
{
$this->pluralSuffixesCallback = array($class, 'getPluralSuffixes');
}
if (method_exists($class, 'getIgnoredSearchWords'))
{
$this->ignoredSearchWordsCallback = array($class, 'getIgnoredSearchWords');
}
if (method_exists($class, 'getLowerLimitSearchWord'))
{
$this->lowerLimitSearchWordCallback = array($class, 'getLowerLimitSearchWord');
}
if (method_exists($class, 'getUpperLimitSearchWord'))
{
$this->upperLimitSearchWordCallback = array($class, 'getUpperLimitSearchWord');
}
if (method_exists($class, 'getSearchDisplayedCharactersNumber'))
{
$this->searchDisplayedCharactersNumberCallback = array($class, 'getSearchDisplayedCharactersNumber');
}
}
$this->load();
}
/**
* Returns a language object.
*
* @param string $lang The language to use.
* @param boolean $debug The debug mode.
*
* @return JLanguage The Language object.
*
* @since 11.1
*/
public static function getInstance($lang, $debug = false)
{
if (!isset(self::$languages[$lang . $debug]))
{
self::$languages[$lang . $debug] = new JLanguage($lang, $debug);
}
return self::$languages[$lang . $debug];
}
/**
* Translate function, mimics the php gettext (alias _) function.
*
* The function checks if $jsSafe is true, then if $interpretBackslashes is true.
*
* @param string $string The string to translate
* @param boolean $jsSafe Make the result javascript safe
* @param boolean $interpretBackSlashes Interpret \t and \n
*
* @return string The translation of the string
*
* @since 11.1
*/
public function _($string, $jsSafe = false, $interpretBackSlashes = true)
{
// Detect empty string
if ($string == '')
{
return '';
}
$key = strtoupper($string);
if (isset($this->strings[$key]))
{
$string = $this->debug ? '**' . $this->strings[$key] . '**' : $this->strings[$key];
// Store debug information
if ($this->debug)
{
$caller = $this->getCallerInfo();
if (!array_key_exists($key, $this->used))
{
$this->used[$key] = array();
}
$this->used[$key][] = $caller;
}
}
else
{
if ($this->debug)
{
$caller = $this->getCallerInfo();
$caller['string'] = $string;
if (!array_key_exists($key, $this->orphans))
{
$this->orphans[$key] = array();
}
$this->orphans[$key][] = $caller;
$string = '??' . $string . '??';
}
}
if ($jsSafe)
{
// Javascript filter
$string = addslashes($string);
}
elseif ($interpretBackSlashes)
{
if (strpos($string, '\\') !== false)
{
// Interpret \n and \t characters
$string = str_replace(array('\\\\', '\t', '\n'), array("\\", "\t", "\n"), $string);
}
}
return $string;
}
/**
* Transliterate function
*
* This method processes a string and replaces all accented UTF-8 characters by unaccented
* ASCII-7 "equivalents".
*
* @param string $string The string to transliterate.
*
* @return string The transliteration of the string.
*
* @since 11.1
*/
public function transliterate($string)
{
if ($this->transliterator !== null)
{
return call_user_func($this->transliterator, $string);
}
$string = JLanguageTransliterate::utf8_latin_to_ascii($string);
$string = JString::strtolower($string);
return $string;
}
/**
* Getter for transliteration function
*
* @return callable The transliterator function
*
* @since 11.1
*/
public function getTransliterator()
{
return $this->transliterator;
}
/**
* Set the transliteration function.
*
* @param callable $function Function name or the actual function.
*
* @return callable The previous function.
*
* @since 11.1
*/
public function setTransliterator($function)
{
$previous = $this->transliterator;
$this->transliterator = $function;
return $previous;
}
/**
* Returns an array of suffixes for plural rules.
*
* @param integer $count The count number the rule is for.
*
* @return array The array of suffixes.
*
* @since 11.1
*/
public function getPluralSuffixes($count)
{
if ($this->pluralSuffixesCallback !== null)
{
return call_user_func($this->pluralSuffixesCallback, $count);
}
else
{
return array((string) $count);
}
}
/**
* Getter for pluralSuffixesCallback function.
*
* @return callable Function name or the actual function.
*
* @since 11.1
*/
public function getPluralSuffixesCallback()
{
return $this->pluralSuffixesCallback;
}
/**
* Set the pluralSuffixes function.
*
* @param callable $function Function name or actual function.
*
* @return callable The previous function.
*
* @since 11.1
*/
public function setPluralSuffixesCallback($function)
{
$previous = $this->pluralSuffixesCallback;
$this->pluralSuffixesCallback = $function;
return $previous;
}
/**
* Returns an array of ignored search words
*
* @return array The array of ignored search words.
*
* @since 11.1
*/
public function getIgnoredSearchWords()
{
if ($this->ignoredSearchWordsCallback !== null)
{
return call_user_func($this->ignoredSearchWordsCallback);
}
else
{
return array();
}
}
/**
* Getter for ignoredSearchWordsCallback function.
*
* @return callable Function name or the actual function.
*
* @since 11.1
*/
public function getIgnoredSearchWordsCallback()
{
return $this->ignoredSearchWordsCallback;
}
/**
* Setter for the ignoredSearchWordsCallback function
*
* @param callable $function Function name or actual function.
*
* @return callable The previous function.
*
* @since 11.1
*/
public function setIgnoredSearchWordsCallback($function)
{
$previous = $this->ignoredSearchWordsCallback;
$this->ignoredSearchWordsCallback = $function;
return $previous;
}
/**
* Returns a lower limit integer for length of search words
*
* @return integer The lower limit integer for length of search words (3 if no value was set for a specific language).
*
* @since 11.1
*/
public function getLowerLimitSearchWord()
{
if ($this->lowerLimitSearchWordCallback !== null)
{
return call_user_func($this->lowerLimitSearchWordCallback);
}
else
{
return 3;
}
}
/**
* Getter for lowerLimitSearchWordCallback function
*
* @return callable Function name or the actual function.
*
* @since 11.1
*/
public function getLowerLimitSearchWordCallback()
{
return $this->lowerLimitSearchWordCallback;
}
/**
* Setter for the lowerLimitSearchWordCallback function.
*
* @param callable $function Function name or actual function.
*
* @return callable The previous function.
*
* @since 11.1
*/
public function setLowerLimitSearchWordCallback($function)
{
$previous = $this->lowerLimitSearchWordCallback;
$this->lowerLimitSearchWordCallback = $function;
return $previous;
}
/**
* Returns an upper limit integer for length of search words
*
* @return integer The upper limit integer for length of search words (200 if no value was set or if default value is < 200).
*
* @since 11.1
*/
public function getUpperLimitSearchWord()
{
if ($this->upperLimitSearchWordCallback !== null && call_user_func($this->upperLimitSearchWordCallback) > 200)
{
return call_user_func($this->upperLimitSearchWordCallback);
}
return 200;
}
/**
* Getter for upperLimitSearchWordCallback function
*
* @return callable Function name or the actual function.
*
* @since 11.1
*/
public function getUpperLimitSearchWordCallback()
{
return $this->upperLimitSearchWordCallback;
}
/**
* Setter for the upperLimitSearchWordCallback function
*
* @param callable $function Function name or the actual function.
*
* @return callable The previous function.
*
* @since 11.1
*/
public function setUpperLimitSearchWordCallback($function)
{
$previous = $this->upperLimitSearchWordCallback;
$this->upperLimitSearchWordCallback = $function;
return $previous;
}
/**
* Returns the number of characters displayed in search results.
*
* @return integer The number of characters displayed (200 if no value was set for a specific language).
*
* @since 11.1
*/
public function getSearchDisplayedCharactersNumber()
{
if ($this->searchDisplayedCharactersNumberCallback !== null)
{
return call_user_func($this->searchDisplayedCharactersNumberCallback);
}
else
{
return 200;
}
}
/**
* Getter for searchDisplayedCharactersNumberCallback function
*
* @return callable Function name or the actual function.
*
* @since 11.1
*/
public function getSearchDisplayedCharactersNumberCallback()
{
return $this->searchDisplayedCharactersNumberCallback;
}
/**
* Setter for the searchDisplayedCharactersNumberCallback function.
*
* @param callable $function Function name or the actual function.
*
* @return callable The previous function.
*
* @since 11.1
*/
public function setSearchDisplayedCharactersNumberCallback($function)
{
$previous = $this->searchDisplayedCharactersNumberCallback;
$this->searchDisplayedCharactersNumberCallback = $function;
return $previous;
}
/**
* Checks if a language exists.
*
* This is a simple, quick check for the directory that should contain language files for the given user.
*
* @param string $lang Language to check.
* @param string $basePath Optional path to check.
*
* @return boolean True if the language exists.
*
* @since 11.1
*/
public static function exists($lang, $basePath = JPATH_BASE)
{
static $paths = array();
// Return false if no language was specified
if (!$lang)
{
return false;
}
$path = $basePath . '/language/' . $lang;
// Return previous check results if it exists
if (isset($paths[$path]))
{
return $paths[$path];
}
// Check if the language exists
$paths[$path] = is_dir($path);
return $paths[$path];
}
/**
* Loads a single language file and appends the results to the existing strings
*
* @param string $extension The extension for which a language file should be loaded.
* @param string $basePath The basepath to use.
* @param string $lang The language to load, default null for the current language.
* @param boolean $reload Flag that will force a language to be reloaded if set to true.
* @param boolean $default Flag that force the default language to be loaded if the current does not exist.
*
* @return boolean True if the file has successfully loaded.
*
* @since 11.1
*/
public function load($extension = 'joomla', $basePath = JPATH_BASE, $lang = null, $reload = false, $default = true)
{
// If language is null set as the current language.
if (!$lang)
{
$lang = $this->lang;
}
// Load the default language first if we're not debugging and a non-default language is requested to be loaded
// with $default set to true
if (!$this->debug && ($lang != $this->default) && $default)
{
$this->load($extension, $basePath, $this->default, false, true);
}
$path = self::getLanguagePath($basePath, $lang);
$internal = $extension == 'joomla' || $extension == '';
$filename = $internal ? $lang : $lang . '.' . $extension;
$filename = "$path/$filename.ini";
if (isset($this->paths[$extension][$filename]) && !$reload)
{
// This file has already been tested for loading.
$result = $this->paths[$extension][$filename];
}
else
{
// Load the language file
$result = $this->loadLanguage($filename, $extension);
// Check whether there was a problem with loading the file
if ($result === false && $default)
{
// No strings, so either file doesn't exist or the file is invalid
$oldFilename = $filename;
// Check the standard file name
$path = self::getLanguagePath($basePath, $this->default);
$filename = $internal ? $this->default : $this->default . '.' . $extension;
$filename = "$path/$filename.ini";
// If the one we tried is different than the new name, try again
if ($oldFilename != $filename)
{
$result = $this->loadLanguage($filename, $extension, false);
}
}
}
return $result;
}
/**
* Loads a language file.
*
* This method will not note the successful loading of a file - use load() instead.
*
* @param string $filename The name of the file.
* @param string $extension The name of the extension.
*
* @return boolean True if new strings have been added to the language
*
* @see JLanguage::load()
* @since 11.1
*/
protected function loadLanguage($filename, $extension = 'unknown')
{
$this->counter++;
$result = false;
$strings = false;
if (file_exists($filename))
{
$strings = $this->parse($filename);
}
if ($strings)
{
if (is_array($strings) && count($strings))
{
$this->strings = array_replace($this->strings, $strings, $this->override);
$result = true;
}
}
// Record the result of loading the extension's file.
if (!isset($this->paths[$extension]))
{
$this->paths[$extension] = array();
}
$this->paths[$extension][$filename] = $result;
return $result;
}
/**
* Parses a language file.
*
* @param string $filename The name of the file.
*
* @return array The array of parsed strings.
*
* @since 11.1
*/
protected function parse($filename)
{
if ($this->debug)
{
// Capture hidden PHP errors from the parsing.
$php_errormsg = null;
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
}
$contents = file_get_contents($filename);
$contents = str_replace('_QQ_', '"\""', $contents);
$strings = @parse_ini_string($contents);
if (!is_array($strings))
{
$strings = array();
}
if ($this->debug)
{
// Restore error tracking to what it was before.
ini_set('track_errors', $track_errors);
$this->debugFile($filename);
}
return $strings;
}
/**
* Debugs a language file
*
* @param string $filename Absolute path to the file to debug
*
* @return integer A count of the number of parsing errors
*
* @since 3.6.3
* @throws InvalidArgumentException
*/
public function debugFile($filename)
{
// Make sure our file actually exists
if (!file_exists($filename))
{
throw new InvalidArgumentException(
sprintf('Unable to locate file "%s" for debugging', $filename)
);
}
// Initialise variables for manually parsing the file for common errors.
$blacklist = array('YES', 'NO', 'NULL', 'FALSE', 'ON', 'OFF', 'NONE', 'TRUE');
$debug = $this->getDebug();
$this->debug = false;
$errors = array();
$php_errormsg = null;
// Open the file as a stream.
$file = new SplFileObject($filename);
foreach ($file as $lineNumber => $line)
{
// Avoid BOM error as BOM is OK when using parse_ini.
if ($lineNumber == 0)
{
$line = str_replace("\xEF\xBB\xBF", '', $line);
}
$line = trim($line);
// Ignore comment lines.
if (!strlen($line) || $line['0'] == ';')
{
continue;
}
// Ignore grouping tag lines, like: [group]
if (preg_match('#^\[[^\]]*\](\s*;.*)?$#', $line))
{
continue;
}
// Remove the "_QQ_" from the equation
$line = str_replace('"_QQ_"', '', $line);
$realNumber = $lineNumber + 1;
// Check for any incorrect uses of _QQ_.
if (strpos($line, '_QQ_') !== false)
{
$errors[] = $realNumber;
continue;
}
// Check for odd number of double quotes.
if (substr_count($line, '"') % 2 != 0)
{
$errors[] = $realNumber;
continue;
}
// Check that the line passes the necessary format.
if (!preg_match('#^[A-Z][A-Z0-9_\*\-\.]*\s*=\s*".*"(\s*;.*)?$#', $line))
{
$errors[] = $realNumber;
continue;
}
// Check that the key is not in the blacklist.
$key = strtoupper(trim(substr($line, 0, strpos($line, '='))));
if (in_array($key, $blacklist))
{
$errors[] = $realNumber;
}
}
// Check if we encountered any errors.
if (count($errors))
{
$this->errorfiles[$filename] = $filename . ' : error(s) in line(s) ' . implode(', ', $errors);
}
elseif ($php_errormsg)
{
// We didn't find any errors but there's probably a parse notice.
$this->errorfiles['PHP' . $filename] = 'PHP parser errors :' . $php_errormsg;
}
$this->debug = $debug;
return count($errors);
}
/**
* Get a metadata language property.
*
* @param string $property The name of the property.
* @param mixed $default The default value.
*
* @return mixed The value of the property.
*
* @since 11.1
*/
public function get($property, $default = null)
{
if (isset($this->metadata[$property]))
{
return $this->metadata[$property];
}
return $default;
}
/**
* Determine who called JLanguage or JText.
*
* @return array Caller information.
*
* @since 11.1
*/
protected function getCallerInfo()
{
// Try to determine the source if none was provided
if (!function_exists('debug_backtrace'))
{
return;
}
$backtrace = debug_backtrace();
$info = array();