FrameBeurk documentation

10. Miscellaneous

10.1. .htaccess File

Example of .htaccess file with URI rewriting, to put at the root folder of the website :

SetEnv PHP_VER 5 SetEnv REGISTER_GLOBALS 0 SetEnv MAGIC_QUOTES 0   <IfModule mod_rewrite.c>  RewriteEngine  on RewriteBase /Fmbk/ # exclusions RewriteRule ressources/(.*) - [L] RewriteRule ^index.php(.*) - [L] RewriteRule ^ajax.php(.*) - [L] RewriteRule ^js.php(.*) - [L] RewriteRule ^css.php(.*) - [L] RewriteRule ^rss.php(.*) - [L]   # redirection RewriteRule (.*) interpreteur.php </IfModule>

10.2. Personal Pages at free.fr

FrameBeurk has been conceived so it can be used on the free.fr personal pages, with a few limitations :

The .htaccess file below is recommended :

php 1 ErrorDocument 404 /forum2/interpreteur.php

(*) : The instruction ErrorDocument redirects unresolved URI to the interpreter. One could consider to use this way to make URI rewriting. Unfortunately, parameters sent by the POST method are lost during the 404 redirection. Therefore, most of Maj actions would not work.

10.3. The concept of URI

The « address » sent to the framework with the GET method does not comply to the definition of an URL (Uniform Ressource Locator) neither an URI (Uniform Ressource Identifier), because it can contain the parameters for a Maj action, an alternative (Vue or Error Vue) and lead to different displays. We would need a more general term to qualify the « addresses » used in FrameBeurk.

Remark that block (2) of the diagram about URI rewriting (chapter « Features ») fits the concept of URI. It is this block (2) that is returned by the server as the canonical URI of the page.

10.4. Implementation rules

This framework is built in procedural programming and as long as possible, in sequential programming - the code sequences being gathered by instructions include and require. All the code share the same common namespace. Here are the implementation rules that have been chosen :

10.5. Generation of HTML code

Having tested several styles of implementation for the output (echo) of the HTML code, it appears to me that :

So, I ended on a questionable writing that should nevertheless have the advantages of concision and of greater speed of execution by the PHP engine. Example (without context) :

echo '<div id="', $nomDiv, '" class= "test"> ', $ligne1, '<br /> ', $ligne2, '<br /> </div> ';

Using the ternary operator is still possible with this writing, but the lisibility decreases :

echo '<div id="', $nomDiv, '" class= "test"> ',(($cas1 == true) ? ($ligne1 . '<br /> ' . $ligne2 . '<br />') : 'Pas dans le cas 1<br />'), '</div> ';

This way of implementing is in no way mandatory to use FrameBeurk.

10.6. Prospective

Obviously this is only an alpha version and there is so much left to do. In the short or medium term :

In the long term, as suggested by the X-ray of Beurky PHP's head illustrating this documentation, I want to give to this framework an architecture leading each website built with it to be an Artificial Intelligence, that could behave like an agent.



© 2010-2015 by ToolOscope SASU. © 2016-2018 by Arnaud De Rette. All rights reserved