|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.quercus.module.AbstractQuercusModule
com.caucho.quercus.lib.string.StringModule
public class StringModule
PHP functions implemented from the string module
| Field Summary | |
|---|---|
static int |
CHAR_MAX
|
static int |
CRYPT_BLOWFISH
|
static int |
CRYPT_EXT_DES
|
static int |
CRYPT_MD5
|
static int |
CRYPT_SALT_LENGTH
|
static int |
CRYPT_STD_DES
|
static int |
LC_ALL
|
static int |
LC_COLLATE
|
static int |
LC_CTYPE
|
static int |
LC_MESSAGES
|
static int |
LC_MONETARY
|
static int |
LC_NUMERIC
|
static int |
LC_TIME
|
static int |
STR_PAD_BOTH
|
static int |
STR_PAD_LEFT
|
static int |
STR_PAD_RIGHT
|
| Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule |
|---|
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER |
| Constructor Summary | |
|---|---|
StringModule()
|
|
| Method Summary | |
|---|---|
static StringValue |
addcslashes(StringValue source,
java.lang.String characters)
Escapes a string using C syntax. |
static StringValue |
addslashes(StringValue source)
Escapes a string for db characters. |
static StringValue |
bin2hex(Env env,
java.io.InputStream is)
Converts a binary value to a hex value. |
static StringValue |
chop(Env env,
StringValue str,
java.lang.String charset)
Alias of rtrim. |
static StringValue |
chr(Env env,
long value)
converts a number to its character equivalent |
static java.lang.String |
chunk_split(java.lang.String body,
int chunkLen,
java.lang.String end)
Splits a string into chunks |
static java.lang.String |
convert_cyr_string(Env env,
java.lang.String str,
java.lang.String from,
java.lang.String to)
Converts from one cyrillic set to another. |
static Value |
convert_uudecode(Env env,
java.lang.String source)
|
static Value |
convert_uuencode(StringValue source)
uuencode a string. |
static Value |
count_chars(StringValue data,
int mode)
Returns an array of information about the characters. |
static long |
crc32(java.io.InputStream is)
Calculates the crc32 value for a string |
static java.lang.String |
crypt(java.lang.String string,
java.lang.String salt)
|
static Value |
explode(StringValue separator,
StringValue string,
long limit)
Explodes a string into an array |
static Value |
fprintf(Env env,
BinaryOutput os,
StringValue format,
Value[] args)
Use printf style formatting to write a string to a file. |
protected static int |
hexToDigit(char ch)
|
static Value |
implode(Env env,
Value glueV,
Value piecesV)
implodes an array into a string |
protected static boolean |
isWhitespace(char ch)
Returns true if the character is a whitespace character. |
static Value |
join(Env env,
Value glueV,
Value piecesV)
implodes an array into a string |
static ArrayValue |
localeconv(Env env)
Gets locale-specific symbols. |
static StringValue |
ltrim(Env env,
StringValue string,
java.lang.String characters)
Removes leading whitespace. |
static Value |
md5_file(Env env,
Path source,
boolean rawOutput)
returns the md5 hash |
static Value |
md5(Env env,
java.io.InputStream is,
boolean rawOutput)
returns the md5 hash |
static java.lang.String |
metaphone(java.lang.String string)
Returns the metaphone of a string. |
static java.lang.String |
money_format(Env env,
java.lang.String format,
double value)
Returns a formatted money value. |
static java.lang.String |
number_format(Env env,
double value,
int decimals,
Value pointValue,
Value groupValue)
Returns a formatted number. |
protected static int |
octToDigit(char ch)
|
static long |
ord(StringValue string)
Converts the first character to an integer. |
static Value |
parse_str(Env env,
java.lang.String str,
Value ref)
Parses the string as a query string. |
static long |
print(Env env,
Value value)
Prints the string. |
static int |
printf(Env env,
StringValue format,
Value[] args)
print to the output with a formatter |
static java.lang.String |
quoted_printable_decode(java.lang.String str)
Converts a RFC2045 quoted printable string to a string. |
static Value |
quotemeta(StringValue string)
Escapes meta characters. |
static StringValue |
rtrim(Env env,
StringValue string,
java.lang.String characters)
Removes trailing whitespace. |
static Value |
setlocale(Env env,
int category,
Value localeArg,
Value[] fallback)
Sets locale configuration. |
static Value |
sha1_file(Env env,
Path source,
boolean rawOutput)
returns the md5 hash |
static Value |
sha1(Env env,
java.lang.String source,
boolean rawOutput)
returns the md5 hash |
static Value |
soundex(StringValue string)
|
static Value |
sprintf(Env env,
StringValue format,
Value[] args)
Print to a string with a formatter |
static Value |
sscanf(Env env,
StringValue string,
StringValue format,
Value[] args)
scans a string |
static Value |
str_ireplace(Env env,
Value search,
Value replace,
Value subject,
Value count)
replaces substrings. |
static StringValue |
str_pad(StringValue string,
int length,
java.lang.String pad,
int type)
Pads strings |
static Value |
str_repeat(StringValue string,
int count)
repeats a string |
static Value |
str_replace(Env env,
Value search,
Value replace,
Value subject,
Value count)
replaces substrings. |
static Value |
str_rot13(StringValue string)
rot13 conversion |
static java.lang.String |
str_shuffle(java.lang.String string)
shuffles a string |
static Value |
str_split(StringValue string,
int chunk)
split into an array |
static Value |
str_word_count(StringValue string,
int format,
java.lang.String additionalWordCharacters)
|
static int |
strcasecmp(StringValue a,
StringValue b)
Case-insensitive comparison |
static Value |
strchr(Env env,
StringValue haystack,
Value needle)
Finds the index of a substring |
static int |
strcmp(StringValue a,
StringValue b)
Case-sensitive comparison |
static Value |
strcoll(java.lang.String a,
java.lang.String b)
Locale-based comparison XXX: i18n |
static Value |
strcspn(StringValue string,
StringValue characters,
int offset,
int length)
Finds the number of initial characters in string that do not match one of the characters in characters |
static StringValue |
strip_tags(StringValue string,
java.lang.String allowTags)
Removes tags from a string. |
static java.lang.String |
stripcslashes(java.lang.String source)
Strip out the backslashes, recognizing the escape sequences, octal, and hexadecimal representations. |
static Value |
stripos(StringValue haystack,
Value needleV,
int offset)
Returns the position of a substring, testing case insensitive. |
static StringValue |
stripslashes(StringValue string)
Strips out the backslashes. |
static Value |
stristr(StringValue haystack,
Value needleV)
Finds the first instance of a substring, testing case insensitively |
static Value |
strlen(Value value)
Returns the length of a string. |
static int |
strnatcasecmp(StringValue a,
StringValue b)
Case-insensitive comparison |
static int |
strnatcmp(StringValue a,
StringValue b)
Case-sensitive comparison |
static int |
strncasecmp(StringValue a,
StringValue b,
int length)
Case-insensitive comparison |
static int |
strncmp(StringValue a,
StringValue b,
int length)
Case-sensitive comparison |
static Value |
strpbrk(StringValue haystack,
StringValue charList)
Returns a substring of haystack starting from the earliest occurence of any char in charList |
static Value |
strpos(StringValue haystack,
Value needleV,
int offset)
Returns the position of a substring. |
static Value |
strrchr(StringValue haystack,
Value needleV)
Finds the last instance of a substring |
static Value |
strrev(StringValue string)
Reverses a string. |
static Value |
strripos(java.lang.String haystack,
Value needleV,
Value offsetV)
Returns the position of a substring, testing case-insensitive. |
static Value |
strrpos(StringValue haystack,
Value needleV,
Value offsetV)
Returns the position of a substring. |
static Value |
strspn(StringValue string,
StringValue characters,
int offset,
int length)
Finds the number of initial characters in string that match one of the characters in characters |
static Value |
strstr(Env env,
StringValue haystackV,
Value needleV)
Finds the first instance of a needle in haystack and returns the portion of haystack from the beginning of needle to the end of haystack. |
static Value |
strtok(Env env,
StringValue string1,
Value string2)
Split a string into tokens using any character in another string as a delimiter. |
static StringValue |
strtolower(StringValue string)
Converts to lower case. |
static StringValue |
strtoupper(StringValue string)
Converts to upper case. |
static StringValue |
strtr(Env env,
StringValue string,
Value fromV,
StringValue to)
Translates characters in a string to target values. |
static Value |
substr_compare(Env env,
StringValue mainStr,
StringValue str,
int offset,
Value lenV,
boolean isCaseInsensitive)
|
static Value |
substr_count(Env env,
StringValue haystackV,
StringValue needleV,
int offset,
int length)
|
static Value |
substr_replace(Value subjectV,
StringValue replacement,
Value startV,
Value lengthV)
Replaces a substring with a replacement |
static Value |
substr(Env env,
StringValue string,
int start,
Value lenV)
Returns a substring |
protected static char |
toHexChar(int d)
|
protected static char |
toUpperCase(char ch)
Returns the uppercase equivalent of the caharacter |
protected static char |
toUpperHexChar(int d)
|
protected static char |
toUUChar(int d)
Converts an integer digit to a uuencoded char. |
static Value |
trim(Env env,
StringValue string,
java.lang.String characters)
Removes leading and trailing whitespace. |
static java.lang.String |
ucfirst(java.lang.String string)
Uppercases the first character |
static java.lang.String |
ucwords(java.lang.String string)
Uppercases the first character of each word |
static int |
vprintf(Env env,
StringValue format,
ArrayValue array)
Formatted strings with array arguments |
static Value |
vsprintf(Env env,
StringValue format,
ArrayValue array)
Formatted strings with array arguments |
static java.lang.String |
wordwrap(java.lang.String string,
int width,
java.lang.String breakString,
boolean cut)
Wraps a string to the given number of characters. |
| Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule |
|---|
getConstMap, getIniDefinitions, getLoadedExtensions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CRYPT_SALT_LENGTH
public static final int CRYPT_STD_DES
public static final int CRYPT_EXT_DES
public static final int CRYPT_MD5
public static final int CRYPT_BLOWFISH
public static final int CHAR_MAX
public static final int LC_CTYPE
public static final int LC_NUMERIC
public static final int LC_TIME
public static final int LC_COLLATE
public static final int LC_MONETARY
public static final int LC_ALL
public static final int LC_MESSAGES
public static final int STR_PAD_LEFT
public static final int STR_PAD_RIGHT
public static final int STR_PAD_BOTH
| Constructor Detail |
|---|
public StringModule()
| Method Detail |
|---|
public static StringValue addcslashes(StringValue source,
java.lang.String characters)
source - the source string to convertcharacters - the set of characters to convert
stripcslashes(java.lang.String)public static StringValue addslashes(StringValue source)
source - the source string to convert
public static StringValue bin2hex(Env env,
java.io.InputStream is)
public static StringValue chop(Env env,
StringValue str,
java.lang.String charset)
env - the quercus environmentstr - the string to be trimmedcharset - optional set of characters to trim
public static StringValue chr(Env env,
long value)
value - the integer value
public static java.lang.String chunk_split(java.lang.String body,
int chunkLen,
java.lang.String end)
body - the body stringchunkLen - the optional chunk length, defaults to 76end - the optional end value, defaults to "\r\n"
public static java.lang.String convert_cyr_string(Env env,
java.lang.String str,
java.lang.String from,
java.lang.String to)
public static Value convert_uudecode(Env env,
java.lang.String source)
public static Value convert_uuencode(StringValue source)
public static Value count_chars(StringValue data,
int mode)
public static long crc32(java.io.InputStream is)
str - the string value
public static java.lang.String crypt(java.lang.String string,
java.lang.String salt)
public static Value explode(StringValue separator,
StringValue string,
long limit)
separator - the separator stringstring - the string to be explodedlimit - the max number of elements
public static Value fprintf(Env env,
BinaryOutput os,
StringValue format,
Value[] args)
fd - the file to write toformat - the format stringargs - the valujes to apply to the format string
public static Value implode(Env env,
Value glueV,
Value piecesV)
glueV - the separator stringpiecesV - the array to be imploded
public static Value join(Env env,
Value glueV,
Value piecesV)
glueV - the separator stringpiecesV - the array to be imploded
public static ArrayValue localeconv(Env env)
public static StringValue ltrim(Env env,
StringValue string,
java.lang.String characters)
string - the string to be trimmedcharacters - optional set of characters to trim
public static Value md5(Env env,
java.io.InputStream is,
boolean rawOutput)
source - the stringrawOutput - if true, return the raw binary
public static Value md5_file(Env env,
Path source,
boolean rawOutput)
source - the stringrawOutput - if true, return the raw binary
public static java.lang.String metaphone(java.lang.String string)
public static java.lang.String money_format(Env env,
java.lang.String format,
double value)
format - the formatvalue - the value
public static java.lang.String number_format(Env env,
double value,
int decimals,
Value pointValue,
Value groupValue)
value - the valuedecimals - the number of decimalspointValue - the decimal point stringgroupValue - the thousands separator
public static long ord(StringValue string)
string - the string to be converted
public static Value parse_str(Env env,
java.lang.String str,
Value ref)
env - the calling environmentstr - the query stringarray - the optional result array
public static long print(Env env,
Value value)
env - the quercus environmentvalue - the string to print
public static int printf(Env env,
StringValue format,
Value[] args)
env - the quercus environmentformat - the format stringargs - the format arguments
public static java.lang.String quoted_printable_decode(java.lang.String str)
public static Value quotemeta(StringValue string)
string - the string to be quoted
public static StringValue rtrim(Env env,
StringValue string,
java.lang.String characters)
env - the quercus environmentstring - the string to be trimmedcharacters - optional set of characters to trim
public static Value setlocale(Env env,
int category,
Value localeArg,
Value[] fallback)
public static Value sha1(Env env,
java.lang.String source,
boolean rawOutput)
source - the stringrawOutput - if true, return the raw binary
public static Value sha1_file(Env env,
Path source,
boolean rawOutput)
source - the stringrawOutput - if true, return the raw binary
public static Value soundex(StringValue string)
public static Value sprintf(Env env,
StringValue format,
Value[] args)
format - the format stringargs - the format arguments
public static Value sscanf(Env env,
StringValue string,
StringValue format,
Value[] args)
format - the format stringargs - the format arguments
public static Value str_ireplace(Env env,
Value search,
Value replace,
Value subject,
Value count)
search - search stringreplace - replacement stringsubject - replacementcount - return value
public static StringValue str_pad(StringValue string,
int length,
java.lang.String pad,
int type)
string - stringlength - lengthpad - padding stringtype - padding type
public static Value str_repeat(StringValue string,
int count)
string - string to repeatcount - number of times to repeat
public static Value str_replace(Env env,
Value search,
Value replace,
Value subject,
Value count)
search - search stringreplace - replacement stringsubject - replacementcount - return valuepublic static Value str_rot13(StringValue string)
string - string to convertpublic static java.lang.String str_shuffle(java.lang.String string)
public static Value str_split(StringValue string,
int chunk)
string - string to splitchunk - chunk size
public static Value str_word_count(StringValue string,
int format,
java.lang.String additionalWordCharacters)
public static int strcasecmp(StringValue a,
StringValue b)
a - left valueb - right value
public static Value strchr(Env env,
StringValue haystack,
Value needle)
env - the calling environment
public static int strcmp(StringValue a,
StringValue b)
a - left valueb - right value
public static Value strcoll(java.lang.String a,
java.lang.String b)
a - left valueb - right value
public static Value strcspn(StringValue string,
StringValue characters,
int offset,
int length)
string - the string to search incharacters - the character setoffset - the starting offsetlength - the length
public static StringValue strip_tags(StringValue string,
java.lang.String allowTags)
string - the string to removeallowTags - the allowable tagspublic static java.lang.String stripcslashes(java.lang.String source)
source - the string to cleanaddcslashes(com.caucho.quercus.env.StringValue, java.lang.String)
public static Value stripos(StringValue haystack,
Value needleV,
int offset)
haystack - the full argument to checkneedleV - the substring argument to checkoffsetV - optional starting positionpublic static StringValue stripslashes(StringValue string)
string - the string to clean
public static Value stristr(StringValue haystack,
Value needleV)
haystack - the string to search inneedleV - the string to search for
public static Value strlen(Value value)
value - the argument value
public static int strnatcasecmp(StringValue a,
StringValue b)
a - left valueb - right value
public static int strnatcmp(StringValue a,
StringValue b)
a - left valueb - right value
public static int strncasecmp(StringValue a,
StringValue b,
int length)
a - left valueb - right value
public static int strncmp(StringValue a,
StringValue b,
int length)
a - left valueb - right value
public static Value strpbrk(StringValue haystack,
StringValue charList)
haystack - the string to search incharList - list of chars that would trigger match
public static Value strpos(StringValue haystack,
Value needleV,
int offset)
haystack - the string to search inneedleV - the string to search for
public static Value strrchr(StringValue haystack,
Value needleV)
haystack - the string to search inneedleV - the string to search for
public static Value strrev(StringValue string)
public static Value