note 109739 deleted from function.is-dir by danbrown
| From: | danbrown@php.net | Date: | Fri, 31 Aug 2012 15:57:49 +0000 |
| Subject: | note 109739 deleted from function.is-dir by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190356@lists.php.net to get a copy of this message | ||
Note Submitter: sdevpura5 at gmail dot com
----
class Reco_include{
private $r_dirname;
private $r_ex_file_array;
private $message;
private $files_array;
private $excep_files;
function __construct($dirname="",$excep_files_array=array()){
if(is_array($excep_files_array) || $excep_files_array==""){
$this->excep_files=$excep_files_array;
if($dirname!=""){
$this->r_dirname=PATH.'/'.$dirname;
$this->Reco_include_file();
}
}else{
$this->message="Only Array Is Allowed In Secund Peramitar";
}
}
private function Reco_get_dir_deta(){
if($header=opendir($this->r_dirname.'/')){
while(false !== ($file=readdir($header))){
if($file != '.' && $file != '..'){
$this->all_file_folder[]=$file;
}
if($file != '.' && $file != '..' && is_dir($file) == false
&& (pathinfo($file,PATHINFO_EXTENSION)=="php")==true){
if(!in_array($file,$this->excep_files)){
$this->files_array[]=$file;
}
}
}
}else{
die("Error In Opening Or Reading The Dir : ".$this->r_dirname);
}
}
private function Reco_include_file(){
$this->Reco_get_dir_deta();
for($i=0;$i<count($this->files_array);$i++){
include($this->r_dirname.'/'.$this->files_array[$i]);
}
}
}
?>
hi this class can open dir and can include all php files in this folder .