diff --git a/_config/taskrunner.yml b/_config/taskrunner.yml deleted file mode 100644 index 7cdfa26b..00000000 --- a/_config/taskrunner.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -Name: QueuedDevelopmentAdmin -After: - - DevelopmentAdmin ---- -SilverStripe\Dev\DevelopmentAdmin: - registered_controllers: - tasks: - controller: Symbiote\QueuedJobs\Controllers\QueuedTaskRunner - links: - tasks: 'See a list of build tasks to run (QueuedJobs version)' diff --git a/changelog.md b/changelog.md deleted file mode 100644 index 065f0267..00000000 --- a/changelog.md +++ /dev/null @@ -1,29 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -This project adheres to [Semantic Versioning](http://semver.org/). - -## 3.0.0 (unreleased) - -Minimum versions: - -* SilverStripe: 4+ -* PHP: 5.5+ -* PHP 7 supported - -## [2.8.5] - -* Update translations. -* Remove CMS from composer dependencies. -* Fix reference to queued job admin email -* BUG Remove invalid backtraces from errcontext -* Fix long job cron example in readme -* Updating the "travis" build reference. - -## [2.8.4] - -* Readded function to list current jobs in ProcessJobQueueTask -* Typo in queueRunner property -* BUG Fix error logging passing invalid errcontext -* Changelog added diff --git a/src/Controllers/QueuedTaskRunner.php b/src/Controllers/QueuedTaskRunner.php deleted file mode 100644 index 2888bf0e..00000000 --- a/src/Controllers/QueuedTaskRunner.php +++ /dev/null @@ -1,142 +0,0 @@ - 'queueTask', - ]; - - private static $allowed_actions = [ - 'queueTask', - ]; - - private static $task_blacklist = [ - ProcessJobQueueTask::class, - ProcessJobQueueChildTask::class, - CreateQueuedJobTask::class, - DeleteAllJobsTask::class, - ]; - - public function index() - { - $tasks = $this->getTasks(); - - $blacklist = (array)$this->config()->task_blacklist; - $backlistedTasks = []; - - // Web mode - if (!Director::is_cli()) { - $renderer = new DebugView(); - echo $renderer->renderHeader(); - echo $renderer->renderInfo("SilverStripe Development Tools: Tasks (QueuedJobs version)", Director::absoluteBaseURL()); - $base = Director::absoluteBaseURL(); - - echo "
"; - - echo " "; - - echo $renderer->renderFooter(); - - // CLI mode - revert to default behaviour - } else { - return parent::index(); - } - } - - - /** - * Adds a RunBuildTaskJob to the job queue for a given task - * - * @param HTTPRequest $request - */ - public function queueTask($request) - { - $name = $request->param('TaskName'); - $tasks = $this->getTasks(); - - $variables = $request->getVars(); - unset($variables['url']); - unset($variables['flush']); - unset($variables['flushtoken']); - unset($variables['isDev']); - $querystring = http_build_query($variables); - - $title = function ($content) { - printf(Director::is_cli() ? "%s\n\n" : '%s
', $content); - }; - - foreach ($tasks as $task) { - if ($task['segment'] == $name) { - /** @var BuildTask $inst */ - $inst = Injector::inst()->create($task['class']); - if (!$inst->isEnabled()) { - $message('The task is disabled'); - return; - } - - $title(sprintf('Queuing Task %s', $inst->getTitle())); - - $job = new RunBuildTaskJob($task['class'], $querystring); - $jobID = Injector::inst()->get(QueuedJobService::class)->queueJob($job); - - $message('Done: queued with job ID ' . $jobID); - $adminLink = Director::baseURL() . "admin/queuedjobs/" . str_replace('\\', '-', QueuedJobDescriptor::class); - $message("Visit queued jobs admin to see job status"); - return; - } - } - - $message(sprintf('The build task "%s" could not be found', Convert::raw2xml($name))); - } -} diff --git a/src/Jobs/RunBuildTaskJob.php b/src/Jobs/RunBuildTaskJob.php deleted file mode 100644 index 435fc8ed..00000000 --- a/src/Jobs/RunBuildTaskJob.php +++ /dev/null @@ -1,85 +0,0 @@ -TaskClass = $taskClass; - } - - if ($queryString) { - $this->QueryString = $queryString; - } - - $this->currentStep = 0; - $this->totalSteps = 1; - } - - /** - * @param string (default: Object) - * - * @return DataObject - */ - protected function getObject($name = 'SilverStripe\\Core\\Object') - { - return DataObject::get_by_id($this->TargetClass, $this->TargetID); - } - - /** - * @return string - */ - public function getJobType() - { - return QueuedJob::QUEUED; - } - - /** - * @return string - */ - public function getTitle() - { - $taskName = $this->QueryString ? ($this->TaskClass . '?' . $this->QueryString) : $this->TaskClass; - return _t('RunBuildTaskJob.JOB_TITLE', 'Run BuildTask {task}', ['task' => $taskName]); - } - - public function process() - { - if (!is_subclass_of($this->TaskClass, BuildTask::class)) { - throw new \LogicException($this->TaskClass . ' is not a build task'); - } - - $task = Injector::inst()->create($this->TaskClass); - if (!$task->isEnabled()) { - throw new \LogicException($this->TaskClass . ' is not enabled'); - } - - $getVars = []; - parse_str($this->QueryString, $getVars); - $request = new HTTPRequest('GET', '/', $getVars); - $task->run($request); - - $this->currentStep = 1; - $this->isComplete = true; - } -} diff --git a/src/Tasks/DeleteAllJobsTask.php b/src/Tasks/DeleteAllJobsTask.php deleted file mode 100644 index a95e783d..00000000 --- a/src/Tasks/DeleteAllJobsTask.php +++ /dev/null @@ -1,54 +0,0 @@ -getVar('confirm'); - - $jobs = DataObject::get(QueuedJobDescriptor::class); - - if (!$confirm) { - echo "Really delete " . $jobs->count() . " jobs? Please add ?confirm=1 to the URL to confirm."; - return; - } - - echo "Deleting " . $jobs->count() . " jobs...