SiteClass Version 7+ Psr-4 and PDO
SiteClass is a PHP mini framework for my websites.
Interested In SiteClass? Read On.
This project has several parts that can function standalone or combined.
- SiteClass.class.php : tools for making creating a site a little easier. The class provides methods to help with headers, banners, footers and more.
- Database.class.php : provides a wrapper for different database (MySql, Sqlite3) engines.
- dbPdo.class.php : provides a wrapper for the MySqli and Sqlite3 and has been rigorously tested.
- ErrorClass.class.php : Error and Exception classes
Install
There are several ways to install this project.
Download The ZIP File
Download the ZIP file from GitHub. Expand it and move the src directory somewhere. On a system with Apache2, I usually put the src directory in the /var/www directory that Apache creates. Apache also usually creates /var/www/html and makes this the default DocumentRoot. I put the src directory just outside of the DocumentRoot. In my servers I have /var/www and then have my virtual hosts off that directory. That way the src directory is easily available to all of my virtual hosts.
Use Composer
If you have Apache installed, it has created /var/www. You should create your project in that directory. Apache also creates /var/www/html by default, and if you do not change that, you should create your project within /var/www/html. Or if you want to make a separate Apache virtual host with a registered domain name you can create your new project in /var/www/YOUR_DOMAIN_NAME.
If you do not already have a composer.json file just cut and past the following:
echo "
{
"require": {
"bartonlp/site-class": "dev-main"
}
}" > composer.json
Then run
composer install
OR you can just run
composer require bartonlp/site-class:dev-main
which will create the composer.json for you and load the package like composer install above.