note 105571 added to function.get-included-files

From: Date: Mon, 29 Aug 2011 10:32:41 +0000
Subject: note 105571 added to function.get-included-files
Groups: php.notes 
Request: Send a blank email to php-notes+get-182795@lists.php.net to get a copy of this message
This function aims to perform filtering of files that have been included : function setIncludeFiles($arrayInc = array()){ $incFiles = get_included_files(); if((count($arrayInc)>0)&&(count($incFiles)>0)){ $aInt = array_intersect($arrayInc,$incFiles); if(count($aInt)>0){ return false; }elseif(count($aInt)<1) { foreach($arrayInc as $inc){ if(is_file($inc)) include($inc); else{ return false; } } } }else{ return false; } } Usage : $toBeInclude = array('/data/your_include_files_1.php', '/data/your_include_files_2.php', '/data/your_include_files_3.php', ); setIncludeFiles($toBeInclude); Return false if something goes wrong. ---- Server IP: 202.182.182.183 Probable Submitter: 112.215.33.149 ---- Manual Page -- http://www.php.net/manual/en/function.get-included-files.php Edit -- https://master.php.net/note/edit/105571 Del: integrated -- https://master.php.net/note/delete/105571/integrated Del: useless -- https://master.php.net/note/delete/105571/useless Del: bad code -- https://master.php.net/note/delete/105571/bad+code Del: spam -- https://master.php.net/note/delete/105571/spam Del: non-english -- https://master.php.net/note/delete/105571/non-english Del: in docs -- https://master.php.net/note/delete/105571/in+docs Del: other reasons-- https://master.php.net/note/delete/105571 Reject -- https://master.php.net/note/reject/105571 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#182795) next »