Location: PHPKode > scripts > QValidation > qvalidation/Validation/DataType/Resource.php
<?php

class Validation_DataType_Resource extends Validation implements ValidInterface {

	public static function getInstance(){
		return new Validation_DataType_Resource;
	}

	/**
	 * validateResource
	 * @param resource $value
	 * @param string $type
	 */
	public function validateResourceType($value, $type){
		if(is_resource($value) and get_resource_type($value)==$type){
			return true;
		}
		return false;
	}


	public function validateAspell($value){
		return self::validateResourceType($value,"aspell");
	}

	public function validateBzip2($value){
		return self::validateResourceType($value,"bzip2");
	}

	public function validateCOM($value){
		return self::validateResourceType($value,"COM");
	}

	public function validateCpdf($value){
		return self::validateResourceType($value,"cpdf");
	}

	public function validateCurl($value){
		return self::validateResourceType($value,"curl");
	}

	public function validateDbm($value){
		return self::validateResourceType($value,"dbm");
	}

	public function validateDba($value){
		return self::validateResourceType($value,"dba");
	}

	public function validateDbaPersistent($value){
		return self::validateResourceType($value,"dba persistent");
	}

	public function validateDbase($value){
		return self::validateResourceType($value,"dbase");
	}

	public function validateFdf($value){
		return self::validateResourceType($value,"fdf");
	}

	public function validateFtp($value){
		return self::validateResourceType($value,"ftp");
	}

	public function validateGd($value){
		return self::validateResourceType($value,"gd");
	}

	public function validateGdFont($value){
		return self::validateResourceType($value,"gd font");
	}

	public function validateGdPsFont($value){
		return self::validateResourceType($value,"gd ps font");
	}

	public function validateGdPsEncoding($value){
		return self::validateResourceType($value,"gd ps encoding");
	}

	public function validateImap($value){
		return self::validateResourceType($value,"imap");
	}

	public function validateImapPersistent($value){
		return self::validateResourceType($value,"imap persistent");
	}

	public function validateImapChainPersistent($value){
		return self::validateResourceType($value,"imap chain persistent");
	}

	public function validateJava($value){
		return self::validateResourceType($value,"java");
	}

	public function validateLdapLink($value){
		return self::validateResourceType($value,"ldap link");
	}

	public function validateLdapResult($value){
		return self::validateResourceType($value,"ldap result");
	}

	public function validateMSqlLinkPersitent($value){
		return self::validateResourceType($value,"msql link persistent");
	}

	public function validateMSqlLink($value){
		return self::validateResourceType($value,"msql link");
	}

	public function validateMSqlResult($value){
		return self::validateResourceType($value,"msql result");
	}

	public function validateMySqlLinkPersitent($value){
		return self::validateResourceType($value,"mysql link persistent");
	}

	public function validateMySqlLink($value){
		return self::validateResourceType($value,"mysql link");
	}

	public function validateMySqlResult($value){
		return self::validateResourceType($value,"mysql result");
	}

	public function validateOdbcLinkPersitent($value){
		return self::validateResourceType($value,"odbc link persistent");
	}

	public function validateOdbcLink($value){
		return self::validateResourceType($value,"odbc link");
	}

	public function validateOdbcResult($value){
		return self::validateResourceType($value,"odbc result");
	}

	public function validateOracleCursor($value){
		return self::validateResourceType($value,"oracle cursor");
	}

	public function validateOracleLink($value){
		return self::validateResourceType($value,"oracle link");
	}

	public function validateOracleLinkPersistent($value){
		return self::validateResourceType($value,"oracle link persistent");
	}

	public function validatePgSqlLink($value){
		return self::validateResourceType($value,"pgsql link");
	}

	public function validatePgSqlLinkPersistent($value){
		return self::validateResourceType($value,"pgsql link persistent");
	}

	public function validatePgSqlResult($value){
		return self::validateResourceType($value,"pgsql result");
	}

	public function validatePgSqlLargeObject($value){
		return self::validateResourceType($value,"pgsql large object");
	}

	public function validatePgSqlString($value){
		return self::validateResourceType($value,"pgsql string");
	}

	public function validatePdfImage($value){
		return self::validateResourceType($value,"pdf image");
	}

	public function validatePdfDocument($value){
		return self::validateResourceType($value,"pdf document");
	}

	public function validatePdfOutline($value){
		return self::validateResourceType($value,"pdf outline");
	}

	public function validateXml($value){
		return self::validateResourceType($value,"xml");
	}

	public function validateStream($value){
		return self::validateResourceType($value,"stream");
	}
	
	public function validateDir($value){
		return self::validateResourceType($value->handle,"stream");
	}

	public function validateFile($value){
		return self::validateStream($value);
	}

	public function validateZlib($value){
		return self::validateResourceType($value,"zlib");
	}

}
Return current item: QValidation