1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage FileSystem
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 /**
13 * String Controller
14 *
15 * @since 11.1
16 */
17 class JStringController
18 {
19 /**
20 * Defines a variable as an array
21 *
22 * @return array
23 *
24 * @since 11.1
25 */
26 public function _getArray()
27 {
28 static $strings = array();
29
30 return $strings;
31 }
32
33 /**
34 * Create a reference
35 *
36 * @param string $reference The key
37 * @param string &$string The value
38 *
39 * @return void
40 *
41 * @since 11.1
42 */
43 public function createRef($reference, &$string)
44 {
45 $ref = &self::_getArray();
46 $ref[$reference] = & $string;
47 }
48
49 /**
50 * Get reference
51 *
52 * @param string $reference The key for the reference.
53 *
54 * @return mixed False if not set, reference if it exists
55 *
56 * @since 11.1
57 */
58 public function getRef($reference)
59 {
60 $ref = &self::_getArray();
61
62 if (isset($ref[$reference]))
63 {
64 return $ref[$reference];
65 }
66 else
67 {
68 return false;
69 }
70 }
71 }
72