| 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 | } |
|---|