Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mulkave committed Sep 13, 2016
2 parents 86bbcaa + 8b35bd7 commit f6b396f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 10 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
# Lucid • Console
The Console companion for the Lucid Architecture.

## Command Line Interface
The console ships with a command line interface called `lucid` that you can find in `vendor/bin/lucid` and use as
```
lucid make:feature ListUsers Api
```

> To be able to address the `lucid` cli directly you need to have `./vendor/bin` as part of your `$PATH`.
To do that, put this in your shell profile (~/.bash_profile, ~/.zshrc, ~/bashrc) `export PATH="$PATH:./vendor/bin`"

### Available Commands

- `help` Displays help for a command
- `list` Lists commands
- **make**
- `make:controller` Create a new resource Controller class in a service
- `make:feature ` Create a new Feature in a service
- `make:job ` Create a new Job in a domain
- `make:service ` Create a new Service
- **list**
- `list:features` List the features.
- `list:services` List the services in this project.
- **delete**
- `delete:feature` Delete an existing Feature in a service
- `delete:job ` Delete an existing Job in a domain
- `delete:service` Delete an existing Service

### Commands Usage

#### Make
- `make:controller <controller> [<service>]`
- `make:feature <feature> [<service>]`
- `make:job <job> <domain>`
- `make:service <name>`

#### List
- `list:services`
- `list:features [<service>]`

#### Delete
- `delete:service <name>`
- `delete:feature <feature> [<service>]`
- `delete:job <job> <domain>`
4 changes: 2 additions & 2 deletions src/Commands/FeatureDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class FeatureDeleteCommand extends SymfonyCommand
public function fire()
{
try {
$service = studly_case($this->argument('service'));
$service = Str::service($this->argument('service'));
$title = $this->parseName($this->argument('feature'));

if (!$this->exists($feature = $this->findFeaturePath($service, $title))) {
Expand All @@ -79,8 +79,8 @@ public function fire()
protected function getArguments()
{
return [
['service', InputArgument::REQUIRED, 'The service in which the feature should be deleted from.'],
['feature', InputArgument::REQUIRED, 'The feature\'s name.'],
['service', InputArgument::OPTIONAL, 'The service from which the feature should be deleted.'],
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/JobDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function fire()
public function getArguments()
{
return [
['domain', InputArgument::REQUIRED, 'The domain from which the job will be deleted.'],
['job', InputArgument::REQUIRED, 'The job\'s name.'],
['domain', InputArgument::REQUIRED, 'The domain from which the job will be deleted.'],
];
}

Expand Down
19 changes: 12 additions & 7 deletions src/Commands/ServiceDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Lucid\Console\Commands;

use Lucid\Console\Str;
use Lucid\Console\Finder;
use Lucid\Console\Command;
use Lucid\Console\Filesystem;
Expand Down Expand Up @@ -71,18 +72,22 @@ protected function getStub()
*/
public function fire()
{
if ($this->isMicroservice()) {
return $this->error('This functionality is disabled in a Microservice');
}

try {
$name = ucfirst($this->argument('name'));
$name = Str::service($this->argument('name'));

if (!$this->exists($service = $this->findServicePath($name))) {
$this->error('Service '.$name.' cannot be found.');
} else {
$this->delete($service);
return $this->error('Service '.$name.' cannot be found.');
}

$this->info('Service <comment>'.$name.'</comment> deleted successfully.'."\n");
$this->delete($service);

$this->info('Please remove your registered service providers, if any.');
}
$this->info('Service <comment>'.$name.'</comment> deleted successfully.'."\n");

$this->info('Please remove your registered service providers, if any.');
} catch (\Exception $e) {
dd($e->getMessage(), $e->getFile(), $e->getLine());
}
Expand Down

0 comments on commit f6b396f

Please sign in to comment.