A collection of usefull PHP-Libraries for web-development
For detailed description see the README.md in each libraries folder.
A brief summary of all classes and methods is given below.
Every library is available for procedural programming style and object oriented programming style (object oriented is recommended)
Current libraries:
- MySQL.lib
- Pager.lib
- Page.lib
- Upload.lib
- Setting.lib
A lightweight MySQL library with all necessary methods for regular use.
- NonQuery
Execute a SQL-Operation like INSERT, UPDATE, ALTER, ...
void MySQL::NonQuery(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
- Scalar
Get 1 value using a SELECT statement
string MySQL::Scalar(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
- Count
Count rows of a table using a SELECT statement
int MySQL::Count(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
- Exist
Checks if a SQL-entry exists using a SELECT statement
bool MySQL::Exist(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
- Row
Get a single row of the table using a SELECT statement
string[] MySQL::Row(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
- Cluster
Get multiple rows of the table using a SELECT statement
string[][] MySQL::Cluster(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
- Save
Saves the database to a.sql
file
void MySQL::Save(string $backupName)
- PeriodicSave
Regularly saves the database in a specified period
void MySQL::PeriodicSave([string $backupPeriod = "d"])
For more details see the README.md
in the library folder
A small PHP-class that adds a variety of pagers for SQL and Non-SQL lists
- SQLAuto
Create a pager with a given SELECT statement
string $pager->SQLAuto(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
- Manual
Create a manual pager
string $pager->Manual([string $link...])
- SetPagerSize
Set Shown entries per page
void $pager->SetPagerSize(int $pagerSize)
- SetOffset
Manually set the current page of the pager
void $pager->SetOffset(int $pagerOffset)
- SetCustomURL
Set a custom redirect-URL for the pager
void $pager->SetCustomURL(string $customURL)
- GetPagerSize
Get the amount of shown elements per page
int $pager->GetPagerSize()
- GetOffset
Get the current page of the pager
int $pager->GetOffset()
For more details see the README.md
in the library folder
A lightweight PHP-class which adds several usefull Methods to PHP
- This
Returns the pages URL and modifies it with given parameters
string Page::This([string $urlModifier])
- Redirect
Redirects to the provided URL
void Page::Redirect(string $redirectURL [, int $redirectDelay])
For more details see the README.md
in the library folder
A simple and reliable PHP-class for Uploading files to the server
- SetFileElement
Set PHP-Form file-selector name
void $uploader->SetFileElement(string $phpFileElementName)
- SetPath
Set target upload path
void $uploader->SetPath(string $targetUploadPath)
- SetName
Set custom filename for uploaded file
void $uploader->SetName(string $customFileName)
- SetSQLEntry
Set MySQL-Entry to insert filename or extension into database
void $uploader->SetSQLEntry(string $sqlStatement)
- SetFileTypes
Define allowed filetypes. Default: all filetypes
void $uploader->SetFileTypes([string $allowedFileTypeExtension...])
- SetMaxFileSize
Set maximum filesize of file to be uploaded
void $uploader->SetMaxFileSize(string $maxFileSize)
- SetTargetAspectRatio
Resize image to the defined Aspect Ratio
void $uploader->SetTargetAspectRatio(string $aspectRatio)
- SetTargetResolution
Set maximum filesize and scale down image without changing aspect ratio
void $uploader->SetTargetResolution(int $maxImageWidth, int $maxImageHeight)
- SetScaleFactor
Set scale factor for uploaded image
void $uploader->SetScaleFactor(int $scaleFactor)
- OverrideDuplicates
Define if files with the same fileame should be overwritten or not
void $uploader->OverrideDuplicates(bool $overrideDuplicates)
- Upload
Uploads the file to the server
void $uploader->Upload()
For more details see the README.md
in the library folder
A small PHP-class to save and load Settings stored in a MySQL-Database
- Set
Sets a setting with maching keyword to given value
void Setting::Set(string $settingKeyword , string $settingValue)
- Get
Returns setting's value with maching keyword
mixed Setting::Get(string $settingKeyword)
- Increment
Increments a settings value and returns the new value
int Setting::Increment(string $settingKeyword[, int $resetLimit])
- Decrement
Decrements a settings value and returns the new value
mixed Decrement::Get(string $settingKeyword)
For more details see the README.md
in the library folder