namespace.diff

Patch à appliquer pour un premier essai sur les namespace associés à des répertoires - webmyster, 03/07/2012 11:05 AM

Download (1005 Bytes)

View differences:

inc/autoload.function.php (working copy)
59 59
**/
60 60
function isPluginItemType($classname) {
61 61

  
62
   if (preg_match("/Plugin([A-Z][a-z0-9]+)([A-Z]\w+)/",$classname,$matches)) {
62
   if (preg_match("/Plugin([A-Z][a-z0-9]+)([A-Z][a-z0-9_\\\\]+)/",$classname,$matches)) {
63 63
      $plug           = array();
64 64
      $plug['plugin'] = $matches[1];
65 65
      $plug['class']  = $matches[2];
......
293 293

  
294 294
   // No errors for missing classes due to implementation
295 295
   if (!in_array($item,$CFG_GLPI['missingclasses'])){
296

  
297
      // Management of namespaces by prepending the namespace as a directory
298
      if (strpos($item, '\\') !== false) {
299
         $item = str_replace('\\', '/', $item);
300
      }
301

  
296 302
      if (file_exists("$dir$item.class.php")) {
297 303
         include_once("$dir$item.class.php");
298 304
         if (isset($_SESSION['glpi_use_mode'])