Skip to content

Commit

Permalink
Add initialize hook documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Luraine committed Oct 8, 2010
1 parent d71eed4 commit 7da04b7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
31 changes: 9 additions & 22 deletions TODO
@@ -1,7 +1,7 @@
# TODO #

- add documentation for `initialize` hook and add it to abstracts
- removing php shorttags in example to enhance compatibility
- in README, add a section about hooks and user defined functions
- removing php shortags in example to enhance compatibility
- add a flash_keep() function like in rails (http://guides.rubyonrails.org/action_controller_overview.html#the-flash)
- Add instructions about running tests
- in route() functions, replace "function" name with "callback" name (example: in route_build() returned array). Enhanced use of callback pseudo-type instead of functions names.
Expand Down Expand Up @@ -34,13 +34,8 @@
- update Limonade codename (in french now)
- adding contributors/thanks in AUTHORS
- in run(), passing $env to all functions that require it
- improving unregister_globals
- to avoid predefined variables (_SERVER, _REQUEST...) deletion
- to handle session globals by calling unregister_globals('_SESSION') after session start
- deleting deprecated ['HTTP_SERVER_VARS'], ['HTTP_GET_VARS']... (<http://www.php.net/manual/fr/reserved.variables.post.php>...)
- implement user agent detection option in routing
- params function should be singular like option ?
- adding a debug() helper


- new redirect_to (support for https)
- public API documentation:
- tests: tag private functions
Expand All @@ -51,22 +46,11 @@

- more unit and functional tests

## Lemons ##

- simple form helper with XSS/CSRF protection
- package <http://github.com/sofadesign/vincent-helye.com/blob/master/app/lib/lemon_security.php>
- add documentation and example
- simple form helper that handle put method
- authentication
- package <http://github.com/sofadesign/vincent-helye.com/blob/master/app/lib/lemon_auth.php>
- add documentation and example

- http_cache
- package <http://github.com/sofadesign/vincent-helye.com/blob/master/app/lib/http_cache.php>
- add documentation and example

## Later ##

- implement user agent detection option in routing

Documentation:

- reformat code comments in order to use Natural docs (http://www.naturaldocs.org/)
Expand Down Expand Up @@ -100,3 +84,6 @@ Documentation:

- make post, put and delete params accessible with the params() function
(take care of possible conflict with a route param: by default override get params, but raise an error notice). Really useful ?
- deleting deprecated ['HTTP_SERVER_VARS'], ['HTTP_GET_VARS']... (<http://www.php.net/manual/fr/reserved.variables.post.php>...)
- params function should be singular like option ?

1 change: 1 addition & 0 deletions lib/limonade.php
Expand Up @@ -174,6 +174,7 @@ function render_limonade_file()
# Abstract methods that might be redefined by user:
#
# - function configure(){}
# - function initialize(){}
# - function autoload_controller($callback){}
# - function before($route){}
# - function after($output, $route){}
Expand Down
14 changes: 13 additions & 1 deletion lib/limonade/abstract.php
Expand Up @@ -9,7 +9,7 @@
*/

/**
* It will be called when app is launched (at the begining og the run function).
* It will be called when app is launched (at the begining of the run function).
* You can define options inside it, a connection to a database ...
*
* @abstract this function might be redefined by user
Expand All @@ -20,6 +20,18 @@ function configure()
return;
}

/**
* Called in run() just after session start, and before checking request method
* and output buffer start.
*
* @abstract this function might be redefined by user
* @return void
*/
function initialize()
{
return;
}

/**
* Called in run() just after the route matching, in order to load controllers.
* If not specfied, the default function is called:
Expand Down

0 comments on commit 7da04b7

Please sign in to comment.