/**
  * Copy all assets from a given path to the publish path.
  *
  * @param  string  $name
  * @param  string  $source
  * @return bool
  */
 public function publish($name, $source)
 {
     $destination = $this->publishPath . "/packages/{$name}";
     $success = $this->files->copyDirectory($source, $destination);
     if (!$success) {
         throw new \RuntimeException("Unable to publish assets.");
     }
     return $success;
 }
Exemple #2
0
 /**
  * Copy all assets from a given path to the publish path.
  *
  * @param  string  $source
  * @param  string  $name
  * @return bool
  */
 public function publish($source, $name)
 {
     $destination = $this->publishPath . "/packages/{$name}";
     $success = $this->files->copyDirectory($source, $destination);
     // If were unable to publish the assets, it coule mean that the source folder
     // does not exists. So, the developer should probably check that the given
     // source location is valid, otherwise, verify the target's permissions.
     if (!$success) {
         throw new \RuntimeException("Unable to publish assets.");
     }
     return $success;
 }
 /**
  * Publish the configuration files for a package.
  *
  * @param  string  $package
  * @param  string  $packagePath
  * @return void
  */
 public function publishPackage($package, $packagePath = null)
 {
     list($vendor, $name) = explode('/', $package);
     // First we will figure out the source of the package's configuration location
     // which we do by convention. Once we have that we will move the files over
     // to the "main" configuration directory for this particular application.
     $path = $packagePath ?: $this->packagePath;
     $source = $this->getSource($package, $name, $path);
     $destination = $this->publishPath . "/packages/{$package}";
     // We need to create the destination directory if it doesn't exist so we will
     // actually be able to write the published configuration file to disk else
     // we will get a file not found error when trying to publish the config.
     $this->makeDestination($destination);
     return $this->files->copyDirectory($source, $destination);
 }
 /**
  * Publish configuration files from a given path.
  *
  * @param  string  $package
  * @param  string  $source
  * @return void
  */
 public function publish($package, $source)
 {
     $destination = $this->publishPath . "/packages/{$package}";
     $this->makeDestination($destination);
     return $this->files->copyDirectory($source, $destination);
 }