* Load a Lua script by name. */
(string $name)
| 70 | * Load a Lua script by name. |
| 71 | */ |
| 72 | private function getScript(string $name): string |
| 73 | { |
| 74 | if (!isset(self::$scriptCache[$name])) { |
| 75 | $path = __DIR__ . '/commands/' . $name; |
| 76 | if (!file_exists($path)) { |
| 77 | throw new \RuntimeException("Script not found: {$name}"); |
| 78 | } |
| 79 | self::$scriptCache[$name] = file_get_contents($path); |
| 80 | } |
| 81 | return self::$scriptCache[$name]; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Execute a Lua script. |
no outgoing calls
no test coverage detected