OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 

The project control panel

Overview

The Command Line Interface provides useful commands to execute the usual tasks of an application development. However, symfony comes bundled with a web control panel for your projects, enabling you to achieve the same tasks as with the CLI from a web browser.

Installation

The project control panel is not installed by default in a project, but as it consists of a single file, it's pretty easy to add it to each project where you need it.

Locate the file called sf_control_panel.php in $pear_data_dir/symfony/web/ and copy it to your project web/ folder. That's it.

To test the control panel, just browse this script using your favorite web browser. As it's in the root web folder, it should be accessible with:

http://myapp.example.com/sf_control_panel.php

Note: The execution of this script is restricted to the localhost for safety reasons. If the page returned is blank, it might be because you are calling a distant server. You can force the script to run in a distant server by removing lines 11 to 15, but beware of the security risks (see Security below).

Features

Tasks and batch

The control panel gives a web access to the usual CLI tasks for your application. You can easily clear the cache (for all the applications or selectively), rebuild the model or the database itself.

When you click on one of the task links (the bold links), the page displays again with a report of the task action. You can close the report at any time to keep on using the control panel.

The batch scripts located in the project batch/ folder are also detected and can be executed from the control panel by a simple click.

Note: Some of the symfony tasks can take some time to execute, according to the size of your project. If your web server has a small timeout configuration, you might end up with unfinished tasks. Increase your web server timeout to avoid these problems.

Browsing the project

The control panel automatically detects the applications and their environments. It provides links to browse each application in all the available environments.

Parsing the project

All the PHP, XML and YML files of your project can be parsed from within the control panel. It displays the project structure by separating the applications and the model.

For a given application, the list of existing modules is displayed. If you click on a module name, it reveals its structure and allows you to browse its actions, templates and configuration.

The source code is displayed with syntax highlighting, as long as you configured PHP with the appropriate option.

It can be very handy to check your data schema, the available methods of the model or the libraries included in your lib/ folders.

Security

The script is configured to work only when called on localhost to avoid that if it accidentally gets transferred to production, nobody can access it and execute symfony tasks on your project.

This also means that you should exclude this file from your transfers to production. If you use the symfony sync task, this is done by adding the script to the config/rsync_exclude.txt file:

stats
.svn
web/uploads
cache
log
web/sf_control_panel.php

The script can execute symfony commands, and since those commands deal with the file system (creating, modifying and removing files), they may not work if the permissions given to your web server don't allow it. If the cache clearing commands should always work (simply because the cache files are created by your web server), the ones to init a module, a scaffolding or an administration will work only if your web server has write permissions to the apps/ folder. This can be acceptable in a development environment, but it is extremely inadvisable for a production server. So once again, do not use this control panel in the server used in production.

 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting


Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS Free Templates

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005