ok i have been working on a framework the frameworks goal is to be an embedded command langauge that helps with RAD.
the problem i'am having is in my libray database.php when it tries to include the database libaray.
in Root directory
<?php
foreach (glob("*.php", GLOB_NOSORT )as $filename) // searching for filetype
{
$open=fopen($filename, 'rb'); // opening the files
$fileget=file_get_contents($filename); // getting the contents in a string
$replaceit=preg_match_all('/^Build/' , $fileget , $buildmatch); //matching pattern in file returning array of matches
foreach($buildmatch as $bmatch) // looping through array $buildmatch as eac match is now bmatch
{
$bmatch=include('./system/lib.php'); //inlcudes the system lib
}
}
?>
in directory systems folder lib.php
<?php
include('config.php');
$replaceit=preg_match_all('/^Connection/' , $fileget , $connectionmatch); //matching pattern in file returning array of matches
foreach($connectionmatch as $cmatch) // looping through array $connectionmatch as eac match is now bmatch
{
$cmatch= include('.../library/Databases/database.php'); //problem area
}
?>
in systems/libaray/database directory database.php
$replaceit=preg_match_all('/^db\_create/' , $fileget , $dbcreatematch); //matching pattern in file returning array of matches
foreach($dbcreatematch as $dbcmatch) // looping through array $buildmatch as eac match is now bmatch
{
$dbcmatch=$databasecreate; //bmatch eaquals includelib variable
$databasecreate="C scope";
echo "$databasecreate";
}
$replaceit=preg_match_all('/^db\_connect/' , $fileget , $dbconnectmatch); //matching pattern in file returning array of matches
foreach($connectmatch as $dcmatch) // looping through array $buildmatch as eac match is now bmatch
{
$dcmatch=$databasecronnect; //bmatch eaquals includelib variable
$databaseconnect=mysqli_connect($hostname, $username, $password, $database) {
or die('Failed to connect to mysql');
}
}
?>
also any suggestions would be great to but as i said i have the problem when trying to include database.php in lib.php