PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of bassam alessawi   Sfhati PHP engine   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Sfhati PHP engine
Template engine that generates PHP compiled files
Author: By
Last change: Update of index.php
Date: 8 months ago
Size: 1,168 bytes
 

Contents

Class file image Download
<?php
error_reporting
(E_ERROR | E_WARNING | E_PARSE);


// include class file
include('syntax.php');
 
$syntaxcode = new __SYNTAX();
// include all plugin
$dir = dirname(realpath(__FILE__)) . DIRECTORY_SEPARATOR . 'plugin' . DIRECTORY_SEPARATOR;
if (
$dh = opendir($dir)) {

    while ((
$file = readdir($dh)) !== false) {
        if (
$file != '.' && $file != '..' && filetype($dir . $file) != 'dir') {
            include(
$dir . $file);
        }
    }
   
closedir($dh);
}

// this function can translate template file and return execute php file content as a variable ,
// so you can make things in out content!
function include_file_template($template_name) {
    global
$syntaxcode;
 
    if (
end(explode('.', $template_name)) != 'inc')
       
$template_name = $template_name . '.inc';
   
$export_filename = $syntaxcode->openfile($template_name);
   
   
ob_start();
    include(
$export_filename);
    return
ob_get_clean();
}

// translate template.inc file using include_file_template() function
$my_simple_tmplt = include_file_template('template/template.inc');

// print out exeute php file
echo $my_simple_tmplt;