sfCodeViewPlugin
1.1.1stable
for sf 1.4sf 1.3 MIT
The best way to learn good coding is: read other peoples code
This plugin enables you to quickly read the all the code in your SF project. You can use it for example to learn from code of others, check the API of a specific method, or to better understand the internal workings of Symfony.
The plugin adds an input to the debug toolbar, there you can write the classname whose code you want to explore. If JQuery is installed it will create a fully interactive ajax browser, otherwise it will degrade gracefully.
Developers
License
Copyright (c) 2009 Sjoerd de Jong
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Releases for sf 1.4
| Version |
License |
API |
Released |
|
1.1.1stable
|
MIT license |
1.0.0stable
|
08/12/2009 |
|
1.1.0stable
|
MIT license |
1.0.0stable
|
03/12/2009 |
Releases for sf 1.3
| Version |
License |
API |
Released |
|
1.1.1stable
|
MIT license |
1.0.0stable
|
08/12/2009 |
|
1.1.0stable
|
MIT license |
1.0.0stable
|
03/12/2009 |
Releases for sf 1.2
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
1.0.0stable
|
14/05/2009 |
Changelog for release 1.1.1 - 08/12/2009
- added cache_in_user_session setting to app.yml
- added recurse_vendor_dirs setting to app.yml
- changed package.xml to accept version of history between 1.3.0 and 2.0.0
- fixed loading of user classes, now exclude vendor directory
- fixed CSS
Other releases
Release 1.1.1 - 08/12/2009
- added cache_in_user_session setting to app.yml
- added recurse_vendor_dirs setting to app.yml
- changed package.xml to accept version of history between 1.3.0 and 2.0.0
- fixed loading of user classes, now exclude vendor directory
- fixed CSS
Release 1.1.0 - 03/12/2009
- updated for symfony 1.3 and 1.4
Release 1.0.0 - 14/05/2009
sfCodeView plugin
Learn coding by reading code!
This plugin makes it easy to read your the code of any class in your project, reflect on the API of the symfony core or learn about the inner workings of a Symfony.
WARNING: please make sure you never use this plugin in a production environment. Publishing your code can lead to severe security risks!!
Overview
sfCodeView is a symfony plugin that extends the debug bar with an option to interactively read the source code of your project.
The plugin can optionally use the sfJQueryReloaded plugin. If this plugin is used the browser will use AJAX calls which will enable a smoother experience.
Installation
Install the plugin
> php symfony plugin:install sfCodeViewPlugin # for symfony 1.2
Publish the plugin assets
> php symfony plugin:publish-assets
Clear the cache
> php symfony cc
Enable the sfCodeView module in settings.yml:
all:
.settings:
enabled_modules: [default, sfCodeView]
To enable ajax interaction, jquery is needed. Install either a jQuery plugin
(like sfJqueryReloadedPlugin) or add jquery from Google cdn in your view.yml:
default:
javascripts:
- http://ajax.googleapis.com/ajax/libs/jquery/1.3./jquery.min.js
Usage
In dev mode the debug toolbar will be extended with a little input box. Type the name of a class in your project in there and the sfCodeView plugin will show you the code. That's all!
Options
The following options are available (all in app.yml), all options displayed are the
defaults, specified in the plugins app.yml:
all:
sfCodeViewPlugin:
stylesheets:
- '/sfCodeViewPlugin/css/sfCodeViewPlugin.css'
javascripts:
- '/sfCodeViewPlugin/js/sfCodeViewPlugin.js'
recurse_vendor_dirs: false
cache_in_user_session: sfCodeViewPlugin_cache_content
You can add/override the javascripts / stylesheets included in this plugin by overriding the plugin's app.yml.
This allows you to easily give your transformed forms custom styles
recurse_vendor_dirs specifies if you also want read the classes inside vendor
directories in your project. Setting this to true can take a lot of time to load, for
instance when you have a full 'Zend' library in your /lib/vendor/Zend.
for speeding up the script, specify a key at cache_in_user_session, all classes will
only loaded at the first request of the current session/user and will then be stored
in the session using the specified key. If you want to reload the classes, close your
browser and reload in a new one. Use 'false' to disable the cache.
TODO / Ideas
- integrate links to the symfony core test files, as they provide a lot of information
about how to use the classes
Changelog
2009-12-08 | 1.1.1 stable
- added cache_in_user_session setting to app.yml
- added recurse_vendor_dirs setting to app.yml
- changed package.xml to accept version of history between 1.3.0 and 2.0.0
- fixed loading of user classes, now exclude vendor directory
- fixed CSS
2009-12-03 | 1.1 stable
- made the plugin sf 1.3 and 1.4 compatible
- added method docblock as a title for class methods
- tested in firefox, chrome and ie, works ok in chrome&firefox, ie works but is not as nice as in chrome or firefox
2009-05-06 | 1.0 stable