Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit 725df8d

Browse files
committed
merged branch Tobion/allow-dev-2.4 (PR #557)
This PR was merged into the master branch. Discussion ---------- Add hello world command to demo bundle and configure new log to console handler First commit: allows the master branch to install 2.4-dev. Second commit: added a hello world command in demo bundle Third commit: configure the log to console handler that is possible since symfony/monolog-bundle#42 Commits ------- 0cafa50 also allow doctrine 2.4 to be installed b47328a configure the log to console handler 7baa790 added a hello world command in demo bundle 8a246dc allow master branch to install 2.4-dev
2 parents 380038d + 0cafa50 commit 725df8d

File tree

5 files changed

+78
-18
lines changed

5 files changed

+78
-18
lines changed

app/check.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@
2525

2626
echo_title('Mandatory requirements');
2727

28+
$checkPassed = true;
2829
foreach ($symfonyRequirements->getRequirements() as $req) {
30+
/** @var $req Requirement */
2931
echo_requirement($req);
32+
if (!$req->isFulfilled()) {
33+
$checkPassed = false;
34+
}
3035
}
3136

3237
echo_title('Optional recommendations');
@@ -35,6 +40,8 @@
3540
echo_requirement($req);
3641
}
3742

43+
exit($checkPassed ? 0 : 1);
44+
3845
/**
3946
* Prints a Requirement instance
4047
*/

app/config/config_dev.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ web_profiler:
1414
monolog:
1515
handlers:
1616
main:
17-
type: stream
18-
path: %kernel.logs_dir%/%kernel.environment%.log
19-
level: debug
17+
type: stream
18+
path: %kernel.logs_dir%/%kernel.environment%.log
19+
level: debug
20+
console:
21+
type: console
22+
bubble: false
2023
firephp:
21-
type: firephp
22-
level: info
24+
type: firephp
25+
level: info
2326
chromephp:
24-
type: chromephp
25-
level: info
27+
type: chromephp
28+
level: info
2629

2730
assetic:
2831
use_controller: true

app/config/config_prod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ monolog:
2121
type: stream
2222
path: %kernel.logs_dir%/%kernel.environment%.log
2323
level: debug
24+
console:
25+
type: console

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
},
99
"require": {
1010
"php": ">=5.3.3",
11-
"symfony/symfony": "2.3.*",
12-
"doctrine/orm": ">=2.2.3,<2.4-dev",
13-
"doctrine/doctrine-bundle": "1.2.*",
14-
"twig/extensions": "1.0.*",
15-
"symfony/assetic-bundle": "2.3.*",
16-
"symfony/swiftmailer-bundle": "2.3.*",
17-
"symfony/monolog-bundle": "2.3.*",
18-
"sensio/distribution-bundle": "2.3.*",
19-
"sensio/framework-extra-bundle": "2.3.*",
20-
"sensio/generator-bundle": "2.3.*",
11+
"symfony/symfony": "~2.4",
12+
"doctrine/orm": "~2.2,>=2.2.3",
13+
"doctrine/doctrine-bundle": "~1.2",
14+
"twig/extensions": "~1.0",
15+
"symfony/assetic-bundle": "~2.3",
16+
"symfony/swiftmailer-bundle": "~2.3",
17+
"symfony/monolog-bundle": "~2.4",
18+
"sensio/distribution-bundle": "~2.3",
19+
"sensio/framework-extra-bundle": "~2.3",
20+
"sensio/generator-bundle": "~2.3",
2121
"incenteev/composer-parameter-handler": "~2.0"
2222
},
2323
"scripts": {
@@ -39,7 +39,7 @@
3939
"config": {
4040
"bin-dir": "bin"
4141
},
42-
"minimum-stability": "RC",
42+
"minimum-stability": "dev",
4343
"extra": {
4444
"symfony-app-dir": "app",
4545
"symfony-web-dir": "web",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace Acme\DemoBundle\Command;
4+
5+
use Symfony\Component\Console\Command\Command;
6+
use Symfony\Component\Console\Input\InputArgument;
7+
use Symfony\Component\Console\Input\InputInterface;
8+
use Symfony\Component\Console\Output\OutputInterface;
9+
10+
/**
11+
* Hello World command for demo purposes.
12+
*
13+
* You could also extend from Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
14+
* to get access to the container via $this->getContainer().
15+
*
16+
* @author Tobias Schultze <http://tobion.de>
17+
*/
18+
class HelloWorldCommand extends Command
19+
{
20+
/**
21+
* {@inheritdoc}
22+
*/
23+
protected function configure()
24+
{
25+
$this
26+
->setName('acme:hello')
27+
->setDescription('Hello World example command')
28+
->addArgument('who', InputArgument::OPTIONAL, 'Who to greet.', 'World')
29+
->setHelp(<<<EOF
30+
The <info>%command.name%</info> command greets somebody or everybody:
31+
32+
<info>php %command.full_name%</info>
33+
34+
The optional argument specifies who to greet:
35+
36+
<info>php %command.full_name%</info> Fabien
37+
EOF
38+
);
39+
}
40+
41+
/**
42+
* {@inheritdoc}
43+
*/
44+
protected function execute(InputInterface $input, OutputInterface $output)
45+
{
46+
$output->writeln(sprintf('Hello <comment>%s</comment>!', $input->getArgument('who')));
47+
}
48+
}

0 commit comments

Comments
 (0)