Last active
October 17, 2016 01:11
-
-
Save hissy/d1ee58e118b8964a3494e77c00e17e24 to your computer and use it in GitHub Desktop.
[concrete5] [v7] Reinstall automated jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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