Example #1
0
 protected function makeSymlinkModulePublic($module)
 {
     $osDetected = php_uname('s');
     $from = $this->dir . '/application/modules/' . $module . '/public';
     $to = $this->dir . '/public/modules/' . $module;
     if (is_dir($from) && !file_exists($to)) {
         symlink($from, $to);
         $this->io->write("Symlink created on OS {$osDetected}.");
     }
 }
Example #2
0
 /**
  * Set the security.salt value in the application's config file.
  *
  * @param string $dir The application's root directory.
  * @param Composer\IO\IOInterface $io IO interface to write to console.
  * @return void
  */
 public static function setSecuritySalt($dir, $io)
 {
     $config = $dir . '/config/app.php';
     $content = file_get_contents($config);
     $newKey = hash('sha256', $dir . php_uname() . microtime(true));
     $content = str_replace('__SALT__', $newKey, $content, $count);
     if ($count == 0) {
         $io->write('No Security.salt placeholder to replace.');
         return;
     }
     $result = file_put_contents($config, $content);
     if ($result) {
         $io->write('Updated Security.salt value in config/app.php');
         return;
     }
     $io->write('Unable to update Security.salt value.');
 }
Example #3
0
 /**
  * Set the security.salt value in the application's config file.
  *
  * @param string $dir The application's root directory.
  * @param Composer\IO\IOInterface $io IO interface to write to console.
  * @return void
  */
 public static function setSecuritySalt($dir, $io)
 {
     $config = $dir . '/app/Config/core.php';
     $content = file_get_contents($config);
     $newKey = hash('sha256', $dir . php_uname() . microtime(true));
     $newKeyCipherSeed = str_pad(time(), 29, mt_rand(), STR_PAD_BOTH);
     $content = str_replace('DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi', $newKey, $content, $count);
     $content = str_replace('76859309657453542496749683645', $newKeyCipherSeed, $content, $count);
     if ($count == 0) {
         $io->write('No Security.salt placeholder to replace.');
         return;
     }
     $result = file_put_contents($config, $content);
     if ($result) {
         $io->write('Updated Security.salt value in app/Config/core.php');
         return;
     }
     $io->write('Unable to update Security.salt value.');
 }