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 199310 - Update/improve PHP samples
Summary: Update/improve PHP samples
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 196761 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-09 13:52 UTC by Tomas Mysik
Modified: 2011-11-21 14:58 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2011-06-09 13:52:23 UTC
PHP samples should be updated and/or improved as well.
Comment 1 Tomas Mysik 2011-06-09 13:56:35 UTC
*** Bug 196761 has been marked as a duplicate of this bug. ***
Comment 2 Vladimir Riha 2011-07-29 07:35:26 UTC
- Symfony sample is basically not working at all with the latest version of symfony framework
-AirAlliance is showing errors (for example go to AirAlliances/web/processitinerary.php and try to book with some values, it shows "Notice: Undefined variable: flightsArray in AirAlliances\web\itinerarymanager.php on line 256"
-RentAFlat - shows error for example if you go to "Offers", then warning about undeclared variable $res in sell-estate/index.phtml is displayed.

So none of sample project is working, raising priority to P2
Comment 3 Marian Mirilovic 2011-07-29 07:51:15 UTC
not for 7.0.1, but we need to fix it definitely for 7.1
Comment 4 Tomas Mysik 2011-07-29 08:01:52 UTC
(In reply to comment #2)
> - Symfony sample is basically not working at all with the latest version of
> symfony framework

Will look at it (I guess you are using Symfony 1.x version, right?). It would be great if you could find what is wrong and what needs to be done (this sample was done by your predecessor ;).

> -AirAlliance is showing errors (for example go to
> AirAlliances/web/processitinerary.php and try to book with some values, it
> shows "Notice: Undefined variable: flightsArray in
> AirAlliances\web\itinerarymanager.php on line 256"
> -RentAFlat - shows error for example if you go to "Offers", then warning about
> undeclared variable $res in sell-estate/index.phtml is displayed.

These errors are likely caused by your php.ini setup since by default, notices are ignored. Or am I wrong?
(Again, this sample was done by your predecessor too ;)

> So none of sample project is working, raising priority to P2

Anyway, PHP samples must be updated, that's why I filed this issue.
Comment 5 Tomas Mysik 2011-07-29 08:04:07 UTC
(In reply to comment #4)
> It would
> be great if you could find what is wrong and what needs to be done.

See issue #196761.
Comment 6 Vladimir Riha 2011-07-29 08:27:38 UTC
Yes, symfony 1.4.9, I briefly described what's wrong but I can look at it more thoroughly.

As for the notices, my default settings is "error_reporting = E_ALL | E_STRICT", it is default setting of XAMPP package, I didn't realize it.
Comment 7 Tomas Mysik 2011-07-29 10:30:44 UTC
One more note: the biggest problem I can see here is that - perhaps except Jobeet - the samples are quite "bad" (I mean quality). I would prefer to have just one sample with nice source code to show modern ways how to develop a PHP web site.
Comment 8 Ondrej Brejla 2011-09-09 14:45:42 UTC
cc
Comment 9 Tomas Mysik 2011-10-10 08:38:09 UTC
Work in progress...

ZF sample fixed.
http://hg.netbeans.org/web-main/rev/07af7fce483f

AirAlliance sample replaced by TodoList sample.
http://hg.netbeans.org/web-main/rev/38fd57fd9bb1
http://hg.netbeans.org/web-main/rev/284beb341e34
Comment 10 Quality Engineering 2011-10-11 14:16:57 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/07af7fce483f
User: Tomas Mysik <tmysik@netbeans.org>
Log: Part of #199310 - Update/improve PHP samples

ZF sample fixed.
Comment 11 Tomas Mysik 2011-10-14 13:47:37 UTC
Fixed. Láďo, please verify all the samples. Thanks.

Zend sample improved & fixed.
http://hg.netbeans.org/web-main/rev/3f4640f1473b

Old Symfony sample removed.
http://hg.netbeans.org/web-main/rev/2a58f3ec3569

New Symfony sample added.
http://hg.netbeans.org/web-main/rev/ada583c286da
Comment 12 Vladimir Riha 2011-10-17 11:57:30 UTC
TodoList and Zend sample looks fine. 

About the Symfony, if I right click the project and select Symfony|Run Command, no commands are found. I tried to repeat it with simple new project (New Project|PHP|PHP Application) with Symfony fw and it works so maybe there's something missing in the sample?

Also if you open New Project dialog and select Samples|PHP both samples for Symfony and Zend have same icon "ZF" which should be probably only for Zend
Comment 13 Tomas Mysik 2011-10-17 12:58:44 UTC
(In reply to comment #12)
> About the Symfony, if I right click the project and select Symfony|Run Command,
> no commands are found. I tried to repeat it with simple new project (New
> Project|PHP|PHP Application) with Symfony fw and it works so maybe there's
> something missing in the sample?

I cannot reproduce, it works for me. Can you try it from command line in the project directory, e.g. "php symfony help"?

> Also if you open New Project dialog and select Samples|PHP both samples for
> Symfony and Zend have same icon "ZF" which should be probably only for Zend

I have changed the icon, now it is a house (the same icon for both samples since they in fact should be the same).

Thanks.