コード例 #1
0
 /**
  * Add Carbon class alias.
  *
  * @param string          $directory
  * @param OutputInterface $output
  * 
  * @return $this
  */
 protected function addCarbonAlias($directory, $output)
 {
     if (!File::has($directory . '/app/config/app.php', "'Carbon'")) {
         File::replaceOnce($directory . '/app/config/app.php', "=> 'Illuminate\\Support\\Facades\\View',", "=> 'Illuminate\\Support\\Facades\\View',\n\t\t'Carbon'            => 'Carbon\\Carbon',");
     }
     $output->writeln('carbon class alias added');
     return $this;
 }
コード例 #2
0
ファイル: File.php プロジェクト: mmanos/laravel-utilities
 /**
  * Create a .gitkeep file in the requested directory.
  *
  * @param string $path
  * 
  * @return void
  */
 public static function gitkeep($path)
 {
     $path = rtrim($path, '/');
     File::put($path . '/.gitkeep', '');
 }
コード例 #3
0
 /**
  * Create a default email layout.
  *
  * @param string          $directory
  * @param OutputInterface $output
  * 
  * @return $this
  */
 protected function createEmailLayout($directory, $output)
 {
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/views/emails/layouts/default.blade.stub', $directory . '/app/views/emails/layouts/default.blade.php');
     $output->writeln('default email layout created');
     return $this;
 }
コード例 #4
0
 /**
  * Install ACL functionality.
  *
  * @param string          $directory
  * @param OutputInterface $output
  * 
  * @return $this
  */
 protected function installAcl($directory, $output)
 {
     if (!File::has($directory . '/composer.json', 'zendframework/zend-permissions-acl')) {
         $output->writeln('<info>Installing zendframework/zend-permissions-acl...</info>');
         exec('composer require zendframework/zend-permissions-acl:2.2.6', $out);
         echo implode("\n", $out) . "\n";
     }
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/classes/Acl.stub', $directory . '/app/classes/Acl.php');
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/config/acl.stub', $directory . '/app/config/acl.php');
     File::appendOnce($directory . '/app/start/global.php', File::get(dirname(__FILE__) . '/../stubs/app/start/global.acl.partial'));
     File::appendOnce($directory . '/app/filters.php', File::get(dirname(__FILE__) . '/../stubs/app/filters.acl.partial'));
     $output->writeln('acl installed');
     return $this;
 }