github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

mcurry / interactive

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 21
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (2)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Custom panel for the CakePHP DebugKit allowing for interactive sessions with your app — Read more

  cancel

http://www.pseudocoder.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

fixing form url to point to current plugin. fixes cross-plugin 
compatibility 
josegonzalez (author)
Tue Sep 29 02:24:22 -0700 2009
commit  61ecb8a581fc4939d91c636794ae7e05f28d7341
tree    9be78003bcfdb29c9900e1c2832a4e8e4a93b303
parent  f0157fbbcc558f4ad8133c1bbc1abaf4d1dfe710
interactive /
name age
history
message
file README Mon Jun 08 20:14:17 -0700 2009 fixed docs to match debug_kit trunk [mcurry]
directory controllers/ Thu Jul 23 05:40:45 -0700 2009 fix compatibility w/ security component [mcurry]
file interactive_app_controller.php Fri Jun 05 19:28:53 -0700 2009 initial revision [mcurry]
file interactive_app_model.php Fri Jun 05 19:28:53 -0700 2009 initial revision [mcurry]
directory models/ Mon Jun 08 21:10:48 -0700 2009 handle $this-> [mcurry]
directory tests/ Mon Jun 08 20:53:10 -0700 2009 better handling for name conflicts [mcurry]
directory vendors/ Fri Jul 10 21:46:37 -0700 2009 Q -> q [mcurry]
directory views/ Tue Sep 29 02:24:22 -0700 2009 fixing form url to point to current plugin. fix... [josegonzalez]
README
/*
 * Interactive panel for the CakePHP DebugKit
 * Copyright (c) 2009 Matt Curry
 * www.PseudoCoder.com
 * http://github.com/mcurry/interactive
 *
 * @author      Matt Curry <matt@pseudocoder.com>
 * @license     MIT
 *
 */

/* About */
This plugin adds easy interactions with your CakePHP app using the console or through a custom panel for the CakePHP 
DebugKit.  
It handles simple PHP commands, SQL queries and PHP using your Cake objects.

/* Examples */
10 % 4 (returns 2)
is_array(49) (returns false)
SELECT id FROM users WHERE email = 'test@test.com' (retuns the id of the matching record)
User::findByEmail('test@test.com') (returns the entire matching user record)

/* Power Usage */
When using in the DebugKit panel you can stack commands, just make sure to end each with a ";" as you would in your 
code.

If you're having trouble getting results for a particular command and can't figure out why try turning on debug as the 
first command:
Configure::write('debug', 2);
User::findByEmail('test@test.com');

/* Warning */
There isn't any sort of error detection or validation on the input.  Also there isn't any pagination for long result 
sets.  If you enter in a query that returns a million records, you're going to get a million records.

You can't declare a variable and use it across commands. For example this doesn't work:
$i = 10;
$i ++;

/* Instructions */
1) Download the plugin to /app/plugin/interactive

/* Console Instructions */
1) Run the cake console passing the "interactive" shell
   from /app: ../cake/console/cake interactive

2) Enter commands as needed.  Enter 'Q' to exit.  

3) You can also commands as parameters.  The interactive shell will run the command and exit
   ../cake/console/cake interactive Post::find('first')
   
/* DebugKit Instructions (version 1.1) */
1) You need to patch the DebugKit to include the fix for defect #21 (http://thechaw.com/debug_kit/tickets/view/21).
   The fix is 3 additional lines to /plugins/debug_kit/controllers/components/toolbar.php
   http://thechaw.com/debug_kit/commits/view/ba5a45f930e3f2b65cf779155c65048c660110c5
   
2) In your AppController include the panel (as well as all the default panels):
   var $components = array('DebugKit.Toolbar' => array('history', 'session', 'request', 'sqlLog', 'timer', 'log', 
   'variables', 'Interactive.interactive');

/* DebugKit Instructions (trunk) */
1) Include the panel:
   $components = array('DebugKit.Toolbar' => array('panels' => array('Interactive.interactive'));
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server