protected function loadCustomTasks($tasksToLoad)
    {
        foreach ($tasksToLoad as $taskClass) {
            if (!class_exists($taskClass)) {
                throw new RuntimeException(sprintf('Custom Task "%s" does not exists.', $taskClass));
            }

            $reflex = new ReflectionClass($taskClass);
            if (!$reflex->isInstantiable()) {
                throw new RuntimeException(sprintf('Custom Task "%s" can not be instantiated.', $taskClass));
            }

            $task = new $taskClass();
            if (!$task instanceof AbstractTask) {
                throw new RuntimeException(sprintf('Custom Task "%s" must inherit "Mage\\Task\\AbstractTask".', $taskClass));
            }

            // Add Task
            $this->add($task);
        }
    }
protected function loadCustomTasks($tasksToLoad)
    {
        foreach ($tasksToLoad as $taskClass) {
            if (!class_exists($taskClass)) {
                throw new RuntimeException(sprintf('Custom Task "%s" does not exists.', $taskClass));
            }

            $reflex = new ReflectionClass($taskClass);
            if (!$reflex->isInstantiable()) {
                throw new RuntimeException(sprintf('Custom Task "%s" can not be instantiated.', $taskClass));
            }

            $task = new $taskClass();
            if (!$task instanceof AbstractTask) {
                throw new RuntimeException(sprintf('Custom Task "%s" must inherit "Mage\\Task\\AbstractTask".', $taskClass));
            }

            // Add Task
            $this->add($task);
        }
    }
protected function loadCustomTasks ( $ tasksToLoad ) { foreach ( $ tasksToLoad as $ taskClass ) { if ( ! class_exists ( $ taskClass ) ) { throw new RuntimeException ( sprintf ( 'Custom Task "%s" does not exists.' , $ taskClass ) ) ; } $ reflex = new ReflectionClass ( $ taskClass ) ; if ( ! $ reflex -> isInstantiable ( ) ) { throw new RuntimeException ( sprintf ( 'Custom Task "%s" can not be instantiated.' , $ taskClass ) ) ; } $ task = new $ taskClass ( ) ; if ( ! $ task instanceof AbstractTask ) { throw new RuntimeException ( sprintf ( 'Custom Task "%s" must inherit "Mage\\Task\\AbstractTask".' , $ taskClass ) ) ; } // Add Task $ this -> add ( $ task ) ; } }
Load Custom Tasks
@param array $tasksToLoad PreRegistered Tasks
@throws RuntimeException
Load Custom Tasks