Skip to content

Instantly share code, notes, and snippets.

@hissy
Last active October 17, 2016 01:11
Show Gist options
  • Save hissy/d1ee58e118b8964a3494e77c00e17e24 to your computer and use it in GitHub Desktop.
Save hissy/d1ee58e118b8964a3494e77c00e17e24 to your computer and use it in GitHub Desktop.
[concrete5] [v7] Reinstall automated jobs
<?php
/**
* Usage:
* Add this code to application/bootstrap/app.php
* Acccess to YOUR_HOST/index.php/install_job/job_handle
* !Please delete this route after the job installed
*/
Route::register('/install_job/{jHandle}', function($jHandle) {
$response = new \Concrete\Core\Http\Response();
$j = \Concrete\Core\Job\Job::getByHandle($jHandle);
if ($j === null) {
\Concrete\Core\Job\Job::installByHandle($jHandle);
$response->setContent(sprintf('Job %s installed successfully.', $jHandle));
} else {
$response->setContent(sprintf('Job %s is already installed.', $jHandle));
}
return $response;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment