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

Commit c17f12a

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: feature #728 Added a new AppBundle to comply with Symfony Best Practices (javiereguiluz) fixed Symfony version dep updated VENDORS for 2.6.0-BETA2 Conflicts: composer.json
2 parents 5152663 + 1d82fd5 commit c17f12a

File tree

8 files changed

+65
-3
lines changed

8 files changed

+65
-3
lines changed

app/AppKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function registerBundles()
1616
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
1717
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
1818
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
19+
new AppBundle\AppBundle(),
1920
);
2021

2122
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% extends 'base.html.twig' %}
2+
3+
{% block body %}
4+
Homepage.
5+
{% endblock %}

app/SymfonyRequirements.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ public function __construct()
440440
}
441441

442442
$this->addRequirement(
443-
isset($timezones[date_default_timezone_get()]),
444-
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()),
443+
isset($timezones[@date_default_timezone_get()]),
444+
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()),
445445
'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
446446
);
447447
}
@@ -530,6 +530,16 @@ function_exists('simplexml_import_dom'),
530530
'Install the <strong>PCRE</strong> extension (version 8.0+).'
531531
);
532532

533+
if (extension_loaded('mbstring')) {
534+
$this->addPhpIniRequirement(
535+
'mbstring.func_overload',
536+
create_function('$cfgValue', 'return (int) $cfgValue === 0;'),
537+
true,
538+
'string functions should not be overloaded',
539+
'Set "<strong>mbstring.func_overload</strong>" to <strong>0</strong> in php.ini<a href="#phpini">*</a> to disable function overloading by the mbstring extension.'
540+
);
541+
}
542+
533543
/* optional recommendations follow */
534544

535545
$this->addRecommendation(

app/check.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function echo_style($style, $message)
110110
);
111111
$supports = has_color_support();
112112

113-
echo ($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : '');
113+
echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : '');
114114
}
115115

116116
function echo_block($style, $title, $message)

app/config/routing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
app:
2+
resource: @AppBundle/Controller/
3+
type: annotation

src/AppBundle/AppBundle.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace AppBundle;
4+
5+
use Symfony\Component\HttpKernel\Bundle\Bundle;
6+
7+
class AppBundle extends Bundle
8+
{
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace AppBundle\Controller;
4+
5+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7+
8+
class DefaultController extends Controller
9+
{
10+
/**
11+
* @Route("/", name="homepage")
12+
*/
13+
public function indexAction()
14+
{
15+
return $this->render('default/index.html.twig');
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace AppBundle\Tests\Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6+
7+
class DefaultControllerTest extends WebTestCase
8+
{
9+
public function testIndex()
10+
{
11+
$client = static::createClient();
12+
13+
$crawler = $client->request('GET', '/');
14+
15+
$this->assertTrue($crawler->filter('html:contains("Homepage")')->count() > 0);
16+
}
17+
}

0 commit comments

Comments
 (0)