PHP Classes

File: examples/IfComposer/example2.php

Recommend this page to a friend!
  Classes of Barton Phillips   Simple Site Class   examples/IfComposer/example2.php   Download  
File: examples/IfComposer/example2.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple Site Class
Simple Site Class
Author: By
Last change: fixeed example2.php
Update with logic similar to what is in site-class.
Changes to be committed:
modified: examples/IfComposer/example1.php
modified: examples/IfComposer/example2.php
modified: examples/IfComposer/example3.php
modified: examples/IfComposer/example4.php
modified: examples/IfComposer/example5.php
new file: examples/IfComposer/example6.php
modified: examples/IfDownloadedZip/example1.php
modified: examples/IfDownloadedZip/example2.php
modified: examples/IfDownloadedZip/example3.php
modified: examples/IfDownloadedZip/example4.php
modified: examples/IfDownloadedZip/example5.php
new file: examples/IfDownloadedZip/example6.php
modified: includes/database-engines/Database.class.php
modified: includes/database-engines/ErrorClass.class.php
modified: includes/database-engines/SqlException.class.php
deleted: includes/database-engines/dbAbstract.class.php
modified: includes/database-engines/dbMysqli.class.php
Reworked docs and examles.
modified: README.html
modified: docs/dbTables.html
modified: docs/examplereadme.html
modified: docs/files.html
modified: docs/index.html
deleted: docs/mk-html.sh
modified: docs/mk-new.sh
modified: docs/siteclass.html
renamed: docs/pandoc.css -> docs/stylesheets/pandoc.css
modified: examples/IfComposer/example1.php
modified: examples/IfComposer/example2.php
modified: examples/IfComposer/example3.php
modified: examples/IfComposer/example4.php
modified: examples/IfComposer/example5.php
modified: examples/README.md
modified: mk-html-gitlog.sh
Date: 10 months ago
Size: 1,213 bytes
 

Contents

Class file image Download
<?php
// The .htaccess file, in this directory has
// SetEnv SITELOADNAME /var/www/vendor/bartonlp/site-class/includes/siteload.php
// You will need the Apache2 setenvif module.
// This gets the siteload.php from the includes directory.

$_site = require_once(getenv("SITELOADNAME"));
$S = new SimpleSiteClass($_site);

// Get the information from the mysitemap.json in the directory above this one.

$SITE = print_r($_site, true);

// Instantiate the Database from the className in the json file.

$S = new SimpleDatabase($_site); // You could also do 'new SimpleSiteClass($_site);'

// Get the info in $S

$CLASS = print_r($S, true);

echo <<<EOF
<h1>This uses the SimpleDatabase class</h1>
<p>Because it does not use SimpleSiteClass it can't use \$top or \$footer.</p>
<hr>
<pre>This is the value of the data in mysitemap.json. \$_site:
$SITE</pre>
<pre>This is the value of the instantiated class. \$S:
$CLASS</pre>
<hr>
<a href="example1.php">Example1</a><br>
<a href="example2.php">Example2</a><br>
<a href="example3.php">Example3</a><br>
<a href="example4.php">Example4</a><br>
<a href="example5.php">Example5</a><br>
<a href="example6.php">Example6</a><br>
<a href="../phpinfo.php">PHPINFO</a>
<hr>
EOF;