psportal-murray/appReadMeFirst.php
2019-02-17 19:40:33 -07:00

246 lines
8.2 KiB
PHP

<?php
/*
Copyright 2018 Murray Hayes
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
include_once 'DOMUtils.php';
include_once 'utils.php';
$doc = returnDoc();
$root = returnRoot($doc);
$root = $doc->appendChild($root);
$root->appendChild(generateHead($doc));
$body = $doc->createElement('body');
$root->appendChild($body);
$mastHead = $doc->createElement('h1');
$mastHead->appendChild($doc->createTextNode("Read Me"));
$mastHead->setAttribute('class', 'mastHead');
$body->appendChild($mastHead);
$div = $doc->createElement('div');
$div->setAttribute('class', 'readMe');
$body->appendChild($div);
$str = <<<EOD
This is the read me file for the member portal. It details some of
the critical files an administrator needs to know about during setup
and maintanance in no particular order.
EOD;
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
The consts.php file contains all the constants used throughout the
system including the password for the database. It should be moved
out of the document root (automagically by setup) in to an include
directory. Every admin should check that these constants are correct
for their site. Just about every file has an include_once for this
file.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('consts.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
The sql.php file contains all the SQL statements. Alternate statments
for database engines other than MySQL should go in the appropirate
place reserved for them in the switch statement at the bottom. The
default statements are for MySQL but all the engines supported by the
PDO driver should have a spot reserved for them. This file should be
moved out of the document root in to an include directory.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('sql.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
The database.php file contains all the database access functions. These
typically have names like populateThisTable or generateThatForm. The
SQL statements are pulled from the sql.php file. This file should be
moved out of the document root in to an include directory.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('database.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
Utility functions obviously. This file was created very early and
has a bit of a mish mash of functions. This file should be moved out
of the document root in to an include directory.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('utils.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
The DOMUtils.php file was created after a bunch of pages were already
written and I had gained an understanding of the DOM API. A lot of
tedious coding could have been saved with this file and it makes for
a much more uniform approach to things like formatting and changing
between HTML and XML output. This file should be moved out of the
document root and in to an include directory.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('DOMUtils.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
The setup.php file is meant to be run once (but was run constantly
during development) to initialize the database and configure the
system including moving include files out of the document root
(eventually). I'm not sure if this file should self emolate or move
its self somewhere or what. For now it remains in the document root
which is probably a security flaw of some kind....
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('setup.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
This file has a few utility functions most pages don't need. This
file should be moved out of the document root in to an include
directory.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('formUtils.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
Template files are the skeletons for making new pages. They provide
a blank functioning page ready to be filled with content respective
to their name.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('*-template.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
The only file that relies on a library (fpdf.php) so far. The
library can go in an include subdirectory or not. That should
eventually be part of the setup process. This page is also the
only one that doesn't output html or xml, instead it generates
a PDF of the application form for the currently logged in user.
This needs to be tested and adjusted for the case of a new sign
up.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('applicationForm.php'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
Most other files are the actual pages that make up the site. Most
are based on a template file but the templates changed during
development and so they are by no means consistant. A code audit
should include fixing that.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('other php files'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
The style sheet for the website.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('members.css'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
$str = <<<EOD
That is all I have for now. Hope this helps make this system easier
to understand.
EOD;
$header = $doc->createElement('h3');
$header->appendChild($doc->createTextNode('End Of Line'));
$div->appendChild($header);
$para = $doc->createElement('p');
$para->appendChild($doc->createTextNode($str));
$div->appendChild($para);
outputDoc($doc);
?>