An open API service indexing awesome lists of open source software.

https://github.com/tobihatti/php-library-collection

✔🌍 A collection of usefull PHP-Libraries for web-development
https://github.com/tobihatti/php-library-collection

framework library php php-library php-oop php7

Last synced: about 1 year ago
JSON representation

✔🌍 A collection of usefull PHP-Libraries for web-development

Awesome Lists containing this project

README

          

# PHP Library Collection

![GitHub](https://img.shields.io/github/license/TobiHatti/PHP-Library-Collection)
[![GitHub Release Date](https://img.shields.io/github/release-date-pre/TobiHatti/PHP-Library-Collection)](https://github.com/TobiHatti/PHP-Library-Collection/releases)
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/TobiHatti/PHP-Library-Collection?include_prereleases)](https://github.com/TobiHatti/PHP-Library-Collection/releases)
[![GitHub last commit](https://img.shields.io/github/last-commit/TobiHatti/PHP-Library-Collection)](https://github.com/TobiHatti/PHP-Library-Collection/commits/master)
[![GitHub issues](https://img.shields.io/github/issues-raw/TobiHatti/PHP-Library-Collection)](https://github.com/TobiHatti/PHP-Library-Collection/issues)
[![GitHub language count](https://img.shields.io/github/languages/count/TobiHatti/PHP-Library-Collection)](https://github.com/TobiHatti/PHP-Library-Collection)

![image](https://endev.at/content/projects/PHP-Library-Collection/PHPLibraryCollection_Banner_300.svg)

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

## MySQL.lib
A lightweight MySQL library with all necessary methods for regular use.

- __NonQuery__

Execute a SQL-Operation like INSERT, UPDATE, ALTER, ...

```php
void MySQL::NonQuery(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
```

- __Scalar__

Get 1 value using a SELECT statement

```php
string MySQL::Scalar(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
```

- __Count__

Count rows of a table using a SELECT statement

```php
int MySQL::Count(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
```

- __Exist__

Checks if a SQL-entry exists using a SELECT statement

```php
bool MySQL::Exist(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
```

- __Row__

Get a single row of the table using a SELECT statement

```php
string[] MySQL::Row(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
```

- __Cluster__

Get multiple rows of the table using a SELECT statement

```php
string[][] MySQL::Cluster(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
```

- __Save__

Saves the database to a `.sql` file

```php
void MySQL::Save(string $backupName)
```

- __PeriodicSave__

Regularly saves the database in a specified period

```php
void MySQL::PeriodicSave([string $backupPeriod = "d"])
```

For more details see the `README.md` in the library folder

## Pager.lib
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

```php
string $pager->SQLAuto(string $sqlStatement [, string $paramTypes, mixed &$parameters...])
```

- __Manual__

Create a manual pager

```php
string $pager->Manual([string $link...])
```

- __SetPagerSize__

Set Shown entries per page

```php
void $pager->SetPagerSize(int $pagerSize)
```

- __SetOffset__

Manually set the current page of the pager

```php
void $pager->SetOffset(int $pagerOffset)
```

- __SetCustomURL__

Set a custom redirect-URL for the pager

```php
void $pager->SetCustomURL(string $customURL)
```

- __GetPagerSize__

Get the amount of shown elements per page

```php
int $pager->GetPagerSize()
```

- __GetOffset__

Get the current page of the pager

```php
int $pager->GetOffset()
```

For more details see the `README.md` in the library folder

## Page.lib
A lightweight PHP-class which adds several usefull Methods to PHP
- __This__

Returns the pages URL and modifies it with given parameters

```php
string Page::This([string $urlModifier])
```

- __Redirect__

Redirects to the provided URL

```php
void Page::Redirect(string $redirectURL [, int $redirectDelay])
```

For more details see the `README.md` in the library folder

## Upload.lib
A simple and reliable PHP-class for Uploading files to the server

- __SetFileElement__

Set PHP-Form file-selector name

```php
void $uploader->SetFileElement(string $phpFileElementName)
```

- __SetPath__

Set target upload path

```php
void $uploader->SetPath(string $targetUploadPath)
```

- __SetName__

Set custom filename for uploaded file

```php
void $uploader->SetName(string $customFileName)
```

- __SetSQLEntry__

Set MySQL-Entry to insert filename or extension into database

```php
void $uploader->SetSQLEntry(string $sqlStatement)
```

- __SetFileTypes__

Define allowed filetypes. Default: all filetypes

```php
void $uploader->SetFileTypes([string $allowedFileTypeExtension...])
```

- __SetMaxFileSize__

Set maximum filesize of file to be uploaded

```php
void $uploader->SetMaxFileSize(string $maxFileSize)
```

- __SetTargetAspectRatio__

Resize image to the defined Aspect Ratio

```php
void $uploader->SetTargetAspectRatio(string $aspectRatio)
```

- __SetTargetResolution__

Set maximum filesize and scale down image without changing aspect ratio

```php
void $uploader->SetTargetResolution(int $maxImageWidth, int $maxImageHeight)
```

- __SetScaleFactor__

Set scale factor for uploaded image

```php
void $uploader->SetScaleFactor(int $scaleFactor)
```

- __OverrideDuplicates__

Define if files with the same fileame should be overwritten or not

```php
void $uploader->OverrideDuplicates(bool $overrideDuplicates)
```

- __Upload__

Uploads the file to the server

```php
void $uploader->Upload()
```

For more details see the `README.md` in the library folder

## Settings.lib
A small PHP-class to save and load Settings stored in a MySQL-Database
- __Set__

Sets a setting with maching keyword to given value

```php
void Setting::Set(string $settingKeyword , string $settingValue)
```

- __Get__

Returns setting's value with maching keyword

```php
mixed Setting::Get(string $settingKeyword)
```

- __Increment__

Increments a settings value and returns the new value

```php
int Setting::Increment(string $settingKeyword[, int $resetLimit])
```

- __Decrement__

Decrements a settings value and returns the new value

```php
mixed Decrement::Get(string $settingKeyword)
```

For more details see the `README.md` in the library folder