This class is meant to create hash strings that are used as keys to store private data.
The hash strings and the private data are stored in a database table so it can verified securely only on the server side. This capability can be for instance to prevent link stealing.
You may construct an hash string from:
- Session id of the user
- Private data of the server
- Private data of the web site
- An item to check
- Timestamp of a query
- A maximum number of accesses
- A maximum duration
Next, in another page, the class can check whether the hash is valid by passing as parameter in the UL, depending on:
- The item to check
- The session id of the user
- The private data of the server
- The private data of the Web site
- The moment when the has was saved in database
- The moment and the number of the access
Check whether variable values match expected types
This class can be used to check the values of given PHP variables and verify whether they contain values of the expected types.
It provides many functions that can check whether given values are of the basic PHP types: array, boolean, double, integer and string.
It may also check whether the tested values are objects of a given class or sub-class, a callable function, a valid resource handle, the path of a directory, regular file, executable program, readable or writable file, an uploaded file, or symbolic link, a finite or infinite number, or not a number.
When the values do not match the expected types, the class triggers an error denoting the line and the script file where the check was performed.
This class can be used to validate and handle files uploaded via Web forms. It can check:
- If the file does not exceed a given size limit
- If the file name has one of the accepted extensions
- If there is a file with the same name in the target directory
If the uploaded file verifies the validation rules, the class moves the file to a given directory.
The class may also return the URL for a link to download the uploaded files.
The code and the comments are in Italian.
In Italian:
Classe Upload è una classe con semplici funzioni da usare per uppare i file.
Contiene le funzioni di: sovrascrivi rinomina File, estensioni consentite, dimensioni massime, restituzione link al file uppato.
This package can be used to manipulate type safe objects in a way that works with PHP caching extensions.
It provides base classes that can check whether the types of the values to assign variables of implementation subclasses are of the expected types.
The expected types are determined by the prefixes of private variables, so it works well even when using PHP compiled code cached extensions.
An additional class can serialize objects as XML documents or to insert them in database tables.
The goal of this class is not to replace ORM or other db classes. It shall replace
the stdClass when using mysql_fetch_object.
It returns a value type object for each column. There are a number of value types:
+ TString
+ TNumber
+ TBit
+ TEnum
+ TLob
+ TTimestamp
These value types have specific sets of methods. i.e. TTimestamp value types are working
internally with the php native DateTime class.
TString has a bunch of methods to manipulate the output string.