PVValidator

Extends \PVStaticObject

PVValidator is a dynamically extendable class used to validate inputs.

The class can be used to check for a variety of inputs to validate data from mime types to correct syntax for a URL. The class is also extendable to add more validation rules.

Examples:

//Check if a file is an integer

if(PVValidator::check('integer', '3.4')) {
    echo 'I am an integer';
}

if(PVValidator::check('url', 'http://www.google.com')) {
    echo 'I am a valid url';
}

//Add custom validation rule
PVValidator::addRule('is_currency', array('function' => function($number) {
    return preg_match("/^-?[0-9]+(?:\.[0-9]{1,2})?$/", $number);
}));

//Check against custom rule
if(PVValidator::check(‘is_currecny’, '$10.00')) {
    echo 'I am currency';
}
package

util

Methods

Uses the magic method __call and executes a closure/anonymous function that has been added to the classes $_methods using the addMethod() method.

__callStatic(string $method, mixed $args = array()) : mixed
inherited static
access

public

Arguments

$method

string

The key/name assigned to the method when added

$args

mixed

Arguements to pass to the annoymous function. The function is called using call_user_func_array.

Response

mixed

$value The value returned is the value the stored function returns

Apply a fitler if filter is set.

_applyFilter(string $class, string $method, mixed $data, array $options = array()) : mixed
inherited static
access

protected

Arguments

$class

string

The name of the class the filter is in

$method

string

The method the filter is in

$data

mixed

The data that is being passed to the filter

$options

array

options to be passed to the filter. Passed options we be passed to the function. -'default_return' mixed: If no filter is return, the data passed in by default will be return. Can be overriden -'event' string: An event to associate with the filter. Default is null

Response

mixed

$data The data the function returns

Calls an adapter for this class. The easiest way of implementing an adapter is by placing the adapter at the top of the function that it is being called in. An infinite amout of parameters can be passed to the adapter BUT the parameters should be the same as the parents.

_callAdapter(string $class, string $method) : mixed
inherited static
access

protected

Arguments

$class

string

The name of the class the adapter is in

$method

string

THe name of the method the class is being called from.

Response

mixed

$value A value that the adapter returns

Checks if an adapter is set for the function.

_hasAdapter( $class, string $method) : \boolea
inherited static
access

protected

Arguments

$class

$method

string

The associated method

Response

\boolea

$hasAdapter Returns true if it has an adapter or false if it doesn not

Checks if a filter has been set.

_hasFilter(string $class, string $method) 
inherited static

Arguments

$class

string

The class the filter is in

$method

string

The method of the class that the filter is in

Calls a methods that is an instance of an class. This method is generally faster than using user_call_func_array.

_invokeMethod(string $class, string $method, array $args) : mixed
inherited static
access

protected

Arguments

$class

string

The name of the class to be called

$method

string

The name of the method in the class to be called

$args

array

An array of arguements. Arguements have to be embedded in an array to be called.

Response

mixed

$data Data returned by the function called

Calls a methods that is a static method of a class. This method is generally faster than using user_call_func_array.

_invokeStaticMethod(string $class, string $method, array $args) : mixed
inherited static
access

protected

Arguments

$class

string

The name of the class to be called

$method

string

The name of the method in the class to be called

$args

array

An array of arguements. Arguements have to be embedded in an array to be called.

Response

mixed

$data Data returned by the function called

Write out the contents of adapters used to a log

_logAdapter(array $data) : void
inherited static
access

private

Arguments

$data

array

The data in the adapter

Write out the contents of a filter used to a log

_logFilter(array $data) : void
inherited static
access

private

Arguments

$data

array

The data in the filter

Write out the contents of an observer to a log.

_logObserver(array $data) : void
inherited static
access

private

Arguments

$data

array

The data in the observer

Calls any functions that have been added to the observer if the event is present in the observers array.

_notify(string $event) : void
inherited static
access

protected

Arguments

$event

string

The name of the even that occured that will trigger notifies

Breaks down the data to be logged from an adapter, filter or observer.

_prepareLogData(array $data) : string
inherited static
access

private

Arguments

$data

array

Response

string

$message JSON encode message of information about the data

Adapters allows a method to be completely overwritten by calling a different class with the same method name. Adapters can also be used with closures. The adapter uses a strategy/adapter design pattern.

addAdapter(string $trigger_class, string $trigger_method, string $call_class, array $options = array()) : void
inherited static
access

public

todo

add ability to adapt singleton class

Arguments

$trigger_class

string

The class that contains the function the adapter will respond too

$trigger_method

string

The method called that will have the adapter to be called.

$call_class

string

The new class to be called that has the same method name

$options

array

An array of options that be called -'object' string : Assumes that default method in the class to be called is static. If called object needs to be instantiated, change to object to 'instance' and one will be created before the adapter calls the function -'call_method' string: By default the method to be called to override the current one should be the same name. But this can be ovveridden to call a different method. -'type' string: The type of method being called. Default is class_method but if the method is a closure, set the type to be 'closure' and make the $trigger_method the closure

Will add an adapter for every method in the trigger_class to another class. The method will only be adapted to another class if the method in the trigger class has an adapter. This functionality can be very similiar to DI.

addClassAdapter(mixed $trigger_class, string $call_class, array $options = array()) : void
inherited static
access

public

todo

Add ability to use singleton classes

Arguments

$trigger_class

mixed

This can either be the name of the class or an object whose methods will be adapted to another class. The class should be included or be autoloaded by this point.

$call_class

string

The call class is the classes methods that will be called in place of the methods in the trigger_class. These class does not have to be included as this point.

$options

array

Options that be used to further distinguish the behavior of the adapters added -'object' string: Determines if the object being adapted to is static or an instance.Default is static -'call_class' string: The name of the class that the methods will be adapted too. -'class' string: The name of the whose methods will be adapted to another class

Adds a filter to the class. Filters are for modifying a value within a class and should not interpet the normal flow within the method.

addFilter(string $class, string $method, string $filter_class, string $filter_method, array $options = array()) : void
inherited static
access

public

Arguments

$class

string

The name of the class the filter is going in

$method

string

The name of the method the filter is in

$filter_class

string

The class that the filter resides in.

$filter_method

string

The method in the class that the parameters will be passed too.

$options

array

Options that can be set for further modifying the filter. -'object' string: If the method being called is static, static should be inserted. If its in an instance, 'instance' should be set. Default is set to static. -'event' string: Associate this filter with an event. -'type' string: The type of function being called. Default is class_method but if the function is a closure, set the type to be 'closure' and make the $filter_method the closure

Adds a closure/anonymous function to the object that can be called.

addMethod(string $method, \function $closure) : void
inherited static
access

public

Arguments

$method

string

The key/value that will be used to call the function

$closure

\function

The anonymous function/closure to be added

Adds an observer to the class. Observer events can fired in any method to trigger a response.

addObserver(string $event, string $class, string $method, array $options = array()) : void
inherited static
access

public

Arguments

$event

string

The name of the event that will cause a certain class and method to fire

$class

string

The name of the class that contains the function that will be fired for this event

$method

string

The name of the method that will be fired when the event occurs

$options

array

Options to further the define the firing of an event -'object' string : If the method being called is static, should be set to static. Else set to instance -'class' stinrg : The name of the class to be called. Default is the class that is passed in. -'method' string: The name of the method to be called. Default is the method that is passed in. -'type' string: The type of function being called. Default is class_method but if the function is a closure, set the type to be 'closure' and make the $method the closure

Add a rule to the validator or modify a current one with the name name. Checks can either be closures(PHP 5.3) or preg_match, or calls to other function.

addRule(string $rule, array $options = array()) : void
static
access

public

Arguments

$rule

string

The name of the rule

$options

array

Options that define the rule -'type' string: The type of validation to perform. There are currently 4 supported types.

  1. 'closures' If you are in php 5.3, a closure function can be passed and validated against
  2. 'preg_match' Validation will be peformoned using a preg_match. Rule must be passed in.
  3. 'function' A php function that is stores in a string and called. Create the function using 'create_function' method
  4. 'validator' Calls a function in the validator to be exectued -'rule' string: A rule to be checked against if the type is a preg_match -'function' mixed: Either a string that is a function or an annoymous function.

Adds a data to the public collection, index will be assigned automatically. Primarily used for adding launch quanties of data to the collection

addToCollection(mixed $data) : void
inherited static
access

public

Arguments

$data

mixed

Any data type( Object, Array, int, etc) to add to the public data collection

Adds data to the public collection. The data is assigned a key/index. If the key/index is already set, new information will override the old one.

addToCollectionWithName(string $name, mixed $data) : void
inherited static
access

public

todo

check the relevance of get and set

Arguments

$name

string

The key/index to assign the value to

$data

mixed

Data to be stored in the collection

Checks a value passed to a rule if the rule exist. If there is no rule, true will be returned.

check(string $rule) : mixed
static
access

public

Arguments

$rule

string

The name of the rule to check against

Response

mixed

$validate Validates is generally a boolean and returns true or false

Checks a files mime type and returns true if the mime type is found, otherwise false.

checkFileMimeType(string $file, string $mime_text, array $options = array()) : boolean
static
access

public

Arguments

$file

string

The path to the file to be be checked

$mime_text

string

Some form of text that describes the mime type.

$options

array

Options that can customize how the mime type is to be found. -'search_method' string: The search method can either be found using strpos or preg_match. The default is STRING_POSITION as the method, change to PREG_MATCH to use PREG_MATCH -'magic_file' string: If you have phpinfo installed, it will be used for finding the mime_type. The default magic file is not set and will use the default in the PVFileManager.

Response

boolean

$found Returns true if the mime type was match, otherwise false

Remove all the filters from a class.

clearFilters(string $class, string $method) : void
inherited static
access

public

Arguments

$class

string

The class the filter is in

$method

string

The method of the class that the filter is in

Removes all the observers assoicated with an event.

clearObservers(string $event) : void
inherited static
access

public

Arguments

$event

string

The event to remove all the observers from

Retrieves a value that is in the public data collection or was pass through by the set method.

get(string $index) : mixed
inherited static
access

public

Arguments

$index

string

The index to retrieve a value from

Response

mixed

$data The data that was stored at that index

Returns the instance of a class. Used for implementing the singleton design pattern. Class will only be instantiated once.

getInstance() : object
inherited static
access

public

Response

object

$instance Returns the instance of a class.

Returns the iterator for iterating through the values stored in the classes collection.

getIterator() : \PVIterator
inherited static

Response

\PVIterator

$iterator The classes collection in an iteratable form

access public

Initializes PVValidators and sets the default for checking rules. The defaults allows the function PVValidator::check() to function propery.

init(array $config = array()) : void
static
access

public

todo

consider extending the config optiont actually have it doing something

Arguments

$config

array

The configuration for init the class

Attempts to check if the url is an active url. Response should be 200.

isActiveUrl(string $url) : boolean
static
todo

rewrite with PVCommunicator

Arguments

$url

string

The url to check if active

Response

boolean

Checks if a value passed has a aiff audio mime type.

isAiffFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a aiff audio mime type

Response

boolean

$valid Returns true if the value is a aiff audio mime type, otherwise false

Checks if a value passed has a gtar file mime type.

isAscFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a gtar file mime type

Response

boolean

$valid Returns true if the value is a gtar file mime type, otherwise false

Checks if a value passed has a asf video mime type.

isAsfFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a asf video mime type

Response

boolean

$valid Returns true if the value is a asf video mime type, otherwise false

Checks if a value passed has an audio mime type.

isAudioFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is an audio mime type

Response

boolean

$valid Returns true if the value is an audio mime type, otherwise false

Checks if a value passed has a avi video mime type.

isAviFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a avi video mime type

Response

boolean

$valid Returns true if the value is a avi video mime type, otherwise false

Checks if a value passed has a bmp image mime type.

isBmpFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a bmp image mime type

Response

boolean

$valid Returns true if the value is a bmp image mime type, otherwise false

Checks if a value passed has a compressed file(zip, tar, gtar) mime type.

isCompressedFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a compressed file mime type

Response

boolean

$valid Returns true if the value is a compressed file mime type, otherwise false

Checks if a value passed has a css (Cascading Style Sheet) file mime type.

isCssFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a css file mime type

Response

boolean

$valid Returns true if the value is a css file mime type, otherwise false

Checks if a value passed is of type int or an integer.

isDouble(mixed $double) : boolean
static
access

public

Arguments

$double

mixed

The value to check if it is an double

Response

boolean

$valid Returns true if the value is an integer, otherwise false

Checks if a value passed has a flv video mime type.

isFlvFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a flv video mime type

Response

boolean

$valid Returns true if the value is a flv video mime type, otherwise false

Checks if a value passed has a gif image mime type.

isGifFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a gif image mime type

Response

boolean

$valid Returns true if the value is a gif image mime type, otherwise false

Checks if a value passed has a gtar file mime type.

isGTarFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a gtar file mime type

Response

boolean

$valid Returns true if the value is a gtar file mime type, otherwise false

Checks if a value passed has a htm file mime type.

isHtmFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a htm file mime type

Response

boolean

$valid Returns true if the value is a htm file mime type, otherwise false

Checks if a value passed has a html file mime type.

isHtmlFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a html file mime type

Response

boolean

$valid Returns true if the value is a html file mime type, otherwise false

Checks if a value passed is of type an ID. ID's are numeric are in the format of a MongoID

isID(mixed $id) : boolean
static
access

public

Arguments

$id

mixed

The value to check if it is an id

Response

boolean

$valid Returns true if the value is an id, otherwise false

Checks if a value passed has a ief image mime type.

isIefFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a ief image mime type

Response

boolean

$valid Returns true if the value is a ief image mime type, otherwise false

Checks if a value passed has an imagemime type.

isImageFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is an image mime type

Response

boolean

$valid Returns true if the value is an image mime type, otherwise false

Checks if a value passed is of type int or an integer.

isInteger(mixed $int) : boolean
static
access

public

Arguments

$int

mixed

The value to check if it is an integer

Response

boolean

$valid Returns true if the value is an integer, otherwise false

Checks if a value passed has a jpeg image mime type.

isJpegFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a jpeg image mime type

Response

boolean

$valid Returns true if the value is a jpeg image mime type, otherwise false

Checks if a value passed has a MS Excel mime type. Checks for .xsl and .xsls files

isMicrosoftExcelFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Excel file mime type

Response

boolean

$valid Returns true if the value is a MS Excel file mime type, otherwise false

Checks if a value passed has a MS Excel mime type. Checks only for .xsl file

isMicrosoftExcelXLSFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Excel file mime type

Response

boolean

$valid Returns true if the value is a MS Excel file mime type, otherwise false

Checks if a value passed has a MS Excel mime type. Checks only for .xslx files

isMicrosoftExcelXLSXFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Excel file mime type

Response

boolean

$valid Returns true if the value is a MS Excel file mime type, otherwise false

Checks if a value passed has a MS PowerPoint mime type. Check for both .ppt and .pptx files

isMicrosoftPowerPointFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Powerpoint file mime type

Response

boolean

$valid Returns true if the value is a MS Pwerpoint file mime type, otherwise false

Checks if a value passed has a MS PowerPoint mime type. Checks only for .ppt files

isMicrosoftPPTFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Powerpoint file mime type

Response

boolean

$valid Returns true if the value is a MS Powerpoint file mime type, otherwise false

Checks if a value passed has a MS PowerPoint mime type. Checks only for .pptx files

isMicrosoftPPTXFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS PowerPoint file mime type

Response

boolean

$valid Returns true if the value is a MS PowerPoint file mime type, otherwise false

Checks if a value passed has a MS Word mime type. This will only check for .doc files.

isMicrosoftWordDocFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Word file mime type

Response

boolean

$valid Returns true if the value is a MS Word file mime type, otherwise false

Checks if a value passed has a MS Word mime type. This will check for only .docx files

isMicrosoftWordDocxFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Word file mime type

Response

boolean

$valid Returns true if the value is a MS Word file mime type, otherwise false

Checks if a value passed has a MS Word mime type. This will check for both doc and docx files.

isMicrosoftWordFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a MS Word file mime type

Response

boolean

$valid Returns true if the value is a MS Word file mime type, otherwise false

Checks if a value passed has a midi mime type.

isMidiFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a midi mime type

Response

boolean

$valid Returns true if the value is a midi mime type, otherwise false

Checks if a value passed has a mov video mime type.

isMovFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a mov video mime type

Response

boolean

$valid Returns true if the value is a mov video mime type, otherwise false

Checks if a value passed has a mp4 video mime type.

isMp4File(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a mp4 video mime type

Response

boolean

$valid Returns true if the value is a mp4 video mime type, otherwise false

Checks if a value passed has a mpeg audio mime type.

isMpegAudioFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a mpeg audio mime type

Response

boolean

$valid Returns true if the value is a mpeg audio mime type, otherwise false

Checks if a value passed has a mpeg video mime type.

isMpegVideoFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a mpeg video mime type

Response

boolean

$valid Returns true if the value is a mpeg video mime type, otherwise false

Checks if a value passed has a mux video mime type.

isMxuFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a mux video mime type

Response

boolean

$valid Returns true if the value is a mux video mime type, otherwise false

Checks if a value passed has a ogg audio mime type.

isOGGAudioFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a ogg audio mime type

Response

boolean

$valid Returns true if the value is a ogg audio mime type, otherwise false

Checks if a value passed has an ogg video mime type.

isOGGVideoFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is an ogg video mime type

Response

boolean

$valid Returns true if the value is an ogg video mime type, otherwise false

Checks if a value passed has a PDF mime type.

isPdfFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a PDF file mime type

Response

boolean

$valid Returns true if the value is a PDF file mime type, otherwise false

Checks if a value passed has a png image mime type.

isPngFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a png image mime type

Response

boolean

$valid Returns true if the value is a png image mime type, otherwise false

Checks if a value passed has a quick time video mime type.

isQuickTimeFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a quick time video mime type

Response

boolean

$valid Returns true if the value is a quick time video mime type, otherwise false

Checks if a value passed has a real audio mime type.

isRealAudioFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a real audio mime type

Response

boolean

$valid Returns true if the value is a real audio mime type, otherwise false

Checks if a value passed has a real media video mime type.

isRealMediaFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a real media video mime type

Response

boolean

$valid Returns true if the value is a real media video mime type, otherwise false

Checks if a value passed has a rich text mime type.

isRtxFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a rich text file mime type

Response

boolean

$valid Returns true if the value is a rich textfile mime type, otherwise false

Checks if a value passed has a tar file mime type.

isTarFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a tar file mime type

Response

boolean

$valid Returns true if the value is a tar file mime type, otherwise false

Checks if a value passed has a tiff image mime type.

isTiffFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a tiff image mime type

Response

boolean

$valid Returns true if the value is a tiff image mime type, otherwise false

Checks if a value passed has a text/.txt mime type.

isTxtFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a text/.txt file mime type

Response

boolean

$valid Returns true if the value is a text/.txt file mime type, otherwise false

Checks if a value passed has a valid email.

isValidEmail(mixed $email) : boolean
static
access

public

Arguments

$email

mixed

The value to check if it is a valid email.

Response

boolean

$valid Returns true if the value is a valid email, otherwise false

Checks if a value passed has a valid url.

isValidUrl(mixed $url) : boolean
static
access

public

Arguments

$url

mixed

The value to check if it is a valid url.

Response

boolean

$valid Returns true if the value is a valid url, otherwise false

Checks if a value passed has a video mime type.

isVideoFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a video mime type

Response

boolean

$valid Returns true if the value is a video mime type, otherwise false

Checks if a value passed has a wav audio mime type.

isWavFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a wav audio mime type

Response

boolean

$valid Returns true if the value is a wav audio mime type, otherwise false

Checks if a value passed has a webm video mime type.

isWebMFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a webm video mime type

Response

boolean

$valid Returns true if the value is a webm video mime type, otherwise false

Checks if a value passed has a wmv video mime type.

isWmvFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a wmv video mime type

Response

boolean

$valid Returns true if the value is a wmv video mime type, otherwise false

Checks if a value passed has a zip file mime type.

isZipFile(mixed $mimetype) : boolean
static
access

public

Arguments

$mimetype

mixed

The value to check if it is a zip file mime type

Response

boolean

$valid Returns true if the value is a zip file mime type, otherwise false

Removes an adapter.

removeAdapter( $class, string $method) : void
inherited static
access

public

Arguments

$class

$method

string

The associated method

Removes an adapter for an entire class.

removeClassAdapter( $class) : void
inherited static
access

public

Arguments

$class

Adds a value to the classes Collection. By default the collection is stored in the public collection. The stored instance can be retrieved later by called in it's key value.

set(string $index, mixed $value) : void
inherited static
access

public

Arguments

$index

string

The key or index to store the value at

$value

mixed

A mixed value that can be anytype

Turn on/off the ability to trace an adapter.Turning on will log an adapter using PVLog when adapter is executed.

setAdapterTrace(boolean $trace = false) : void
inherited static
access

public

Arguments

$trace

boolean

Default is false. If set to true, will trace adatper.

Turn on/off the ability to trace an filter.Turning on will log a filter using PVLog when filter is executed.

setFilterTrace(boolean $trace = false) : void
inherited static
access

public

Arguments

$trace

boolean

Default is false. If set to true, will trace filter.

Turn on/off the ability to trace an observer.Turning on will log an observer using PVLog when the observer is executed.

setObserverTrace(boolean $trace = false) : void
inherited static
access

public

Arguments

$trace

boolean

Default is false. If set to true, will trace observer.

Properties

An array of stored rules and the functions to validate those rules.

rules : 
static

Type(s)

A collection of items that belong to this class

_collection : 
inherited static

Type(s)

A collection of dynamically added methods that below to this class

_methods : 
inherited static

Type(s)

The adapters that have been added

_adapters : 
inherited static

Type(s)

Observers that have been added

_observers : 
inherited static

Type(s)

Instances for singleton that have added

_instances : 
inherited static

Type(s)

Intercepting filters that have been added

_filters : 
inherited static

Type(s)

Boolean for following and logging adapters that have been added

_traceAdapters : 
inherited static

Type(s)

Boolean for following and logging filters that have been added

_traceFilters : 
inherited static

Type(s)

Boolean for following and logging observers that have been added.

_traceObservers : 
inherited static

Type(s)