[RFC|Accepted] Symfony 2

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
Post Reply
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1834
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC|Accepted] Symfony 2

Post by DavidIQ »

No this is not the correct topic for asking about anything 3.1 related. You're welcome to start a new topic or reply to the existing ones in any of the 3.x forums here. Plenty to choose from. ;) if you're needing guidance for extensions (what MODs will become) then there is a topic there regarding that, as well as one for migrations and most everything else regarding the symfony components in use, including composer.
Image

meatsadam
Registered User
Posts: 4
Joined: Mon May 13, 2013 5:33 am

Re: [RFC|Accepted] Symfony 2

Post by meatsadam »

After gaining some time for PHP, I realized we're better off using Symfony components not necessarily the full stack framework. Since we mostly do composer now, let's strive in making reusable libraries mature. Sticking with the full stack framework means we're at least to start from the architecture/design that it uses. Symfony 2 focuses a lot on backportability and so some architectural decisions might not be wise to carry on anymore.

Since Symfony is more about the open source components, a framework with cleaner foundation or with least suggestion with design, like folder management, will be best.

I'm looking at Silex. I hope that we do away with making phpBB a base/foundation for cms. Let's make it as pluggable a forum to any existing properly coded php site.

stevenmw
Registered User
Posts: 34
Joined: Sat Jun 22, 2013 5:19 pm

Re: [RFC|Accepted] Symfony 2

Post by stevenmw »

meatsadam wrote:After gaining some time for PHP, I realized we're better off using Symfony components not necessarily the full stack framework. Since we mostly do composer now, let's strive in making reusable libraries mature. Sticking with the full stack framework means we're at least to start from the architecture/design that it uses. Symfony 2 focuses a lot on backportability and so some architectural decisions might not be wise to carry on anymore.

Since Symfony is more about the open source components, a framework with cleaner foundation or with least suggestion with design, like folder management, will be best.

I'm looking at Silex. I hope that we do away with making phpBB a base/foundation for cms. Let's make it as pluggable a forum to any existing properly coded php site.
I agree completely with this view point. It is a much better idea not to use the full stack. This could lead to a lot more possibilities.

sajaki
Registered User
Posts: 86
Joined: Mon Jun 21, 2010 8:28 pm

Re: [RFC|Accepted] Symfony 2

Post by sajaki »

This may be offtopic, but it is Silex/Symphony related, so i'm posting here.
I had a look at the code documentation of the Silex framework mentioned above, and there are a many passages that baffle me. may be due to my inexperience with the latest php.

this code for example :

Code: Select all

$blogPosts = array(
    1 => array(
        'date'      => '2011-03-29',
        'author'    => 'igorw',
        'title'     => 'Using Silex',
        'body'      => '...',
    ),
);

$app->get('/blog', function () use ($blogPosts) 
{
    $output = '';
    foreach ($blogPosts as $post) {
        $output .= $post['title'];
        $output .= '<br />';
    }

    return $output;
});
I totally don't understand this $app->get('/blog', function () use ($blogPosts) line for example.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC|Accepted] Symfony 2

Post by imkingdavid »

sajaki wrote:This may be offtopic, but it is Silex/Symphony related, so i'm posting here.
I had a look at the code documentation of the Silex framework mentioned above, and there are a many passages that baffle me. may be due to my inexperience with the latest php.

this code for example :

Code: Select all

$blogPosts = array(
    1 => array(
        'date'      => '2011-03-29',
        'author'    => 'igorw',
        'title'     => 'Using Silex',
        'body'      => '...',
    ),
);

$app->get('/blog', function () use ($blogPosts) 
{
    $output = '';
    foreach ($blogPosts as $post) {
        $output .= $post['title'];
        $output .= '<br />';
    }

    return $output;
});
I totally don't understand this $app->get('/blog', function () use ($blogPosts) line for example.
$app->get() is the routing function. The first argument is the route to match (so when the url is site.com/blog that will be matched). The second argument is a lambda (aka anonymous) function (more specifically, a closure). As for the "use" keyword, that is how you grant the function access to variables located outside of the scope of the function. So you're giving the callback function the ability to use $blogPosts, which it uses in the foreach() loop. Note that because the variable is passed by value and not reference any changes made to $blogPosts within the lambda function are lost when you call the variable outside of that function.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Post Reply