Development

Changeset 3263

You must first sign up to be able to contribute.

Changeset 3263

Show
Ignore:
Timestamp:
01/13/07 15:20:52 (2 years ago)
Author:
fabien
Message:

pake: allow pre-loading of pake plugins

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/pake/trunk/lib/pake/pakeFunction.php

    r3069 r3263  
    2222  $class_name = 'pake'.ucfirst(strtolower($name)).'Task'; 
    2323 
    24   // plugin available? 
    25   $plugin_path = ''; 
    26   foreach (pakeApp::get_plugin_dirs() as $dir) 
    27   { 
    28     if (file_exists($dir.DIRECTORY_SEPARATOR.$class_name.'.class.php')) 
    29     { 
    30       $plugin_path = $dir.DIRECTORY_SEPARATOR.$class_name.'.class.php'; 
    31       break; 
    32     } 
    33   } 
    34  
    35   if ($plugin_path) 
    36   { 
    37     require_once $plugin_path; 
    38   } 
    39   else 
    40   { 
    41     throw new pakeException(sprintf('Plugin "%s" does not exist.', $name)); 
     24  if (!class_exists($class_name)) 
     25  { 
     26    // plugin available? 
     27    $plugin_path = ''; 
     28    foreach (pakeApp::get_plugin_dirs() as $dir) 
     29    { 
     30      if (file_exists($dir.DIRECTORY_SEPARATOR.$class_name.'.class.php')) 
     31      { 
     32        $plugin_path = $dir.DIRECTORY_SEPARATOR.$class_name.'.class.php'; 
     33        break; 
     34      } 
     35    } 
     36 
     37    if ($plugin_path) 
     38    { 
     39      require_once $plugin_path; 
     40    } 
     41    else 
     42    { 
     43      throw new pakeException(sprintf('Plugin "%s" does not exist.', $name)); 
     44    } 
    4245  } 
    4346