コード例 #1
0
ファイル: plugin.class.php プロジェクト: saez0pub/core
 public function launch($_function)
 {
     if ($_function == '') {
         throw new Exception('La fonction à lancer ne peut être vide');
     }
     if (!class_exists($this->getId()) || !method_exists($this->getId(), $_function)) {
         throw new Exception('Il n\'existe aucune méthode : ' . $this->getId() . '::' . $_function . '()');
     }
     $cmd = 'php ' . dirname(__FILE__) . '/../../core/php/jeePlugin.php ';
     $cmd .= ' plugin_id=' . $this->getId();
     $cmd .= ' function=' . $_function;
     if (jeedom::checkOngoingThread($cmd) > 0) {
         return true;
     }
     exec($cmd . ' >> /dev/null 2>&1 &');
     return true;
 }