コード例 #1
0
 /**
  * Create all migrations, models, services, validators, and event handlers for auth.
  *
  * @param string          $directory
  * @param OutputInterface $output
  * 
  * @return $this
  */
 protected function createAuthModels($directory, $output)
 {
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/database/migrations/2015_01_01_000000_create_authorize_tables.stub', $directory . '/app/database/migrations/2015_01_01_000000_create_authorize_tables.php');
     File::copy(dirname(__FILE__) . '/../stubs/app/models/User.stub', $directory . '/app/models/User.php');
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/models/Role.stub', $directory . '/app/models/Role.php');
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/models/Service/User.stub', $directory . '/app/models/Service/User.php');
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/models/Service/User/Auth.stub', $directory . '/app/models/Service/User/Auth.php');
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/models/Validator/User.stub', $directory . '/app/models/Validator/User.php');
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/models/Validator/User/Auth.stub', $directory . '/app/models/Validator/User/Auth.php');
     File::mkdir($directory . '/app/classes/Event');
     File::copyIfNone(dirname(__FILE__) . '/../stubs/app/classes/Event/User/Auth.stub', $directory . '/app/classes/Event/User/Auth.php');
     File::delete($directory . '/app/classes/.gitkeep');
     File::appendOnce($directory . '/app/events.php', "\nEvent::subscribe(new Event\\User\\Auth);\n");
     $output->writeln('migrations/models/services/validators/callback-handlers installed');
     return $this;
 }
コード例 #2
0
 /**
  * Install the ie8 responsive libraries.
  *
  * @param string          $directory
  * @param OutputInterface $output
  * 
  * @return $this
  */
 protected function installIEResponsive($directory, $output)
 {
     if (!File::exists($directory . '/public/assets/libs/html5shiv/html5shiv.min.js')) {
         File::mkdir($directory . '/public/assets/libs/html5shiv');
         File::copy('http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js', $directory . '/public/assets/libs/html5shiv/html5shiv.min.js');
     }
     if (!File::exists($directory . '/public/assets/libs/respond/respond.min.js')) {
         File::mkdir($directory . '/public/assets/libs/respond');
         File::copy('http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js', $directory . '/public/assets/libs/respond/respond.min.js');
     }
     $output->writeln('ie8 responsive support installed');
     return $this;
 }