Skip to content

Instantly share code, notes, and snippets.

@eyadof
Created July 6, 2012 12:31
Show Gist options
  • Save eyadof/3059910 to your computer and use it in GitHub Desktop.
Save eyadof/3059910 to your computer and use it in GitHub Desktop.
<?php
require_once 'conf.php';
require_once 'classes/DB.php';
function E_error_log ($error,$den,$file=__FILE__,$line=__LINE__){
$Error= date("Y/d/m h:i:s A ",time())." Error : ". $error." on file : {$file} , line : {$line} \n" ;
$con=fopen($den, "a");
fwrite($con, $Error);
fclose($con);
if(DEVMOD){
echo $error ;
}
}
function E_log($mes,$den){
$con=fopen($den, "a");
$Mes= date("Y/d/m h:i:s A ",time())." : ". $mes."\n" ;
fwrite($con, $Mes);
fclose($con);
}
function PlugIns_det()
{
global $Edb;
$resault = $Edb->run_query("select name from plugIns");
$Current_PlugIns = array();
while ($row = $Edb->fetch_array($resault)){
$Current_PlugIns[]=$row['name'];
}
foreach(scandir(BASEPATH."/plugIns/") as $dir)
{
if ((!is_file(BASEPATH."/PlugIns/".$dir)) && ($dir != ".." && $dir != "."))
{
if (!in_array($dir, $Current_PlugIns))
{
$Edb->insert("plugIns", array(name),array($dir));
echo "some thing added";
}
}
}
}
PlugIns_det();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment