This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267676 - Support Symfony2 and Symfony3 in one project
Summary: Support Symfony2 and Symfony3 in one project
Status: REOPENED
Alias: None
Product: php
Classification: Unclassified
Component: Symfony (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-22 17:15 UTC by geoB
Modified: 2016-08-23 14:39 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description geoB 2016-08-22 17:15:44 UTC
In Build 201608220002, Windows 10, 32-bit: It does not appear possible to access Symfony 2 console commands from the context menu.  Output window shows: "C:\PHP\php.exe" "G:\Documents\workspace\projectmana\bin\console" "--ansi" "list" "--format" "xml".  In Symfony2, console is in the app folder rather than the bin folder. The error shown in the Output window is: Fatal error: Cannot declare class AppKernel, because the name is already in use in G:\Documents\workspace\projectmana\vendor\javiereguiluz\easyadmin-bundle\Tests\Fixtures\App\AppKernel.php on line 68
Done.

The project Properties, Frameworks selections do not include Symfony2, only Symfony3.  Yet the Symfony3 options window shows that the App directory is indeed app.  Perhaps Frameworks selections should include a separate option for Symfony2, or the action of the context menu for Symfony, Run Command... could use the directory specified?
Comment 1 Tomas Mysik 2016-08-23 09:40:42 UTC
Could you please attach a sample project? That would help us a lot.

Thanks.
Comment 2 Tomas Mysik 2016-08-23 09:44:03 UTC
(In reply to geoB from comment #0)
> The project Properties, Frameworks selections do not include Symfony2, only
> Symfony3.

This is the cause, NetBeans recognizes the project to be Symfony3 project and not Symfony2 one. What exact version of Symfony do you use?

Thanks.
Comment 3 Tomas Mysik 2016-08-23 09:56:37 UTC
BTW if I try to create latest Symfony2 project using the Symfony installer [1], it creates a project that is by NetBeans correctly recognized as Symfony2 project (the detection is based on existence of file "<Source Files>/bin/console" - if this file exists, it is Symfony3 project; could you please verify it in your project?).

So, feel free to reopen but please provide a sample project or at least _exact_ steps to reproduce.

Thanks for reporting.
[1] symfony new my_project 2.8

Product Version: NetBeans IDE Dev (Build 20160823-ccd9a405da6c)
Java: 1.8.0_101; Java HotSpot(TM) 64-Bit Server VM 25.101-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_101-b13
System: Linux version 4.4.0-34-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 4 geoB 2016-08-23 12:25:38 UTC
> the detection is based on existence of file "<Source Files>/bin/console"

The project has branches for both Symfony2 and Symfony3 versions, thus the existence of both .../app/console and .../bin/console.  The contents of .../src are identical for both versions.

I did this so I could have a long term support version (Symfony 2.8) in production, and a future LTS version (Symfony3) in development, and know that I avoided deprecated commands.

The alternative is to maintain two separate projects and apply patches from one version to the other.  This seems far more complex than a version of Netbeans that allows the user to identify which version of Symfony applies to the branch of code.

If this is not a bug, can we make it a feature request?
Comment 5 Tomas Mysik 2016-08-23 13:07:03 UTC
(In reply to geoB from comment #4)
> The project has branches for both Symfony2 and Symfony3 versions, thus the
> existence of both .../app/console and .../bin/console.  The contents of
> .../src are identical for both versions.

Sorry, this is not supported right now.

> The alternative is to maintain two separate projects and apply patches from
> one version to the other.  This seems far more complex than a version of
> Netbeans that allows the user to identify which version of Symfony applies
> to the branch of code.

Or perhaps you could simply rename "bin/console" to "bin/console~" (and possibly reopen the project).

> If this is not a bug, can we make it a feature request?

We can but frankly, I do not think that this will be a common situation (but I can be wrong, of course!). Feel free to describe how would you expect NetBeans to handle this situation.

Thanks.
Comment 6 geoB 2016-08-23 14:39:38 UTC
Unfortunately, renaming console to console~ makes the file invisible in both branches, thus making the Symfony3 branch not recognizable as a Symfony project.

I note that the project properties contains the following:

auxiliary.org-netbeans-modules-php-symfony2.appDir-path=bin

This is not accurate in that it is a symfony3 project.  I do not know, however, what it would take to allow both

auxiliary.org-netbeans-modules-php-symfony2.appDir-path=app
AND
auxiliary.org-netbeans-modules-php-symfony3.appDir-path=bin

to be meaningful to the operation of Netbeans.