예제 #1
0
 /**
  * Create a workbench directory for the package.
  *
  * @param  \Illuminate\Workbench\Package  $package
  * @param  string  $path
  * @return string
  */
 protected function createDirectory(Package $package, $path)
 {
     $fullPath = $path . '/' . $package->getFullName();
     // If the directory doesn't exist, we will go ahead and create the package
     // directory in the workbench location. We will use this entire package
     // name when creating the directory to avoid any potential conflicts.
     if (!$this->files->isDirectory($fullPath)) {
         $this->files->makeDirectory($fullPath, 0777, true);
         return $fullPath;
     }
     throw new \InvalidArgumentException("Package exists.");
 }
예제 #2
0
 /**
  * get content of a file
  *
  * @param string $path
  * @return srting
  */
 protected function getContent($path)
 {
     return PHP_EOL . $this->files->get($path);
 }