Base: ezcBaseFeatures
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcBaseFeatures
|
Provides methods needed to check for features. [
source]
Method Summary
|
public static bool |
classExists(
$className, [$autoload = true] )
Returns if a given class exists. |
|
public static string |
findExecutableInPath(
$fileName )
Returns the path of the specified executable, if it can be found in the system's path. |
|
public static string |
getImageConvertExecutable(
)
Returns the path to the ImageMagick convert utility. |
|
public static string |
getImageIdentifyExecutable(
)
Returns the path to the ImageMagick identify utility. |
|
public static bool |
hasExtensionSupport(
$extension, [$version = null] )
Determines if the specified extension is loaded. |
|
public static bool |
hasFunction(
$functionName )
Determines if the specified function is available. |
|
public static bool |
hasImageConvert(
)
Determines if the ImageMagick convert utility is installed. |
|
public static bool |
hasImageIdentify(
)
Determines if the ImageMagick identify utility is installed. |
|
public static string |
os(
)
Returns the operating system on which PHP is running. |
|
public static bool |
supportsLink(
)
Determines if hardlinks are supported. |
|
public static bool |
supportsSymLink(
)
Determines if symlinks are supported. |
|
public static bool |
supportsUserId(
)
Determines if posix uids are supported. |
Methods
classExists
bool classExists(
string
$className, [bool
$autoload = true] )
Returns if a given class exists.
Checks for a given class name and returns if this class exists or not. Catches the ezcBaseAutoloadException and returns false, if it was thrown.
Parameters
| Name |
Type |
Description |
$className |
string |
The class to check for. |
$autoload |
bool |
True to use __autoload(), otherwise false. |
findExecutableInPath
string findExecutableInPath(
string
$fileName )
Returns the path of the specified executable, if it can be found in the system's path.
It scans the PATH enviroment variable based on the OS to find the $fileName. For Windows, the path is with \, not /. If $fileName is not found, it returns null.
Parameters
| Name |
Type |
Description |
$fileName |
string |
|
getImageConvertExecutable
string getImageConvertExecutable(
)
Returns the path to the ImageMagick convert utility.
On Linux, Unix,... it will return something like: /usr/bin/convert On Windows it will return something like: C:\Windows\System32\convert.exe
getImageIdentifyExecutable
string getImageIdentifyExecutable(
)
Returns the path to the ImageMagick identify utility.
On Linux, Unix,... it will return something like: /usr/bin/identify On Windows it will return something like: C:\Windows\System32\identify.exe
hasExtensionSupport
bool hasExtensionSupport(
string
$extension, [string
$version = null] )
Determines if the specified extension is loaded.
If $version is specified, the specified extension will be tested also against the version of the loaded extension.
1. hasExtensionSupport( 'pdo_mysql', '1.0.2' );
will return true if pdo_mysql extension is loaded and its version is at least 1.0.2.
Parameters
| Name |
Type |
Description |
$extension |
string |
|
$version |
string |
|
hasFunction
bool hasFunction(
string
$functionName )
Determines if the specified function is available.
Examples:
1. ezcBaseFeatures::hasFunction( 'imagepstext' );
will return true if support for Type 1 fonts is available with your GD extension.
Parameters
| Name |
Type |
Description |
$functionName |
string |
|
hasImageConvert
bool hasImageConvert(
)
Determines if the ImageMagick convert utility is installed.
hasImageIdentify
bool hasImageIdentify(
)
Determines if the ImageMagick identify utility is installed.
os
string os(
)
Returns the operating system on which PHP is running.
This method returns a sanitized form of the OS name, example return values are "Windows", "Mac", "Linux" and "FreeBSD". In all other cases it returns the value of the internal PHP constant PHP_OS.
supportsLink
bool supportsLink(
)
Determines if hardlinks are supported.
supportsSymLink
bool supportsSymLink(
)
Determines if symlinks are supported.
supportsUserId
bool supportsUserId(
)
Determines if posix uids are supported.
Last updated: Mon, 30 Mar 2009