Permalink
Browse files

First built for Laravel 5.0

  • Loading branch information...
1 parent e0a39eb commit 3b244165f9b548d2fe48a3a568c16cba96b0a20b @JackieDo committed Jan 10, 2017
View
@@ -0,0 +1,4 @@
+/vendor
+composer.phar
+composer.lock
+.DS_Store
View
@@ -0,0 +1,31 @@
+<?php
+
+return array(
+
+ /*
+ |--------------------------------------------------------------------------
+ | Workbench Author Name
+ |--------------------------------------------------------------------------
+ |
+ | When you create new packages via the Artisan "workbench" command your
+ | name is needed to generate the composer.json file for your package.
+ | You may specify it now so it is used for all of your workbenches.
+ |
+ */
+
+ 'name' => '',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Workbench Author E-Mail Address
+ |--------------------------------------------------------------------------
+ |
+ | Like the option above, your e-mail address is used when generating new
+ | workbench packages. The e-mail is placed in your composer.json file
+ | automatically after the package is created by the workbench tool.
+ |
+ */
+
+ 'email' => '',
+
+);
@@ -1,8 +1,8 @@
-<?php namespace Illuminate\Workbench\Console;
+<?php namespace Jackiedo\Workbench\Console;
use Illuminate\Console\Command;
-use Illuminate\Workbench\Package;
-use Illuminate\Workbench\PackageCreator;
+use Jackiedo\Workbench\Package;
+use Jackiedo\Workbench\PackageCreator;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
@@ -25,14 +25,14 @@ class WorkbenchMakeCommand extends Command {
/**
* The package creator instance.
*
- * @var \Illuminate\Workbench\PackageCreator
+ * @var \Jackiedo\Workbench\PackageCreator
*/
protected $creator;
/**
* Create a new make workbench command instance.
*
- * @param \Illuminate\Workbench\PackageCreator $creator
+ * @param \Jackiedo\Workbench\PackageCreator $creator
* @return void
*/
public function __construct(PackageCreator $creator)
@@ -59,7 +59,7 @@ public function fire()
/**
* Run the package creator class for a given Package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @return string
*/
protected function runCreator($package)
@@ -87,7 +87,7 @@ protected function callComposerUpdate($path)
/**
* Build the package details from user input.
*
- * @return \Illuminate\Workbench\Package
+ * @return \Jackiedo\Workbench\Package
*
* @throws \UnexpectedValueException
*/
@@ -141,4 +141,4 @@ protected function getOptions()
);
}
-}
+}
View
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Anh Vũ Đỗ
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
@@ -1,4 +1,4 @@
-<?php namespace Illuminate\Workbench;
+<?php namespace Jackiedo\Workbench;
class Package {
View
@@ -1,4 +1,4 @@
-<?php namespace Illuminate\Workbench;
+<?php namespace Jackiedo\Workbench;
use Illuminate\Filesystem\Filesystem;
@@ -49,7 +49,7 @@ public function __construct(Filesystem $files)
/**
* Create a new package stub.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $path
* @param bool $plain
* @return string
@@ -72,7 +72,7 @@ public function create(Package $package, $path, $plain = true)
/**
* Create a package with all resource directories.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $path
* @return void
*/
@@ -95,7 +95,7 @@ protected function getBlocks($plain)
/**
* Write the support files to the package root.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @param bool $plain
* @return void
@@ -111,7 +111,7 @@ public function writeSupportFiles(Package $package, $directory, $plain)
/**
* Write the PHPUnit stub file.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @return void
*/
@@ -125,7 +125,7 @@ protected function writePhpUnitFile(Package $package, $directory)
/**
* Write the Travis stub file.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @return void
*/
@@ -139,7 +139,7 @@ protected function writeTravisFile(Package $package, $directory)
/**
* Write the Composer.json stub file.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @param bool $plain
* @return void
@@ -169,7 +169,7 @@ protected function getComposerStub($plain)
/**
* Write the stub .gitignore file for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @param bool $plain
* @return void
@@ -182,13 +182,13 @@ public function writeIgnoreFile(Package $package, $directory, $plain)
/**
* Create the support directories for a package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @return void
*/
public function writeSupportDirectories(Package $package, $directory)
{
- foreach (array('config', 'controllers', 'lang', 'migrations', 'views') as $support)
+ foreach (array('config', 'controllers', 'lang', 'migrations', 'views', 'assets', 'routes') as $support)
{
$this->writeSupportDirectory($package, $support, $directory);
}
@@ -197,7 +197,7 @@ public function writeSupportDirectories(Package $package, $directory)
/**
* Write a specific support directory for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $support
* @param string $directory
* @return void
@@ -212,12 +212,28 @@ protected function writeSupportDirectory(Package $package, $support, $directory)
$this->files->makeDirectory($path, 0777, true);
$this->files->put($path.'/.gitkeep', '');
+
+ switch ($support) {
+ case 'config':
+ $content = $this->formatPackageStub($package, $this->files->get(__DIR__.'/stubs/config.stub'));
+ $this->files->put($path.'/config.php', $content);
+ break;
+
+ case 'routes':
+ $content = $this->formatPackageStub($package, $this->files->get(__DIR__.'/stubs/routes.stub'));
+ $this->files->put($path.'/routes.php', $content);
+ break;
+
+ default:
+ # code...
+ break;
+ }
}
/**
* Create the public directory for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @param bool $plain
* @return void
@@ -234,7 +250,7 @@ public function writePublicDirectory(Package $package, $directory, $plain)
/**
* Create the test directory for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @return void
*/
@@ -248,7 +264,7 @@ public function writeTestDirectory(Package $package, $directory)
/**
* Write the stub ServiceProvider for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @param bool $plain
* @return void
@@ -266,7 +282,7 @@ public function writeServiceProvider(Package $package, $directory, $plain)
/**
* Write the service provider stub for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @param string $stub
* @return void
@@ -286,7 +302,7 @@ protected function writeProviderStub(Package $package, $directory, $stub)
/**
* Get the stub for a ServiceProvider.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param bool $plain
* @return string
*/
@@ -314,7 +330,7 @@ protected function getProviderFile($plain)
/**
* Create the main source directory for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $directory
* @return string
*/
@@ -333,7 +349,7 @@ protected function createClassDirectory(Package $package, $directory)
/**
* Format a generic package stub file.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $stub
* @return string
*/
@@ -350,7 +366,7 @@ protected function formatPackageStub(Package $package, $stub)
/**
* Create a workbench directory for the package.
*
- * @param \Illuminate\Workbench\Package $package
+ * @param \Jackiedo\Workbench\Package $package
* @param string $path
* @return string
*
@@ -373,4 +389,4 @@ protected function createDirectory(Package $package, $path)
throw new \InvalidArgumentException("Package exists.");
}
-}
+}
View
@@ -0,0 +1,7 @@
+# Laravel 5 Workbench
+
+Bring workbench back to Laravel 5+
+
+# Documentation
+
+This is coming soon in a short time
View
@@ -1,4 +1,4 @@
-<?php namespace Illuminate\Workbench;
+<?php namespace Jackiedo\Workbench;
use Symfony\Component\Finder\Finder;
use Illuminate\Filesystem\Filesystem;
@@ -30,4 +30,4 @@ public static function start($path, Finder $finder = null, Filesystem $files = n
}
}
-}
+}
@@ -1,7 +1,7 @@
-<?php namespace Illuminate\Workbench;
+<?php namespace Jackiedo\Workbench;
use Illuminate\Support\ServiceProvider;
-use Illuminate\Workbench\Console\WorkbenchMakeCommand;
+use Jackiedo\Workbench\Console\WorkbenchMakeCommand;
class WorkbenchServiceProvider extends ServiceProvider {
@@ -13,6 +13,24 @@ class WorkbenchServiceProvider extends ServiceProvider {
protected $defer = false;
/**
+ * Bootstrap the application events.
+ *
+ * @return void
+ */
+ public function boot()
+ {
+ $path = config_path('workbench.php');
+
+ $this->publishes([
+ __DIR__.'/Config/config.php' => $path,
+ ], 'config');
+
+ if (file_exists($path)) {
+ $this->mergeConfigFrom($path, 'workbench');
+ }
+ }
+
+ /**
* Register the service provider.
*
* @return void
@@ -42,4 +60,4 @@ public function provides()
return array('package.creator', 'command.workbench');
}
-}
+}
View
@@ -1,11 +1,15 @@
{
- "name": "illuminate/workbench",
- "description": "The Illuminate Workbench package.",
+ "name": "jackiedo/workbench",
+ "description": "Bring workbench back to Laravel 5.",
"license": "MIT",
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
+ },
+ {
+ "name": "Jackie Do",
+ "email": "anhvudo@gmail.com"
}
],
"require": {
@@ -19,7 +23,7 @@
},
"autoload": {
"psr-4": {
- "Illuminate\\Workbench\\": ""
+ "Jackiedo\\Workbench\\": ""
}
},
"extra": {
Oops, something went wrong.

0 comments on commit 3b24416

Please sign in to comment.