예제 #1
0
 /**
  * start publishing
  * @param  function $progressCallback callback function for tracking publish progress
  * @param  function $doneCallback callback function for calling when publish complete
  * @return void
  */
 public function startPublish($progressCallback = null, $doneCallback = null)
 {
     # Copy core files
     $coreDirectoryName = ConfigurationManager::Get("profiles.{$this->getProfileName()}.coreDirectory");
     $coreDirectoryName = Utility::getCorePath($this->getAlias(), $coreDirectoryName);
     $this->ignores[] = 'public';
     Utility::copyFiles(\base_path(), $coreDirectoryName, $progressCallback, $this->getIngoresList());
     $this->ignores = \array_except($this->ignores, ['public']);
     # Copy public files
     $publicDirectoryName = ConfigurationManager::Get("profiles.{$this->getProfileName()}.publicDirectory");
     $publicDirectoryName = Utility::getPublicPath($this->getAlias(), $publicDirectoryName);
     Utility::copyFiles(\base_path('public'), $publicDirectoryName, $progressCallback, $this->getIngoresList());
     # Copy env file
     $envFileName = ConfigurationManager::Get("profiles.{$this->getProfileName()}.env");
     if ($envFileName != null && file_exists(\base_path($envFileName))) {
         @\copy(\base_path($envFileName), Utility::combinePath($coreDirectoryName, '.env'));
     }
     # Completing progress
     if (\is_callable($doneCallback)) {
         \call_user_func($doneCallback);
     }
 }