1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage String
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 use Joomla\String\StringHelper;
13
14 /**
15 * String handling class for utf-8 data
16 * Wraps the phputf8 library
17 * All functions assume the validity of utf-8 strings.
18 *
19 * @since 11.1
20 * @deprecated 4.0 Use {@link \Joomla\String\StringHelper} instead unless otherwise noted.
21 */
22 abstract class JString extends StringHelper
23 {
24 /**
25 * Split a string in camel case format
26 *
27 * "FooBarABCDef" becomes array("Foo", "Bar", "ABC", "Def");
28 * "JFooBar" becomes array("J", "Foo", "Bar");
29 * "J001FooBar002" becomes array("J001", "Foo", "Bar002");
30 * "abcDef" becomes array("abc", "Def");
31 * "abc_defGhi_Jkl" becomes array("abc_def", "Ghi_Jkl");
32 * "ThisIsA_NASAAstronaut" becomes array("This", "Is", "A_NASA", "Astronaut")),
33 * "JohnFitzgerald_Kennedy" becomes array("John", "Fitzgerald_Kennedy")),
34 *
35 * @param string $string The source string.
36 *
37 * @return array The splitted string.
38 *
39 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JStringNormalise::fromCamelCase()
40 * @since 11.3
41 */
42 public static function splitCamelCase($string)
43 {
44 JLog::add('JString::splitCamelCase has been deprecated. Use JStringNormalise::fromCamelCase.', JLog::WARNING, 'deprecated');
45
46 return JStringNormalise::fromCamelCase($string, true);
47 }
48
49 /**
50 * Does a UTF-8 safe version of PHP parse_url function
51 *
52 * @param string $url URL to parse
53 *
54 * @return mixed Associative array or false if badly formed URL.
55 *
56 * @link http://us3.php.net/manual/en/function.parse-url.php
57 * @since 11.1
58 * @deprecated 4.0 (CMS) - Use {@link \Joomla\Uri\UriHelper::parse_url()} instead.
59 */
60 public static function parse_url($url)
61 {
62 JLog::add('JString::parse_url has been deprecated. Use \\Joomla\\Uri\\UriHelper::parse_url.', JLog::WARNING, 'deprecated');
63
64 return \Joomla\Uri\UriHelper::parse_url($url);
65 }
66 }
67