XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XCube_Utils Class Reference

Public Member Functions

 __construct ()
 Private Constructor. In other words, it's impossible to generate an instance of this class.
 
 formatMessage ()
 
 formatMessageByMap ( $subject, $arr)
 
 recursiveRemove (string $delete_path)
 
 preloadActive (string $pre_disable, string $pre_active)
 

Static Public Member Functions

static redirectHeader ( $url, $time, $messages=null)
 [Static] The alias for the current controller::redirectHeader(). This function will be deprecated.
 
static formatString ()
 [Static] Formats string with special care for international.
 
static encrypt (string $plain_text, string $key=null)
 [Static] To encrypt strings by "DES-ECB".
 
static decrypt (string $crypt_text, string $key=null)
 [Static] To decrypt strings by "DES-ECB".
 

Detailed Description

Definition at line 13 of file XCube_Utils.class.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Private Constructor. In other words, it's impossible to generate an instance of this class.

Definition at line 18 of file XCube_Utils.class.php.

Member Function Documentation

◆ decrypt()

static decrypt ( string $crypt_text,
string $key = null )
static

[Static] To decrypt strings by "DES-ECB".

Parameters
string$crypt_text
string | null$key
Returns
string - Decrypted string.

Definition at line 164 of file XCube_Utils.class.php.

◆ encrypt()

static encrypt ( string $plain_text,
string $key = null )
static

[Static] To encrypt strings by "DES-ECB".

Parameters
string$plain_text
string | null$key
Returns
string - Encrypted string.

Definition at line 117 of file XCube_Utils.class.php.

◆ formatMessage()

formatMessage ( )
Deprecated
XCube 1.0 removes this method.
See also
XCube_Utils\formatString()

Definition at line 215 of file XCube_Utils.class.php.

◆ formatMessageByMap()

formatMessageByMap ( $subject,
$arr )
Parameters
$subject
$arr
Returns
string|string[]
Deprecated
XCube 1.0 will remove this method.

Definition at line 243 of file XCube_Utils.class.php.

◆ formatString()

static formatString ( )
static

[Static] Formats string with special care for international.

Returns
string - Rendered string.

This method renders a String with modifiers and parameters. Parameters are .NET style, not printf style. Because .NET style is clear.

XCube_Utils::formatString("{0} is {1}", "Time", "Money");
// Result "Time is Money"
static formatString()
[Static] Formats string with special care for international.

It's possible to add a modifier to the parameter placeholders with ':' mark.

XCube_Utils::formatString("{0:ucFirst} is {1:toLower}", "Time", "Money");
// Result "Time is Money"

This function is useful for messages automatically combined by message catalogues.

Modifiers
-li ufFirst - Upper the first character of the parameter's value. -li toUpper - Upper the parameter's value. -li toLower - Lower the parameter's value.
Remarks
This method does not implement or provide a formatted string for a given locale. This method is therefore provisionally implemented.

Definition at line 70 of file XCube_Utils.class.php.

◆ preloadActive()

preloadActive ( string $pre_disable,
string $pre_active )

Preload Active Copy preload from directory /preload/disabled

Parameters
string$pre_disable
string$pre_active

Definition at line 279 of file XCube_Utils.class.php.

◆ recursiveRemove()

recursiveRemove ( string $delete_path)

Recursively delete directory /install

Parameters
string$delete_path

Definition at line 259 of file XCube_Utils.class.php.

◆ redirectHeader()

static redirectHeader ( $url,
$time,
$messages = null )
static

[Static] The alias for the current controller::redirectHeader(). This function will be deprecated.

Parameters
string$url
int$time
null$messages
Returns
void
Deprecated
XCube 1.0 will remove this method. Don't use static function of XCube layer for redirect.

Definition at line 34 of file XCube_Utils.class.php.


The documentation for this class was generated from the following file: