Use-case example: Making scheduled database backups using a Worker Cron Job.
- Setup Laravel locally
- Create App on fortrabbit
Use-case example: Making scheduled database backups using a Worker Cron Job.
diff --git a/craft/app/etc/web/WebApp.php b/craft/app/etc/web/WebApp.php | |
index 7d68344..504007a 100644 | |
--- a/craft/app/etc/web/WebApp.php | |
+++ b/craft/app/etc/web/WebApp.php | |
@@ -118,6 +118,7 @@ class WebApp extends \CWebApplication | |
if ($validationKey = $this->config->get('validationKey')) | |
{ | |
$this->security->setValidationKey($validationKey); | |
+ $this->getComponent('securityManager')->setValidationKey($validationKey); | |
} |
<?php | |
$secEnv = []; | |
function bootstrapSecEnv($key) { | |
global $secEnv; | |
foreach ($_SERVER as $name => $value) { | |
if (is_string($value) && strpos($value, 'ENC:') === 0) { | |
$secEnv[$name] = decryptEnv($key, substr($value, 4)); | |
} |
<?php | |
if ($argc < 2) fail(); | |
switch ($argv[1]) { | |
case "genkey": | |
printKey(); | |
break; | |
case "enc": | |
case "encrypt": | |
if ($argc != 4) fail(); |
<?php | |
// app/Console/Commands/EncryptEnvCommand.php | |
namespace Ictus\Hub\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Encryption\Encrypter; | |
use Symfony\Component\Console\Input\InputArgument; |
------- Foo --------- | |
Expected: { | |
"under_me": [ | |
{ | |
"foo": "BAR" | |
}, | |
{ | |
"baz": "BAM" | |
} | |
] |