KWeb  6.4
KWebPath Class Reference

This class helps to handle file paths. More...

Public Member Functions

 __construct ($path, $type=false, $rootDir=false)
 newPath ($path, $type=false)
 Returns new KWebPath object, with specified path and type, and all options cloned from current object.
 getPathUri ()
 Returns path Uri, for use with createFromUri(), or to store in database.
 __toString ()
 isEmpty ()
 getRootDir ()
 getPath ()
 Returns path, as passed to this function (without uri descriptor)
 getType ()
 Returns path type.
 getFilePath ()
 Returns filepath as absolute path, or url.
 getExtension ($withDot=true)
 getUrl ($useMirror=true)
 Returns URL to this file.
 canMirrorFile ()
 getFileMirrors ()
 getFileSize ()
 isValidLocalFile ()
 isUrl ()
 getPreview ($imgPreview, array $options=array())
 Returns preview result for this file.
 getContentType ($default= 'application/binary')

Static Public Member Functions

static createFromUri ($uri, $rootDir=false)
static extractExtension ($url, $withDot=true)

Data Fields

const FILE = 'file'
 file://relative_path
const PATH = 'path'
 relative_path or /absolute_path
const URL = 'url'
 http://url.com
const SCRIPT = 'script'
 script://relative_path{{with scripting}}
const NONE = false
const UNKNOWN = 'unknown'
 $rootDir
 $scriptVars
 $mirror = false
 $allowedUrlProtocols

Static Public Attributes

static $contentTypes

Protected Member Functions

 parseUri ($uri)

Protected Attributes

 $path
 $type

Detailed Description

This class helps to handle file paths.


Constructor & Destructor Documentation

KWebPath::__construct ( path,
type = false,
rootDir = false 
)

Member Function Documentation

KWebPath::__toString ( )
KWebPath::canMirrorFile ( )
static KWebPath::createFromUri ( uri,
rootDir = false 
) [static]
Returns:
KWebPath
static KWebPath::extractExtension ( url,
withDot = true 
) [static]
KWebPath::getContentType ( default = 'application/binary')
KWebPath::getExtension ( withDot = true)
KWebPath::getFileMirrors ( )
KWebPath::getFilePath ( )

Returns filepath as absolute path, or url.

KWebPath::getFileSize ( )
KWebPath::getPath ( )

Returns path, as passed to this function (without uri descriptor)

KWebPath::getPathUri ( )

Returns path Uri, for use with createFromUri(), or to store in database.

KWebPath::getPreview ( imgPreview,
array $  options = array() 
)

Returns preview result for this file.

Parameters:
$imgPreviewImgPreview instance, or instance name
Returns:
ImgPreviewResult
KWebPath::getRootDir ( )
KWebPath::getType ( )

Returns path type.

KWebPath::getUrl ( useMirror = true)

Returns URL to this file.

KWebPath::isEmpty ( )
KWebPath::isUrl ( )
KWebPath::isValidLocalFile ( )
KWebPath::newPath ( path,
type = false 
)

Returns new KWebPath object, with specified path and type, and all options cloned from current object.

Returns:
KWebPath
KWebPath::parseUri ( uri) [protected]

Field Documentation

KWebPath::$allowedUrlProtocols
Initial value:
 array(
        'http', 'https'
    )
KWebPath::$contentTypes [static]
Initial value:
 array(
        '/^jpe?g$/' => 'image/jpeg',
  '/^png$/' => 'image/png',
  '/^gif$/' => 'image/gif',
  '/^html$/' => 'text/html',
    )
KWebPath::$mirror = false
KWebPath::$path [protected]
KWebPath::$rootDir
KWebPath::$scriptVars
KWebPath::$type [protected]
const KWebPath::NONE = false
const KWebPath::PATH = 'path'

relative_path or /absolute_path

const KWebPath::SCRIPT = 'script'

script://relative_path{{with scripting}}

const KWebPath::UNKNOWN = 'unknown'

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