Coder Social home page Coder Social logo

tobihatti / php-library-collection Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 56 KB

โœ”๐ŸŒ A collection of usefull PHP-Libraries for web-development

Home Page: https://endev.at/p/PHP-Library-Collection

License: MIT License

PHP 90.58% JavaScript 9.42%
php php7 php-oop library framework php-library

php-library-collection's Introduction

PHP Library Collection

GitHub GitHub Release Date GitHub release (latest by date including pre-releases) GitHub last commit GitHub issues GitHub language count

image

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, ...
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

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
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

Page.lib

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

Upload.lib

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

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
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

php-library-collection's People

Contributors

tobihatti avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

papyr

php-library-collection's Issues

SQL-Link limit exceeded

When including more than 5 libraries that require a DB-connection (tested on localhost) the SQL-Server refuses to allow another connection. A general sql.config.php for all libraries is required to only create 1 DB link!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.