Menu

Install-Setup

Kelly Allen

Installing RADPHE

The Rapid Application Development PHP Hosting Environment.

Normally it is intended to be a transparent php environment but you need t see what it is doing until you understand it or I refactor it.

It mimics the original ColdFusion rapid application convention of Application Blankets. That is that all the requests will load _application.php prior to executing the script of the request but after the site engine. So if your website sub application looks like this /App/*.php then you can have /App/_application.php run prior to everything in the directory. But if one is not there it will traverse over the path to the site root looking for the nearest _application.php and if it finds one it will use it. So it also works for subdirectories of /App.

It will put your site in an out put buffer.
With replaceable nested blocks. That you can then modify, parce, re-process, redefine, prepend, or append these Blocks of code with your php skills. You have the option to make the response from the server exactly how you want it. And that is what becomes the meat of your request urls... only what makes that response different from the other areas of your website.
You would eventually modify your layout to use the CMS-Skinner and CMS-Blocks. CMS-SEO is optional otherwise you will see your site inside the default and basic layout.

If you get into this and use it before i make it nice you will want to be looking at new versions through a merge'er lense. It will be chaining a lot.
Soon it will be split up into 2 parts. The Engine. The Examples of its usage.

The Site Engine Hook

Ideally you would be using Apache and mod_php with mod_rewrite as your stack.

You lastly also need to have Apache's site configuration declaration have the setting AllowOveride All as it defaults to none. This will allow .htaccess files to have full customization of the hosting configurations and unlike php.ini it will also be a present control on all subdirectories.
This allows us to use auto_prepend_file /var/www/file.php directive for php in .htaccess and that allows us to have every php request initiated first by the site engine.
It will continue to propagate the Apache+PHP setting in all subdirectories until it reaches another .htaccess which specifies it as auto_prepend_file none
The special value none disables auto-prepending.

In the php manual it says: auto_prepend_file - part of ini.core - Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the require function, so include_path is used.
https://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

But if you need there are several ways to achieve this affect.
php.ini or .user.ini can also be used to set this enviorment up but you must have the ini file in every folder you have that is expected to have this rule.
https://websistent.com/php-auto_prepend_file-and-auto_append_file/
This is frowned upon.

You can configure php to run this way with its own php.ini and then every php page served will use the setting but that may affect outside your intended site wwroot.

You can also manual include the site engine in every php file at the top of the file.

You will want one of these methods below.
You may use the next php line as a backup hook, so you may have 2 hooks.
require_once($_SERVER['DOCUMENT_ROOT'].'/_system/_SiteEngine.php');
Notice that as a backup method the file included is _SiteEngine.php
This is where the engine actually starts and if you use multiple loaders then you will see 2 prepends in the ingredients.
Precedence of .htaccess, php.ini, .user.ini are unknown after the server httpd.conf so beware of useing more than 2 hooks.

Preferred.

.htaccess

FallbackResource /_system/_PrePend_Hook_Fallback_ini.php
php_value auto_prepend_file _PrePend_Hook.htaccess.prefered.php

'Service' config level if you own your hosting server.

httpd.conf - apache installation

php.ini - php installation

auto_prepend_file = _PrePend_Hook_httpd.php.ini.php

'User' config level if you are on a shared server and dont have .htaccess and it dosent have the ability to use php_value auto_prepend_file.

php.ini or .user.ini - per directory

auto_prepend_file = _PrePend_Hook_dir.php.ini.php

At the top of every php script.

require_once($_SERVER['DOCUMENT_ROOT'].'/_system/_PrePend_Hook_Include.php');

Information

http://nyphp.org/PHundamentals/1_PHP-Initialization-phpini
https://electrictoolbox.com/php-automatically-append-prepend/

.