Added a new feature: With settings output#10
Open
kematzy wants to merge 8 commits intosofadesign:masterfrom
Open
Added a new feature: With settings output#10kematzy wants to merge 8 commits intosofadesign:masterfrom
kematzy wants to merge 8 commits intosofadesign:masterfrom
Conversation
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)
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. 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.