Skip to content

Commit

Permalink
Add the standard Symfony console to the project.
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored and localheinz committed Dec 18, 2017
1 parent 77574d1 commit 8975f6b
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 291 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ OpenCFP comes bundled with a few command-line utilities to administer the system
can be found by running the following in the project root:

```
$ bin/opencfp
$ bin/console
```

### [Admin Group Management](#admin-group-management)
Expand All @@ -256,13 +256,13 @@ Administrators are authorized to review speaker information in addition to speci
Adding `[email protected]` to the admin group:

```
$ bin/opencfp user:promote --env=production [email protected] admin
$ bin/console user:promote --env=production [email protected] admin
```

Removing `[email protected]` from the admin group:

```
$ bin/opencfp user:demote --env=production [email protected] admin
$ bin/console user:demote --env=production [email protected] admin
```

### [Reviewer Group Management](#reviewer-group-management)
Expand All @@ -271,13 +271,13 @@ Reviewers are authorized to see talks and give ratings to them.
Adding `[email protected]` to the reviewer group:

```
$ bin/opencfp user:promote --env=production [email protected] reviewer
$ bin/console user:promote --env=production [email protected] reviewer
```

Removing `[email protected]` from the reviewer group:

```
$ bin/opencfp user:demote --env=production [email protected] reviewer
$ bin/console user:demote --env=production [email protected] reviewer
```


Expand All @@ -288,19 +288,19 @@ Users are needed for you system, and sometimes you want to add users via command
Adding a speaker:

```
$ bin/opencfp user:create --first_name="Speaker" --last_name="Name" --email="[email protected]" --password="somePassw0rd!"
$ bin/console user:create --first_name="Speaker" --last_name="Name" --email="[email protected]" --password="somePassw0rd!"
```

Add an admin:

```
$ bin/opencfp user:create --first_name="Admin" --last_name="Name" --email="[email protected]" --password="somePassw0rd!" --admin
$ bin/console user:create --first_name="Admin" --last_name="Name" --email="[email protected]" --password="somePassw0rd!" --admin
```

Add a reviewer:

```
$ bin/opencfp user:create --first_name="Admin" --last_name="Name" --email="[email protected]" --password="somePassw0rd!" --reviewer
$ bin/console user:create --first_name="Admin" --last_name="Name" --email="[email protected]" --password="somePassw0rd!" --reviewer
```

### [Clear Caches](#clear-caches)
Expand All @@ -309,7 +309,7 @@ OpenCFP uses Twig as a templating engine and HTML Purifier for input filtering.
If you need to clear all application caches:

```
$ bin/opencfp cache:clear
$ bin/console cache:clear
```

### [Scripts to Rule Them All](#scripts-rule-all)
Expand Down Expand Up @@ -348,7 +348,7 @@ $ script/test

## [Compiling Frontend Assets](#compiling-frontend-assets)

OpenCFP ships with a pre-compiled CSS file. However, we now include the Sass / PostCSS used to compile front-end assets. You are free to modify these source files to change brand colors or modify your instance however you see fit. Remember, you can do **nothing** and take advantage of the pre-compiled CSS we ship. You only need these instructions if you want to customize or contribute to the look and feel of OpenCFP. Let's take a look at this new workflow for OpenCFP.
OpenCFP ships with a pre-compiled CSS file. However, we now include the Sass / PostCSS used to compile front-end assets. You are free to modify these source files to change brand colors or modify your instance however you see fit. Remember, you can do **nothing** and take advantage of the pre-compiled CSS we ship. You only need these instructions if you want to customize or contribute to the look and feel of OpenCFP. Let's take a look at this new workflow for OpenCFP.

Install Node dependencies using `yarn`.

Expand All @@ -360,7 +360,7 @@ Now dependencies are installed and we're ready to compile assets. Check out the

The main `app.scss` file is at [`resources/assets/sass/app.scss`](resources/assets/sass/app.scss). We use [Laravel Mix](https://github.com/JeffreyWay/laravel-mix) to compile our Sass. Mix is configurable to run without Laravel, so we take advantage of that because it really makes dealing with Webpack a lot simpler. Our Mix configuration is at [`webpack.mix.js`](webpack.mix.js). In it, we run our `app.scss` through a Sass compilation step, we copy FontAwesome icons and finally run the compiled CSS through [Tailwind CSS](https://tailwindcss.com), a PostCSS plugin.

TailwindCSS is a new utility-first CSS framework that uses CSS class composition to piece together interfaces. Check out [their documentation](https://tailwindcss.com/docs/what-is-tailwind/) for more information on how to use the framework. We use it extensively across OpenCFP and it saves a lot of time and keeps us from having to maintain *too much* CSS. If you take a look through our `app.scss`, you'll see a lot of calls to [`@apply`](https://tailwindcss.com/docs/functions-and-directives#apply). This is NOT a Sass construct. It's a TailwindCSS function used to mixin existing classes into our custom CSS.
TailwindCSS is a new utility-first CSS framework that uses CSS class composition to piece together interfaces. Check out [their documentation](https://tailwindcss.com/docs/what-is-tailwind/) for more information on how to use the framework. We use it extensively across OpenCFP and it saves a lot of time and keeps us from having to maintain *too much* CSS. If you take a look through our `app.scss`, you'll see a lot of calls to [`@apply`](https://tailwindcss.com/docs/functions-and-directives#apply). This is NOT a Sass construct. It's a TailwindCSS function used to mixin existing classes into our custom CSS.

## [Testing](#testing)

Expand Down
23 changes: 23 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php

use OpenCFP\Environment;
use OpenCFP\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

\set_time_limit(0);

require __DIR__ . '/../vendor/autoload.php';

$input = new ArgvInput();
$environment = Environment::fromString($input->getParameterOption(['--env'], \getenv('CFP_ENV') ?: 'development'));

if (!$environment->isProduction()) {
Debug::enable();
}

$kernel = new Kernel((string) $environment, !$environment->isProduction());
$application = new Application($kernel);
$application->run($input);
23 changes: 0 additions & 23 deletions bin/opencfp

This file was deleted.

104 changes: 0 additions & 104 deletions classes/Console/Command/ClearCacheCommand.php

This file was deleted.

7 changes: 2 additions & 5 deletions resources/config/services/console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ services:

OpenCFP\Console\Command\:
resource: '%kernel.project_dir%/classes/Console/Command/*'

OpenCFP\Console\Command\ClearCacheCommand:
arguments:
$paths: ['%kernel.cache_dir%']
tags:
- { name: console.command }

OpenCFP\Console\Application:
public: true
autowire: false
calls:
- [setDispatcher, ['@event_dispatcher']]
- [add, ['@OpenCFP\Console\Command\ClearCacheCommand']]
- [add, ['@OpenCFP\Console\Command\UserCreateCommand']]
- [add, ['@OpenCFP\Console\Command\UserDemoteCommand']]
- [add, ['@OpenCFP\Console\Command\UserPromoteCommand']]
2 changes: 1 addition & 1 deletion script/update
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ "$CFP_ENV" = "" ]; then
fi

echo "==> Clearing cache..."
bin/opencfp cache:clear
bin/console cache:clear

echo "==> Updating db..."
# run all database migrations to ensure everything is up to date.
Expand Down
Loading

0 comments on commit 8975f6b

Please sign in to comment.