Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcBaseFeatures

Base::ezcBaseFeatures

Class ezcBaseFeatures

Provides methods needed to check for features.

Example:

  1.  <?php
  2.  echo "supports uid: " . ezcBaseFeatures::supportsUserId() . "\n";
  3.  echo "supports symlink: " . ezcBaseFeatures::supportsSymLink() . "\n";
  4.  echo "supports hardlink: " . ezcBaseFeatures::supportsLink() . "\n";
  5.  echo "has imagemagick identify: " . ezcBaseFeatures::hasImageIdentify() . "\n";
  6.  echo " identify path: " . ezcBaseFeatures::getImageIdentifyExecutable() . "\n";
  7.  echo "has imagemagick convert: " . ezcBaseFeatures::hasImageConvert() . "\n";
  8.  echo " convert path: " . ezcBaseFeatures::getImageConvertExecutable() . "\n";
  9.  echo "has gzip extension: " . ezcBaseFeatures::hasExtensionSupport( 'zlib' ) . "\n";
  10.  echo "has pdo_mysql 1.0.2: " . ezcBaseFeatures::hasExtensionSupport( 'pdo_mysql', '1.0.2' ) . "\n"
  11.  ?>

Source for this file: /Base/src/features.php

Version:   //autogentag//

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

static 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

static 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

static 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

static 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

static 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.

Examples:

  1.  hasExtensionSupport( 'gzip' );
will return true if gzip extension is loaded.

  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

static 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

static bool hasImageConvert( )

Determines if the ImageMagick convert utility is installed.

hasImageIdentify

static bool hasImageIdentify( )

Determines if the ImageMagick identify utility is installed.

os

static 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

static bool supportsLink( )

Determines if hardlinks are supported.

supportsSymLink

static bool supportsSymLink( )

Determines if symlinks are supported.

supportsUserId

static bool supportsUserId( )

Determines if posix uids are supported.

Documentation generated by phpDocumentor 1.4.3