Jobeet Sample Application - Readme
NetBeans PHP Sample Application for Symfony Framework
Application Author:
Fabien Potencier, Symfony
Readme Author:
PHP Netbeans Team with help of Symfony official documentation
What is Jobeet?
Jobeet is a PHP application built on the Symfony framework. It was created by the Symfony team and used in their beginners tutorial. It's a fully working imaginary application with a frontend for visitors and a backend for administrators and demonstrates use of the Doctrine ORM and the sfFormExtraPlugin.
This sample demonstrates the following features:
- Symfony framework support in NetBeans
- Symfony features such as
- Doctrine ORM usage
- Working frontend and backend application with sfFormExtraPlugin
- Symphony i18N usage
- And much more
Requirements
Set up the following before you run the sample:- PHP server (Apache, for example)
- PHP 5.2.x or higher
- MySQL server
- symfony 1.2.x (installation manual below)
- PEAR (optional)
What is included?
- The entire Symfony jobeet project as it is on svn.jobeet.org with documentation and without symfony sources
Installation
You need to set up this project to run it and this document is here to help you. Since this is a symfony project you need to have symfony installed, but we ran into problems with symfony installation, so we include streamlined installation instructions here.
There is official Symfony documentation for jobeet but if you are using symfony for the first time you won't be able to set up this project quickly by following that documentation. On the other hand, most of the instructions in that documentation are needed here. So, no matter how hard we tried to make this simple, we had to use those instructions in this document as well. We hope you will forgive us for copying and pasting some information but we did it for you ;).
We recommend that you read the documents in the /doc folder. They will let you explore Symfony more deeply and show you how this project was developed. Or you can just browse and read the documentation on the symfony pages.
Symfony Installation
Before you begin, stop for a moment and think. Do you just want to try out symfony or do you want to have symfony installed and develop real applications?
- Try only - continue with setup without installation
- For longer - continue with pear installation (slower but will work for all future projects) (if you prefer svn checkout read doc/03-Running-Symfony.txt)
Setting Up Without Installation
- Download symfony 1.2 from http://www.symfony-project.org/installation
- Extract
-
Copy to the sample project's lib/vendor/symfony directory. So the structure will be like
lib/vendor/
|-- Zend
| | ... some Zend framework files for jobeet project
`-- symfony
|-- CHANGELOG
|-- COPYRIGHT
|-- LICENSE
|-- README
|-- UPGRADE_TO_1_1
|-- UPGRADE_TO_1_2
|-- data
|-- doc
|-- lib
|-- licenses
|-- package.xml.tmpl
`-- test -
Symfony is not on your include path now so you need to provide path to
symfony.bat on windows or symfony file on linux.
Open the Tools -> Options -> Php -> Symfony menu. If you followed instructions above then the symfony file will be in lib\vendor\symfony\data\bin\symfony.bat for Windows users and lib/vendor/symfony/data/bin/symfony for Ubuntu users
Symfony is done. Now continue with project setup.
Installing the symfony PEAR Package
-
Make sure you have PEAR installed.
The symfony PEAR package contains the symfony libraries and all its dependencies. It also contains a script that will extend your CLI to include the `symfony` command. -
Add the symfony channel to PEAR, by issuing this command:
pear channel-discover pear.symfony-project.com>
-
To see the libraries available in this channel, type the following:
pear remote-list -c symfony
-
Install the latest stable version of symfony. Issue this command:
pear install symfony/symfony-1.2.11
downloading symfony-1.2.11.tgz ...
Starting to download symfony-1.2.11.tgz (1,283,270 bytes)
.................................................................
.................................................................
.............done: 1,283,270 bytes
install ok: channel://pear.symfony-project.com/symfony-1.2.11
-
That's it. The symfony files and CLI are installed. Check that the installation succeeded by calling the new `symfony` command line and asking for the version number:
symfony -V
symfony version 1.2.11 (/path/to/the/pear/symfony/lib/dir)
The symfony libraries are now installed in directories as follows:
* `$php_dir/symfony/` contains the main libraries.
* `$data_dir/symfony/` contains the web assets used by symfony default modules.
* `$doc_dir/symfony/` contains the documentation.
* `$test_dir/symfony/` contains symfony core unit and functional tests.
The `_dir` variables are part of your PEAR configuration. To see their values, type the following:
pear config-show
Symfony is ready. Now, continue with project setup.
Project Setup
- Change line 3 of config/ProjectConfiguration.class so that it will include
sfCoreAutoload.class.php from your symfony folder in directory.
If you just copied symfony to lib/vendor/, set path to dirname(__FILE__).'/../lib/vendor/symfony/lib/autoloadsfCoreAutoload.class.php
If you installed using PEAR then you should have symfony on your include path.
Your include path is listed in phpinfo() output.
Linux users usually have include_path=".:/usr/share/php". The symfony folder should be in /usr/share/php. Your path therefore is symfony/autoload/sfCoreAutoload.class.php.
Windows users are in a more complicated situation. However you can find out where your include_path directives point from phpinfo() output or add symfony to the include path. Example of php include path on Windows is include_path=".;C:\php5\pear" - Create Jobeet's cache folder in your_project_folder/ and make sure it is writable by everyone (or webserver full access at least)
- Create Jobeet's log folder in your_project_folder/ and make sure it is writable by everyone (or webserver full access at least)
- Make sure Jobeet's data/job.dev.index folder is writable by everyone (or webserver full access at least)
- Set up database connection in config/databases.yml so that it will correspond to your database connection settings
- Call symfony command (right click on project name -> Symfony -> Run Command)
doctrine:build-all-load
- Set up web server doc root to point to
/web.
Example:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /your_web_folder/Jobeet/web
AccessFileName .htaccess
<Directory /your_web_folder/Jobeet/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
</VirtualHost> - Don't forget to change your_web_folder to correct path. Type http://localhost to your browser. If something is wrong then you can try http://localhost/frontend_dev.php, which should have debugging output. You can set up your project to be called from a different url, of course, such as http://localhost/var/www/Jobeet/web, and it should work.
- Invoke symfony commands
guard:create-user admin admin
guard:promote admin
This will create user 'admin' with password 'admin' and make him/her super administrator. You need these credentials to enter the backend application http://localhost/backend.php
Note
Check if you have the path to the php interpreter set correctly if you don't see Symfony commands. If you are using wamp/xampp or a similar product then you need to provide the path to php.exe or php (depends on platform) in Tools -> Options -> PHP.
If you find any problems, don't hesitate to file a bug at http://netbeans.org/community/issues.html against product PHP, component Project. We fixed some bugs we found in downloaded Jobeet project, actually. However, there is no guarantee everything is all right.