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

Conversation

kematzy
Copy link
Contributor

@kematzy kematzy commented Sep 23, 2010

Hi Fabrice,

I just added a new feature to Limonade, that you might like, but most likely not want as part of the core.

It's basically a version of the [ http://github.com/kematzy/sinatra-settings ] Sinatra extension I created a while back. So to see quickly what its, please look at that page and the screenshot there.

Simply put, it enables you to output all the application settings - during development - nicely formatted at the bottom of the page, so that you can get a quick overview of your app's various settings.

The best way to understand is to grab a copy of this branch, create a basic app and then add

at the bottom of the default layout page.

If you don't like it, that's fine. I'll try to keep this branch in line with your master anyway.

Btw, the first commit in this branch contains a rather good debug() function that should really be part of Limonade, so perhaps you can extract just it, or else give me a shout and I'll do separate branch for just that function.

Thanks.

Sometimes you just need to know what's going on inside a variable
and this helps.

Instead of writing <?php echo var_export($variable, true); ?>, 
you can now write just <?php echo debug($variable); ?> and get 
a more sophisticated output.

Concept taken from RubyOnRails by DHH.
When working with an app, it can sometimes be handy to see
all the various application settings at the bottom of the page,
so that you can quickly spot any issues.

This addition makes this very easy.

Design liberally borrowed from Sinatra (www.sinatrarb.com)
@sofadesign
Copy link
Owner

Hello,

sorry for answering so late. I like your pretty and very useful 'settings output' feature. But as you suggested, I prefer not to include it in core, keeping it slim and only for essential features. I should also do some cleanup. So I created a repository for all those useful stuff that will enhanced Limonade: I call them lemons http://github.com/sofadesign/lemons.
So you're welcome to contribute and fill lemons with your code.
About your debug() function, sure, I add it to Limonade.

Thanks for involving in Limonade

++ Fabrice

* master: (38 commits)
  [Fix] Only wrap <pre> on HTML output.
  Redéfinition de la constante E_RECOVERABLE_ERROR pour les versions de PHP < 5.2 (cherry picked from commit b2a85869cf743058c17912c3788dd16c945dcf16)
  Fix htaccess in README: comments may not be included on a line after a configuration directiv
  Comments may not be included on a line after a configuration directive. See: http://httpd.apache.org/docs/1.3/configuring.html#syntax
  Update .gitignore: exclude cookiefile in root folder
  Fix a PHP notice raised in strict mode [sofadesign#48 state:resolved]
  Fix example 1
  Remove php short tags
  Fix a regexp bug with PHP5.1.5 and simplify directory separator cleaning regexp in file_path function
  Fix README again: remove duplicated content
  Update .gitignore: exclude vim .un~ files
  Fix README: remove duplicated content
  Fix example 1
  Remove php short tags
  Fix a regexp bug with PHP5.1.5 and simplify directory separator cleaning regexp in file_path function
  Limonade PHP 0.5 is released!
  Update CHANGES (just one step before releasing 0.5!)
  Fix after($output) example in README [sofadesign#42 state:resolved]
  Remove php shortags in examples and tests to enhance compatibility
  Add tests and documentation for `partial` function
  ...

Conflicts:
	lib/limonade.php
Working with option('a.value') can be pain sometimes and these added functions make it less painful.

* option_isset('option.name') => returns True/False based upon if value returned is NULL

* isset_option('option.name') => syntactic sugar for option_isset()

* option_defined('option.name') => syntactic sugar for option_isset().   Reads better in some circumstances

* option_undefined('option.name') => syntactic sugar for doing a  " !option_isset() ". Reads better in some circumstances

* option_equals('option.name', 'value') => tests for presence and value of option('value') at the same time.
* refs/heads/kematzy: (30 commits)
  Added new option() related functionality
  Typo fixes
  Amended private version with some extra goodies thrown in
  Reorder initial configuration settings in run function
  Rename _lim_header to send_header. Rename inspect_header to before_sending_header.
  Add a way to manage fallbacks for not implemented functions. Raise warning if try to use json_encode() when it's not available. PHP 5 < PHP 5.2.0 doesn't provide json functions natively.
  Fix a small PHP notice in a test (undefined index…)
  Fix PHP Parse error when running tests on PHP5.3.0 < : use eval to declare a lambda function.
  Fix warning in tests on PHP5.2.3 < . Avoid test for call_if_exists with static class method call.
  Fix fatal error if memory_get_usage() isn't available. Now benchmark() only return execution time in this case.
  Remove from the README file the link to the public API because it's no longer maintened.
  Add requirements in README [sofadesign#50 state:resolved]
  Prevents flash sweep for HEAD requests like suggested by @msaspence in issue sofadesign#20.
  Fix backward compatibilty function limonade_htmlspecialchars_decode. Now supports &sofadesign#39; entities
  Add a way to manage fallbacks for not implemented functions. Raise warning if try to use json_encode() when it's not available. PHP 5 < PHP 5.2.0 doesn't provide json functions natively.
  Fix a small PHP notice in a test (undefined index…)
  Fix PHP Parse error when running tests on PHP5.3.0 < : use eval to declare a lambda function.
  Fix warning in tests on PHP5.2.3 < . Avoid test for call_if_exists with static class method call.
  Fix fatal error if memory_get_usage() isn't available. Now benchmark() only return execution time in this case.
  Remove from the README file the link to the public API because it's no longer maintened.
  ...

Conflicts:
	lib/limonade.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants