(Translated by https://www.hiragana.jp/)
GitHub - NevilleBulmer/RESTful_PHP_API: An example of a database wrapper built in PHP, comes with helper classes, I.e. for sanitizing strings, checking user input and generating hashes.
Skip to content

An example of a database wrapper built in PHP, comes with helper classes, I.e. for sanitizing strings, checking user input and generating hashes.

Notifications You must be signed in to change notification settings

NevilleBulmer/RESTful_PHP_API

Repository files navigation

RESTful PHP API along with an angular js front end example.

For the full API which is not currently documented, check 'Currently not documented'.

A RESTful API built using vanilla PHP. See explanantions below for more information.

Files will be uploaded once they are all complete.

The API is designed to be used in many contexts and with this in mind it returns and send all information in JSON, below is a representation of the file structure along with an explanation of the end points.

Along with an API, provided is an angular js front end example, this is to serve the purpouse of providing a full and concise example.

Class CheckInput.

Checks is the input is POST or GET.

Class Redirect.php

Used to redirect from one page to another, also check if the location will result in a 404 or 403 error.

Class Token.php

Used for generating unique tokens, This is the perfect solution for preventing cross site scripting attacks.

Class Validation.php

Used for custom validation, I.e. is the username provided too long, short or does it meet the certain criteria. Can be used for any user input, I.e. does the email meet the criteria needed, I.e. is there an @ symbol present, does it end with .com, .co.uk so on and so forth.

Class HashGenerator.php

Used for creating hashes, salts and/or generating password hashes in there entirety, I.e. the database would store the password hash, the salt and when the user goes to login this information would be used to authenticate the user.

Class DatabaseConnectivity.php

Utilising the singletone pattern, this is a database wrapplet class which abstracts all information for use with multiple databases and tables, this is acomplished by the abstraction, as using this technique there is no identifying information in this class, instead everything is held as a variable.

Class DatabaseWrapplet.php

Explanation and upload to come.

Class Configuration.php

Explanation and upload to come.

Class SanitizeString.php

Explanation and upload to come.

Class Session.php

Explanation and upload to come.

More to come.

About

An example of a database wrapper built in PHP, comes with helper classes, I.e. for sanitizing strings, checking user input and generating hashes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published