Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
autoload.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 
8 require_once 'WHAT/classAutoloader.php';
9 include_once 'WHAT/Lib.Prefix.php';
10 
11 class excludeSomeFiles extends FilterIterator
12 {
13  public function accept()
14  {
15  $c = $this->current();
16 
17  if (substr($c, -4) != '.php') return false;
18  $exclusionPatterns = array(
19  './.img-resize/',
20  './admin/',
21  './context/',
22  './fckeditor/',
23  './jscalendar/',
24  './Images/',
25  './img-cache/',
26  './lib/ext/',
27  './lib/zendframework/',
28  './locale/',
29  './session/',
30  './vaultfs/'
31  );
32 
33  foreach ($exclusionPatterns as $pattern) {
34  if (substr($c, 0, strlen($pattern)) == $pattern) {
35  return false;
36  }
37  }
38 
39  if (preg_match('/Method\./', $c)) return false;
40  return is_readable($c);
41  }
42 }
43 
44 \dcp\DirectoriesAutoloader::instance(DEFAULT_PUBDIR, '.autoloader.cache')->addDirectory('./')->addCustomFilter('excludeSomeFiles')->register();
45 ?>
← centre documentaire © anakeen - published under CC License - Dynacase