| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/string.tar |
string.php 0000604 00000004137 15245561153 0006573 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage String
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
use Joomla\String\StringHelper;
/**
* String handling class for utf-8 data
* Wraps the phputf8 library
* All functions assume the validity of utf-8 strings.
*
* @since 1.7.0
* @deprecated 4.0 Use {@link \Joomla\String\StringHelper} instead unless otherwise noted.
*/
abstract class JString extends StringHelper
{
/**
* Split a string in camel case format
*
* "FooBarABCDef" becomes array("Foo", "Bar", "ABC", "Def");
* "JFooBar" becomes array("J", "Foo", "Bar");
* "J001FooBar002" becomes array("J001", "Foo", "Bar002");
* "abcDef" becomes array("abc", "Def");
* "abc_defGhi_Jkl" becomes array("abc_def", "Ghi_Jkl");
* "ThisIsA_NASAAstronaut" becomes array("This", "Is", "A_NASA", "Astronaut")),
* "JohnFitzgerald_Kennedy" becomes array("John", "Fitzgerald_Kennedy")),
*
* @param string $string The source string.
*
* @return array The splitted string.
*
* @deprecated 4.0 - Use JStringNormalise::fromCamelCase()
* @since 1.7.3
*/
public static function splitCamelCase($string)
{
JLog::add('JString::splitCamelCase has been deprecated. Use JStringNormalise::fromCamelCase.', JLog::WARNING, 'deprecated');
return JStringNormalise::fromCamelCase($string, true);
}
/**
* Does a UTF-8 safe version of PHP parse_url function
*
* @param string $url URL to parse
*
* @return mixed Associative array or false if badly formed URL.
*
* @link http://us3.php.net/manual/en/function.parse-url.php
* @since 1.7.0
* @deprecated 4.0 (CMS) - Use {@link \Joomla\Uri\UriHelper::parse_url()} instead.
*/
public static function parse_url($url)
{
JLog::add('JString::parse_url has been deprecated. Use \\Joomla\\Uri\\UriHelper::parse_url.', JLog::WARNING, 'deprecated');
return \Joomla\Uri\UriHelper::parse_url($url);
}
}
index.html 0000604 00000000037 15245561153 0006544 0 ustar 00 <!DOCTYPE html><title></title>
wrapper/punycode.php 0000604 00000004660 15245561316 0010575 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage String
*
* @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
JLoader::register('idna_convert', JPATH_LIBRARIES . '/idna_convert/idna_convert.class.php');
/**
* Wrapper class for JStringPunycode
*
* @package Joomla.Platform
* @subpackage String
* @since 3.4
* @deprecated 4.0 Will be removed without replacement
*/
class JStringWrapperPunycode
{
/**
* Helper wrapper method for toPunycode
*
* @param string $utfString The UTF-8 string to transform.
*
* @return string The punycode string.
*
* @see JUserHelper::toPunycode()
* @since 3.4
*/
public function toPunycode($utfString)
{
return JStringPunycode::toPunycode($utfString);
}
/**
* Helper wrapper method for fromPunycode
*
* @param string $punycodeString The Punycode string to transform.
*
* @return string The UF-8 URL.
*
* @see JUserHelper::fromPunycode()
* @since 3.4
*/
public function fromPunycode($punycodeString)
{
return JStringPunycode::fromPunycode($punycodeString);
}
/**
* Helper wrapper method for urlToPunycode
*
* @param string $uri The UTF-8 URL to transform.
*
* @return string The punycode URL.
*
* @see JUserHelper::urlToPunycode()
* @since 3.4
*/
public function urlToPunycode($uri)
{
return JStringPunycode::urlToPunycode($uri);
}
/**
* Helper wrapper method for urlToUTF8
*
* @param string $uri The Punycode URL to transform.
*
* @return string The UTF-8 URL.
*
* @see JStringPunycode::urlToUTF8()
* @since 3.4
*/
public function urlToUTF8($uri)
{
return JStringPunycode::urlToUTF8($uri);
}
/**
* Helper wrapper method for emailToPunycode
*
* @param string $email The UTF-8 email to transform.
*
* @return string The punycode email.
*
* @see JStringPunycode::emailToPunycode()
* @since 3.4
*/
public function emailToPunycode($email)
{
return JStringPunycode::emailToPunycode($email);
}
/**
* Helper wrapper method for emailToUTF8
*
* @param string $email The punycode email to transform.
*
* @return string The punycode email.
*
* @see JStringPunycode::emailToUTF8()
* @since 3.4
*/
public function emailToUTF8($email)
{
return JStringPunycode::emailToUTF8($email);
}
}
wrapper/normalise.php 0000604 00000005555 15245561316 0010744 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage String
*
* @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Wrapper class for JStringNormalise
*
* @package Joomla.Platform
* @subpackage String
* @since 3.4
* @deprecated 4.0 Will be removed without replacement
*/
class JStringWrapperNormalise
{
/**
* Helper wrapper method for fromCamelCase
*
* @param string $input The string input (ASCII only).
* @param boolean $grouped Optionally allows splitting on groups of uppercase characters.
*
* @return mixed The space separated string or an array of substrings if grouped is true.
*
* @see JUserHelper::fromCamelCase()
* @since 3.4
*/
public function fromCamelCase($input, $grouped = false)
{
return JStringNormalise::fromCamelCase($input, $grouped);
}
/**
* Helper wrapper method for toCamelCase
*
* @param string $input The string input (ASCII only).
*
* @return string The camel case string.
*
* @see JUserHelper::toCamelCase()
* @since 3.4
*/
public function toCamelCase($input)
{
return JStringNormalise::toCamelCase($input);
}
/**
* Helper wrapper method for toDashSeparated
*
* @param string $input The string input (ASCII only).
*
* @return string The dash separated string.
*
* @see JUserHelper::toDashSeparated()
* @since 3.4
*/
public function toDashSeparated($input)
{
return JStringNormalise::toDashSeparated($input);
}
/**
* Helper wrapper method for toSpaceSeparated
*
* @param string $input The string input (ASCII only).
*
* @return string The space separated string.
*
* @see JUserHelper::toSpaceSeparated()
* @since 3.4
*/
public function toSpaceSeparated($input)
{
return JStringNormalise::toSpaceSeparated($input);
}
/**
* Helper wrapper method for toUnderscoreSeparated
*
* @param string $input The string input (ASCII only).
*
* @return string The underscore separated string.
*
* @see JUserHelper::toUnderscoreSeparated()
* @since 3.4
*/
public function toUnderscoreSeparated($input)
{
return JStringNormalise::toUnderscoreSeparated($input);
}
/**
* Helper wrapper method for toVariable
*
* @param string $input The string input (ASCII only).
*
* @return string The variable string.
*
* @see JUserHelper::toVariable()
* @since 3.4
*/
public function toVariable($input)
{
return JStringNormalise::toVariable($input);
}
/**
* Helper wrapper method for toKey
*
* @param string $input The string input (ASCII only).
*
* @return string The key string.
*
* @see JUserHelper::toKey()
* @since 3.4
*/
public function toKey($input)
{
return JStringNormalise::toKey($input);
}
}
utils.php 0000604 00000004161 15245561456 0006430 0 ustar 00 <?php
/**
* @package FrameworkOnFramework
* @subpackage utils
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Helper class with utilitarian functions concerning strings
*
* @package FrameworkOnFramework
* @since 2.0
*/
abstract class F0FStringUtils
{
/**
* Convert a string into a slug (alias), suitable for use in URLs. Please
* note that transliteration suupport is rudimentary at this stage.
*
* @param string $value A string to convert to slug
*
* @return string The slug
*/
public static function toSlug($value)
{
// Remove any '-' from the string they will be used as concatonater
$value = str_replace('-', ' ', $value);
// Convert to ascii characters
$value = self::toASCII($value);
// Lowercase and trim
$value = trim(strtolower($value));
// Remove any duplicate whitespace, and ensure all characters are alphanumeric
$value = preg_replace(array('/\s+/', '/[^A-Za-z0-9\-_]/'), array('-', ''), $value);
// Limit length
if (strlen($value) > 100)
{
$value = substr($value, 0, 100);
}
return $value;
}
/**
* Convert common norhern European languages' letters into plain ASCII. This
* is a rudimentary transliteration.
*
* @param string $value The value to convert to ASCII
*
* @return string The converted string
*/
public static function toASCII($value)
{
$string = htmlentities(utf8_decode($value), null, 'ISO-8859-1');
$string = preg_replace(
array('/ß/', '/&(..)lig;/', '/&([aouAOU])uml;/', '/&(.)[^;]*;/'), array('ss', "$1", "$1" . 'e', "$1"), $string
);
return $string;
}
/**
* Convert a string to a boolean.
*
* @param string $string The string.
*
* @return boolean The converted string
*/
public static function toBool($string)
{
$string = trim((string) $string);
if ($string == 'true')
{
return true;
}
if ($string == 'false')
{
return false;
}
return (bool) $string;
}
}