darsain / laravel-console Goto Github PK
View Code? Open in Web Editor NEWIn-browser console for Laravel PHP framework.
In-browser console for Laravel PHP framework.
function get_file_size() doesn't exist in older versions of laravel.
You should include it in the bundle.
BTW, nice bundle. Thank you.
When I try to call an Alias from console I get
Execution failed: 404 error
I want to see feature "save/load snippet" in browser local storage. What u think about this?
I haven't actually looked into L4 yet, and dunno when I will (no PHP projects on a horizon for me atm), so if someone can give me a quick write up of how to restructure this for L4, you'd be really helpful :)
Also, some ideas on how to retain support for L3 without creating a new repo?
I think that you will not develop this package anymore so, I ask you to allow me to take continue.
https://github.com/teepluss/laravel-console
The problem when updating to Laravel 4.1
Does the changes of illuminate/support dependency version to 4.1.x will work?
Problem 1
- darsain/laravel-console dev-master requires illuminate/support 4.0.x -> satisfiable by laravel/framework[4.0.x-dev, v4.0.0, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9], illuminate/support[4.0.x-dev, v4.0.0, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9].
- darsain/laravel-console dev-master requires illuminate/support 4.0.x -> satisfiable by laravel/framework[4.0.x-dev, v4.0.0, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9], illuminate/support[4.0.x-dev, v4.0.0, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9].
- don't install illuminate/support 4.0.x-dev|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.0|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.0-BETA2|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.0-BETA3|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.0-BETA4|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.1|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.10|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.2|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.3|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.4|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.5|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.6|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.7|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.8|don't install laravel/framework 4.1.x-dev
- don't install illuminate/support v4.0.9|don't install laravel/framework 4.1.x-dev
- Can only install one of: laravel/framework[4.1.x-dev, 4.0.x-dev].
- Can only install one of: laravel/framework[v4.0.0, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.0-BETA2, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.0-BETA3, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.0-BETA4, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.1, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.10, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.2, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.3, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.4, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.5, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.6, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.7, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.8, 4.1.x-dev].
- Can only install one of: laravel/framework[v4.0.9, 4.1.x-dev].
- Can only install one of: laravel/framework[4.1.x-dev, 4.0.x-dev].
- Installation request for laravel/framework 4.1.* -> satisfiable by laravel/framework[4.1.x-dev].
- Installation request for darsain/laravel-console dev-master -> satisfiable by darsain/laravel-console[dev-master].
After running the setup instructions, the assets folder created is called darsain/laravel-console as you can see in the result of artisan asset:publish
Assets published for package: darsain/laravel-console
But when I go to mydomain.com/console I see that the assets are being loaded from console folder instead of laravel-console so no assets are loaded.
I can easily fix that by renaming the folder but I think it's an issue.
No matter what I try I simply cannot focus editor (and write anything)
Tested with different browsers:
Opera 12.16
Firefox 29.0
Chromium 34.0.1847.116
Chrome 35.0.1916.114
OS: Ubuntu 14.04
Does it require some specific version of flash/java/whatever?
//EDIT:
It seems to be a blade bug, after inspection I found that my compiled partials/head.blade.php looks like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Laravel Console</title>
<meta name="viewport" content="width=device-width">
<?php echo HTML::style('packages/darsain/laravel-console/css/normalize.css'); ?>
<?php echo HTML::style('packages/darsain/laravel-console/css/main.css'); ?>
{{ HTML::style('packages/darsain/laravel-console/css/codemirror.css') }}
<?php echo HTML::style('packages/darsain/laravel-console/css/laravel.css'); ?>
<?php echo HTML::script('packages/darsain/laravel-console/js/vendor/modernizr.js'); ?>
</head>
<body>
When I created this, there was nothing better to use, but now (and apparently some time in L4 too), there is artisan tinker
which is a core component of Laravel, and provides the same kind of functionality. You can run code from your app context with all files loaded, you have access to your models, you can run ORM queries...
With that in mind, I think I'd rather deprecate this project in favor of tinker.
But, I'm not using Laravel right now, and have no tinker experience, so if there is anyone in here that does, and has a valid reason why this shouldn't be deprecated, speak up :)
Alongside execution times and used memory info, include a list of executed SQL queries and time they took to execute.
There is a bug about get_file_size(), the parameter can't be zero. So, if you use
'output_size' => get_file_size(strlen($output),
to get the output size, it will throw error exception when there is no output. It should be changeed to
'output_size' => (strlen($output)) ? get_file_size(strlen($output)) : 0,
I am not sure the bug only happened to me or everybody.
My php is 5.3.10.
Mark
Sometimes I hit a situation where the output from code in the console is blank. Whenever this happens I get:
Unhandled Exception
Message:
Undefined offset: -9223372036854775808
Location:
laravel/helpers.php on line 597
Stack Trace:
#0 laravel/laravel.php(42): Laravel\Error::native(8, 'Undefined offse...', '/Users/woodstre...', 597)
#1 laravel/helpers.php(597): Laravel\{closure}(8, 'Undefined offse...', '/Users/woodstre...', 597, Array)
#2 bundles/console/models/console.php(34): get_file_size(0)
#3 bundles/console/controllers/console.php(55): Console::execute('echo '';')
#4 [internal function]: Console_Console_Controller->post_execute()
#5 laravel/routing/controller.php(325): call_user_func_array(Array, Array)
#6 laravel/routing/controller.php(285): Laravel\Routing\Controller->response('execute', Array)
#7 laravel/routing/controller.php(165): Laravel\Routing\Controller->execute('execute', Array)
#8 laravel/routing/route.php(153): Laravel\Routing\Controller::call('console::consol...', Array)
#9 laravel/routing/route.php(124): Laravel\Routing\Route->response()
#10 laravel/laravel.php(167): Laravel\Routing\Route->call()
#11 public/index.php(34): require('/Users/woodstre...')
#12 {main}
Perhaps just show an empty output region, or an "(no output)" message?
Add a feature to bookmark the query builder. please
I understand the reason to have whitelist location, however Scribe bundle for example use filter as an easy authentication middleware to authenticate everything that route to console.
OSX 10.6.8
Apache 2.2.22
PHP 5.3.15
When I direct my browser to /console
I receive the following exception:
Unhandled Exception
Message:
Call to undefined method Console::attach()
Location:
/Users/woodstreet/Sites/star-communities/bundles/console/start.php on line 42
To work around this (for the time being), I just mapped the class by hand. So something is going on with Autoloading this class.
Autoloader::map(array(
'Console' => Bundle::path('console') . 'models/console.php',
));
I think it would be cool if the console had tabs, I mean like maybe 4 to 8, because sometimes you simply need a second console before you can delete the first.
When I click execute after entering code, I get this error:
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"syntax error, unexpected '\"', expecting T_STRING","file":"\/Users\/user\/www\/project\/vendor\/darsain\/laravel-console\/src\/Darsain\/Console\/Console.php(111) : eval()'d code","line":1}}
After adding stripslashes() to the $code var method before eval(), the error goes away
I'm running Laravel on MacOS Mavericks, PHP 5.3 on MAMP
Hi Darsain:
Thanks for this bundle. I really like it and always use it when I test model.
I just wondering is there any way I can add Laravel profiler to console, So I can see my query, log, time, etc.
Mark
Hi
I just wanted to notify that some time ago I forked this package and created standalone alternative (standalone means that can be used with any framework or with vanilla PHP). The general functionality and appearance of this application stayed the same, but I improved a lot and added some other functionality. I just released version 1.0.0.
Link to repository: https://github.com/meebio/php-eval-console
I would like to reduce the editor (and display) font size if possible. I am sure I can find out where to hack this stuff out (probably in a css somewhere) but just curious if there was an exposed method for doing this?
If not, I can surely hack around and find out where to do it (heck, maybe even enhance to make this possible for others)
Catching all error types in this environment is just a nightmare.
Console needs to catch an error, put it into a profile with:
$profile = Darsain\Console\Console::getProfile(array(
'error' => $error
));
And return the $profile
object as JSON back to the client with 200 Status Code.
I was just not able to accomplish that. Barely kept my legs from breaking from all the logs thrown at them.
Error types to catch and properly handle:
The core files responsible for execution are (really simple, just 2 classes with a couple of methods):
It seems like this can't be used with Homestead. I think that it is because console restricts access only to 127.0.0.1/::1, but I can't find anything about how to edit the config without editing files in the vendor folder. This was working before I was using Homestead.
I have NotFoundHttpException on /console with https://github.com/andrewelkins/Laravel-4-Bootstrap-Starter-Site
I get this error when running
php artisan migrate:refresh --seed
{"error":{"type":"ErrorException","message":"PDO::quote() expects parameter 1 to be string, object given","file":"/home/dd/project/vendor/darsain/console/src/models/console.php","line":44}}
The login process throws an error with Sentry and Console
https://github.com/cartalyst/sentry
This error dissapears when you remove this line in your app.php
'Darsain\Console\ConsoleServiceProvider',
"error":{"type":"ErrorException","message":"PDO::quote() expects parameter 1 to be string, object given","file":"vendor\\darsain\\console\\src\\models\\console.php","line":44}}
I am using Laravel 4.1.* and installed the console.
Routes not working out of the box. I have to copy them to route.php file.
Moving away from silly jQuery and into a proper app architecture.
artisan installer points to a dead link ( http://nodeload.github.com/Darsain/laravel-console/zipball/master )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.