/**
  * Generate a random key for the application.
  *
  * @param  string $cipher
  *
  * @return string
  */
 protected function getRandomKey($cipher)
 {
     if ($cipher === 'AES-128-CBC') {
         return Str::random(16);
     }
     return Str::random(32);
 }
Exemplo n.º 2
0
 public function render($str, array $vars = [])
 {
     $__tmp_stub_file = Str::random() . uniqid(time(), false);
     !$this->fs->exists($this->cachePath) && $this->fs->makeDirectory($this->cachePath, 0755, true);
     $__tmp_stub_path = Path::join($this->cachePath, $__tmp_stub_file);
     $this->fs->put($__tmp_stub_path, $this->compiler->compileString($str));
     $__env = $this->getViewFactory();
     if (is_array($vars) && 0 !== count($vars)) {
         extract($vars);
     }
     ob_start();
     include $__tmp_stub_path;
     $var = ob_get_contents();
     ob_end_clean();
     $this->fs->delete($__tmp_stub_path);
     return $var;
 }