function triggerMinutely() { if (constant('WEBSOCKET') == 1) { $pluginDir = $this->basedir . '/plugins/'; $handle = opendir($pluginDir); while ($file = readdir($handle)) { if ($file != '.' && $file != '..' && is_dir($pluginDir . $file) && is_dir($pluginDir . $file . '/listener') && file_exists($pluginDir . $file . '/listener/minutely.php')) { $pluginManager = new PluginManager($file); $pluginManager->minutely(); } } echo date("H:i:s") . ' >> ' . "[0;31mTRIGGERED MINUTELY[0m" . PHP_EOL; } }