PHP Class Zephir\Utils

Utility functions
显示文件 Open project: phalcon/zephir Class Usage Examples

Public Methods

Method Description
addSlashes ( string $str, boolean $escapeSlash = false ) : string Prepares a string to be used as a C-string
camelize ( string $str ) : string Camelize a string
checkAndWriteIfNeeded ( $content, $path ) : boolean Checks if the content of the file on the disk is the same as the content.
escapeClassName ( string $className ) : string Prepares a class name to be used as a C-string
getFullName ( string $className, string $currentNamespace, zephir\AliasManager $aliasManager = null ) : string Transform class/interface name to FQN format
isBsd ( ) : boolean Check if the host OS is BSD based
isMacOs ( ) : boolean Check if the host OS is MacOs
isWindows ( ) : boolean Check if the host OS is windows

Method Details

addSlashes() public static method

Prepares a string to be used as a C-string
public static addSlashes ( string $str, boolean $escapeSlash = false ) : string
$str string
$escapeSlash boolean
return string

camelize() public static method

Camelize a string
public static camelize ( string $str ) : string
$str string
return string

checkAndWriteIfNeeded() public static method

Checks if the content of the file on the disk is the same as the content.
public static checkAndWriteIfNeeded ( $content, $path ) : boolean
$content
$path
return boolean

escapeClassName() public static method

Prepares a class name to be used as a C-string
public static escapeClassName ( string $className ) : string
$className string
return string

getFullName() public static method

Transform class/interface name to FQN format
public static getFullName ( string $className, string $currentNamespace, zephir\AliasManager $aliasManager = null ) : string
$className string
$currentNamespace string
$aliasManager zephir\AliasManager
return string

isBsd() public static method

Check if the host OS is BSD based
public static isBsd ( ) : boolean
return boolean

isMacOs() public static method

Check if the host OS is MacOs
public static isMacOs ( ) : boolean
return boolean

isWindows() public static method

Check if the host OS is windows
public static isWindows ( ) : boolean
return boolean