XOOPS  2.6.0
xoopsfile.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
28 class XoopsFile
29 {
40  public static function getHandler($name = 'file', $path = false, $create = false, $mode = null)
41  {
42  $handler = null;
43  $name = strtolower(trim($name));
44  $class = 'Xoops' . ucfirst($name) . 'Handler';
45  if (in_array($name, array('file', 'folder'))) {
46  $handler = new $class($path, $create, $mode);
47  } else {
48  trigger_error(
49  'Class ' . $class . ' not exist in File ' . __FILE__ . ' at Line ' . __LINE__,
50  E_USER_WARNING
51  );
52  return false;
53  }
54  return $handler;
55  }
56 }
$path
Definition: execute.php:31
static getHandler($name= 'file', $path=false, $create=false, $mode=null)
Definition: xoopsfile.php:40