INPORTANT NOTE: you can disable the log function by either setting $_site->noTrack=true or adding "noTrack":true, to the mysitemap.json. Doing either of those things will keep the SimpleSiteClass from using the logagent table to log visitors. This will also mean that example2.php programs will not work.
You will need to install sqlite3 for the OS and the pdo_sqlite for PHP, or install mysql for the OS and pdo_mysql for PHP.
The SimpleSiteClass code runs with PHP 8+, and it may not work with older versions of PHP.
These examples use a database called barton with user barton. There is a file in this directory called schema.sql if you want a MySql database. You can run it in mysql and create the table.
If you are using sqlite a database named barton will be created when you run the examples.
Now that the database is set up you can run the examples.
I have included twp examples to show how to use the SimpleSiteClass. If you set up your directory structure as:
/var/www/
/var/www/html
and used composer to create a /var/www/vendor/bartonlp/simple-site-class directory.
You can also clone the repository from https://github.com/bartonlp/simple-site-class.
In either case, from the examples directory in the downloaded location, do:
php -S localhost:3000
Then open your browser and enter:
localhost:3000/example1.php
When you do this you should see the following message:
Open the example file and fill in the $home variable.
You can also add a query: ?home=<your home directory>.
For example, the query string would be ?home=/var/www, if you cloned the repository into your /var/www directory.
Each example has a link to the other example.
Note, that when running with the PHP server it does not use the apache .htaccess file.
You can run both sets of examples from a browser if you have the apache server running on your machine. In that case you should copy the the examples directory to your apache server page.
Any questions can be directed to Barton Phillips at bartonphillips@gmail.com
Have fun
Barton Phillips : bartonphillips@gmail.com
Copyright © 2025 Barton Phillips
Project maintained by Barton Phillips
Last Modified January 1, 2025