Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new feature: With settings output #10

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Limonade is a PHP micro framework for rapid web development and prototyping.

It's inspired by frameworks like [Sinatra](http://www.sinatrarb.com/) or [Camping](http://github.com/camping/camping) in Ruby, or [Orbit](http://orbit.luaforge.net/) in Lua. It aims to be simple, lightweight and extremly flexible.
It's inspired by frameworks like [Sinatra](http://www.sinatrarb.com/) or [Camping](http://github.com/camping/camping) in Ruby, or [Orbit](http://orbit.luaforge.net/) in Lua. It aims to be simple, lightweight and extremely flexible.

Limonade provides functions that complete the PHP basic set, while keeping consistency with native functions and sitting up on them.

Expand Down Expand Up @@ -252,9 +252,9 @@ You can access your site with urls like `http://your.new-website.com/my/limonade
## Views and templates ##

Template files are located by default in `views/` folder.
Views folder location can be set with the `views_dir` option.
Views folder location can be set with the `dir.views` option.

option('views_dir', dirname(__FILE__).'/other/dir/for/views');
option('dir.views', dirname(__FILE__).'/other/dir/for/views');

To pass variables to templates, we use the function `set ()`

Expand Down Expand Up @@ -484,7 +484,7 @@ The first three parameters are the same as those passed to the `render` function
* `$layout`: current layout path
* `$locals`: variables passed directly to the `render` function

Last parameter, `$view_path` is by default `file_path(option('views_dir'), $content_or_func);`
Last parameter, `$view_path` is by default `file_path(option('dir.views'), $content_or_func);`

function before_render($content_or_func, $layout, $locals, $view_path)
{
Expand Down Expand Up @@ -585,17 +585,32 @@ You can use it to manage Limonade options and your own custom options in your ap

Default Limonade options have the following values:

option('root_dir', $root_dir); // this folder contains your main application file
option('dir.root', $root_dir); // this folder contains your main application file
option('base_path', $base_path);
option('base_uri', $base_uri); // set it manually if you use url_rewriting
option('limonade_dir', dirname(__FILE__).'/'); // this fiolder contains the limonade.php main file
option('limonade_views_dir', dirname(__FILE__).'/limonade/views/');
option('limonade_public_dir',dirname(__FILE__).'/limonade/public/');
option('public_dir', $root_dir.'/public/');
option('views_dir', $root_dir.'/views/');
option('controllers_dir', $root_dir.'/controllers/');
option('lib_dir', $root_dir.'/lib/');
option('error_views_dir', option('limonade_views_dir'));
option('dir.limonade', dirname(__FILE__).'/'); // this fiolder contains the limonade.php main file
option('dir.limonade.views', dirname(__FILE__).'/limonade/views/');
option('dir.limonade.public',dirname(__FILE__).'/limonade/public/');
option('dir.public', $root_dir.'/public/');
option('dir.views', $root_dir.'/views/');
option('dir.controllers', $root_dir.'/controllers/');
option('dir.lib', $root_dir.'/lib/');
option('dir.views.errors', option('dir.limonade.views'));

# custom dirs
option('dir.lib.cores', file_path($lim_dir, 'core'));
option('dir.lib.core', file_path($lim_dir, 'core'));
option('dir.lib.helpers', file_path($lim_dir, 'helpers'));
option('dir.lib.lexts', file_path($lim_dir, 'lexts'));

option('dir.db', file_path(dirname($root_dir), 'db'));
option('dir.app', file_path(dirname($lim_dir)));
option('dir.app.assets', file_path(dirname($lim_dir), 'assets'));
option('dir.app.conf', file_path(dirname($lim_dir), 'conf'));
option('dir.app.lib', file_path($lim_dir));
option('dir.app.models', file_path(dirname($lim_dir), 'models'));
option('dir.app.views', file_path(dirname($lim_dir), 'views'));

option('env', ENV_PRODUCTION);
option('debug', true);
option('session', LIM_SESSION_NAME); // true, false or the name of your session
Expand All @@ -604,6 +619,7 @@ Default Limonade options have the following values:
// X-SENDFILE: for Apache and Lighttpd v. >= 1.5,
// X-LIGHTTPD-SEND-FILE: for Apache and Lighttpd v. < 1.5


## Sessions ##

Session starts automatically by default. Then you can access session variables like you used to do, with `$_SESSION` array.
Expand Down
14 changes: 7 additions & 7 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
### 0.5.1 ###

- cleanup documentation
- put everything in the github wiki
- put everything in the Github wiki
- add a Getting Started section
- make the README hyper-simplified; acts as a resume, lits of features + and a table of content
- make the README hyper-simplified; acts as a resume, list of features + and a table of content
- remove reference to html API: no time to maintain it and source code is enough. Maybe we can simply use a two-columns documentation generated with something like http://rtomayko.github.com/rocco/ ?
- Add instructions about running tests
- adding contributors/thanks in AUTHORS
Expand All @@ -19,7 +19,7 @@
- in README, complete the section about hooks and user defined functions
- add file controller feature
- a controller can be a file if controller callback string ending with '.php'
- this allow to push direcly the procedural code of the controller in a file, without declaring a controller function
- this allow to push directly the procedural code of the controller in a file, without declaring a controller function
- it end with a return, like a normal controller
- code is loaded in a container function when route is built, just before execution

Expand All @@ -34,7 +34,7 @@
- route_callback_[controller_]create()
- route_callback_[controller_]call()
- add a flash_keep() function like in rails (http://guides.rubyonrails.org/action_controller_overview.html#the-flash)
- in debug output, formating debug_backtrace to be me readable (like debug_backtrace output but with extra informations that can be toggled). Using show_settings view by kematzy ? http://github.com/kematzy/limonade/commit/02ad17260912757b73ff809acad8e970efafc4b4
- in debug output, formatting debug_backtrace to be more readable (like debug_backtrace output but with extra informations that can be toggled). Using show_settings view by kematzy ? http://github.com/kematzy/limonade/commit/02ad17260912757b73ff809acad8e970efafc4b4
- improve security in render_file with a safe_dir option
- new redirect_to (support for https)
- Use callback pseudo-type instead of function in error user defined handling.
Expand All @@ -56,16 +56,16 @@

#### Adding support for handling php settings with option() function

- this will help have more consistency, and setting php options at the begining of the run
- this will help have more consistency, and setting php options at the beginning of the run
- all options that begins with `php_` are mapped with ini_set() options in read and write
- adding an option('php_display_errors'); by default ini_set('display_errors', 0) in production env, but enabled if env is dev (unless matching option is enabled)
- a default callback `php_display_errors` will be there to set correct limonade debug level
- a default callback `php_display_errors` will be there to set correct Limonade debug level


### 0.8 ###

- Zestify Limonade
- refactor main dipatching loop
- refactor main dispatching loop
- allow zest response return in controllers


Expand Down
Loading