7 public function getSuitable(File $file)
9 $ext = $file->getExt();
11 foreach ($GLOBALS['phorkie']['tools'] as $class => $arSetup) {
12 if (array_search($ext, $class::$arSupportedExtensions) !== false) {
13 $suitables[] = new Tool_Info($class);
20 * Returns the class name from a tool name
22 * @param string $name Full class name or short name without
23 * 'phorkie\\Tool_' prefix
25 * @return string Class name or NULL if not found
27 public function getClass($name)
29 if (strpos($name, '\\') === false && strpos($name, '_') === false) {
30 return '\\phorkie\\Tool_' . $name;
35 public function loadTool($name)
37 $class = $this->getClass($name);
38 if (!class_exists($class, true)) {
39 throw new Exception('Tool does not exist: ' . $class);