roboroads / laravel-tinker Goto Github PK
View Code? Open in Web Editor NEWAdds a way to write php and run it directly in Laravels' Artisan Tinker.
License: Apache License 2.0
Adds a way to write php and run it directly in Laravels' Artisan Tinker.
License: Apache License 2.0
The plugin is incompatible with 2021.1
Bug description
Since the last update, all tinker sessions fails with the following error:
zsh:cd:1: no such file or directory: /Users/jesperbjerke/Dropbox/www/homestead/xxx
Warning: require(/home/vagrant/vendor/autoload.php): failed to open stream: No such file or directory in Command line code on line 7
PHP Warning: require(/home/vagrant/vendor/autoload.php): failed to open stream: No such file or directory in Command line code on line 7
Fatal error: require(): Failed opening required '/home/vagrant/vendor/autoload.php' (include_path='.:/usr/share/php') in Command line code on line 7
PHP Fatal error: require(): Failed opening required '/home/vagrant/vendor/autoload.php' (include_path='.:/usr/share/php') in Command line code on line 7
I am using a remote PHP interpreter through Laravel Homestead. Everything worked perfectly before the last update.
To Reproduce
Setup a Remote PHP interpreter and run any type of code through tinker. Fails even with just echo 'test';
Environment (please complete the following information):
Bug description
See title
To Reproduce
Install plugin, run tinker before restarting
Expected behavior
Should have the IDE style inheritted
Bug description
After having just upgraded to v2.0.1, I'm finding that the Laravel Tinker plugin will sometimes run code from a previous Tinker Console
To Reproduce
Expected behavior
Tinker Output would show output from console in step 5
Screenshots
Screenshot
Environment (please complete the following information):
Additional context
This started happening after upgrade to v2.0.1 of plugin
Bug description
I`m using XDebug but i cant debug using tinker plugin. Anyone?
Environment:
// Laravel Tinker started at 2020-09-04 11:18:43
PHP Fatal error: Uncaught Error: Class 'Laravel\Tinker\ClassAliasAutoloader' not found in Command line code:38
Stack trace:
#0 {main}
thrown in Command line code on line 38
[Symfony\Component\Debug\Exception\FatalErrorException]
Uncaught Error: Class 'Laravel\Tinker\ClassAliasAutoloader' not found in Command line code:38
Stack trace:
#0 {main}
thrown
*** Execution finished ***
Mostly though, I really love this plugin, thank you for making it. π
Bug description
shows a progress but not output result in right window of tinker
To Reproduce
when running code via docker, it is just try up container that I set in settings of php interpretuere
Environment (please complete the following information):
Is your feature request related to a problem? Please describe.
Currently, all statements in the tinker console are executed when the run button is clicked or the shortcut key's activated. I most often use tinker when exploring possibilities and debugging a command. Sometimes there a sequence of steps before that to load initial conditions. When in the artisan console, the results of previous statements are generally stored in variables that are used in later steps. So in artisan console while developing a line (perhaps a complex query builder) I only need to modify and retry that one line instead of re-execute all lines.
Describe the solution you'd like
One solution would be to feature multiple run buttons in the left hand gutter, one per statement. This would be similar to how PHPStorm presents PHPUnit tests, where you can execute tests individually.
PHPStorm also uses this technique in the http client (file->new->http request). The HTTP client separates individual requests with a '###' line. A similar idea could be used in this tinker plugin to separate groups of statements that we might want to rerun collectively. For example, sometimes I am working on a database query and then processing the collection it returns. As I modify the query I also need to rerun the collection.
Describe alternatives you've considered
An alternative would be the technique that PHPStorm uses for database consoles. you select which sql you want to execute by cursor position for a single statement or by highlighting multiple statements, and then press the execute button to run that selection
Like the title says, everytime I use the plugin a null file is generated in my untracked files.
But it will :)
It - for now - only works when you select a local interpreter. The error is extremely unclear as well.
Bug description
Plugin can't see LARAVEL_START constant declared in "artisan" script.
To Reproduce
<?php echo LARAVEL_START;
in tinker console.
Expected behavior
LARAVEL_START is predefined Laravel constant and should be visible by the plugin console (it works in artisan tinker BTW).
Environment
Bug description
See title.
To Reproduce
echo mt_rand(1, 100);
Expected behavior
I would expect the code from my console window (which was already open, just not in focus) to be run again.
What actually happens
Instead, a new console window is opened.
Is your feature request related to a problem? Please describe.
If the output contains a long string, you have to scroll. There's no line wrapping option.
Describe the solution you'd like
A line wrap option
Copied from this issue by BazMaster
Roboroads said:
I've been trying to do that but for some reason it's really hard to do. I could use some help with that from someone that has actual experience with Swing.
Bug description
Plugin is reusing same console for all projects (getting other projects snippets in new project)
Also getting an IDE error
To Reproduce
Opened tinker console in new project
Expected behavior
Create separate console for each project
Environment
Hi. I get an error with the message below, every time I execute a code in Tinker console. It doesn't matter what the statement is.
Uncaught ErrorException: touch(): Utime failed: Invalid argument in D:\www\mosharekat-laravel\vendor\psy\psysh\src\ConfigPaths.php:250
I've attached full error text as a text file for you.
error.txt
Environment:
I've also tried reinstalling the plugin, but it didn't help.
Is your feature request related to a problem? Please describe.
If using docker and having a separate container for the database and app it's may necessary to run tinker from inside of the app container
Describe the solution you'd like
provide a small configuration page to set up in which container tinker should run in.
Describe alternatives you've considered
none
Additional context
none
Greeting,
Thomas
Bug description
Trying to run the Tinker Console I've correctly configured my remote server instance and the needed php-instance. But when I try to run the code in the Tinker Console the console fails with the bellow messages, saying that "C:\Users\User\AppData\Roaming\JetBrains\PhpStorm2020.3\laravel-tinker\Tinker Console" don't exist. But when I open the same path through Windows Explorer the file exists in the path that the Tinker Console is trying to access...
To Reproduce
Installed Laravel Tinker plugin from PHPStorm->Settings->Plugins, configured it to connect to my remote Linux web server.
Expected behavior
I expect the Tinker Console to work or that the error should be different since the file exists in the path.
Screenshots
Added above.
PhpStorm 2020.3.2
Licensed to Webstina Global SL / Stellan Lindell
Subscription is active until March 11, 2021.
Runtime version: 11.0.9.1+11-b1145.77 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 8083M
Cores: 16
Registry: run.processes.with.pty=TRUE, ide.balloon.shadow.size=0
Non-Bundled Plugins: Key Promoter X, Realigner, String Manipulation, com.chrisrm.idea.MaterialThemeUI, com.intellij.plugins.visualstudiokeymap, com.intellij.plugins.vscodekeymap, com.jetbrains.CyanTheme, de.netnexus.camelcaseplugin, org.intellij.RegexpTester, com.aurimasniekis.phppsr4namespacedetector, de.espend.idea.laravel, nl.deschepers.laraveltinker, ru.adelf.idea.dotenv
Environment (please complete the following information):
Outputting a DB collection of 100+ rows makes it clear the output needs to be buffered a little. Looks like the IDE gets stuck processing all that text.
Is your feature request related to a problem? Please describe.
My patreons are receiving the "please support me" message eventhough they already do.
Describe the solution you'd like
Oauth-connect your patreon account so I can check if you are a parteon
Describe alternatives you've considered
Imported from JetBrains Plugin Repo review by Joao Alves
Is your feature request related to a problem? Please describe.
a shortcuts to close both windows at the same time
Describe the solution you'd like
a shortcuts to close both windows at the same time
The way you execute a statement in the Tinker console is very different from how similar plugins (e.g. Database console) does it.
Describe the solution you'd like
Phpstorm has a keybinding called "Execute Current Statement in Multiline Console". On Mac the default is CMD + Enter (I'm not sure about Windows/Linux). Pressing this keyboard shortcut should make Tinker console execute the code and show the result.
It just doesn't work when you do this, without knowing why.
Bug description
Write here a clear and concise description of what the bug is.
Tinker output does not show <
symbol unless wrapped with htmlentities('<')
To Reproduce
What did you do to encounter the bug?
echo '<'
echo '<tag>'
Expected behavior
If the description didn't make it clear enough, what should have happened?
<
printed
Environment (please complete the following information):
Additional context
It seems like output handled as HTML which is quite unexpected in case of Tinker usage.
Bug description
When loading a large file (something like 600KB of json), the terminal tinker loads it fine, but the plugin to PHPStorm freezes up and there is no way from inside the GUI to kill the process. How do I kill the window? It does not seem that killall -9 php
works. The only way to close this process is to close PHPStorm and reload completely.
To Reproduce
I loaded a 650KB 5 level nested JSON file, and it could not echo out the output.
Expected behavior
It should have displayed the JSON, or, display an error message if it was too large.
Environment (please complete the following information):
Additional context
I'm not sure if this is something wrong with my machine or not - or if it's a known bug.
Bug description
When running, in yet unknown conditions, an error occurs.
PHP Fatal Error: Uncaught Error: Object of class Illuminate\Foundation\Application could not be converted to string in Command line code:6
To Reproduce
Run a tinker console window
Expected behavior
The error should not have appeared and output following my code in
Screenshots
None
Environment (please complete the following information):
Additional context
It seems to work with docker run, but not with docker exec in one of my projects.
It would be awesome if it was possible to highlight a code snippet in a .php file, press ALT + Enter, and select "Execute in Tinker console".
I apologise for not solving issues right away. Please note that there are a couple of reasons why
I sometimes just don't know
I'm "fairly new" at Kotlin and the Jetbrains PHP plugin has no documentation at all. Sometimes it's just hard to wrap my head around why something does not work. Believe me if i've said that I tried. π
Niche feature requests
I will only implement a feature request myself if I would use the feature myself as well. In light of the project being open source, niche features you want implemented can be implemented by yourself - just make a PR, I will look at it <3
Money
I don't really make money with maintaining this plugin, so the work I do that makes me money gets ultimately priority 1. This makes that I don't always have time to work on this plugin. I'm sorry for that.
Issues going stale
When an issue got the stale label - please let me know by adding some activity to the issue. I will try to look back into it now it has gotten more recent attention.
Thankyou for supporting the project by spotting bugs!
The action "Start new Tinker console" is a bit misleading since it doesn't actually start a new console, but rather reuses the previous one.
The ability to create multiple Tinker console files (and name them) would be a really nice feature.
I don't know where the plugin currently stores the console content, but I suppose the most intuitive place would be in the IDEs "Scratches and Consoles".
Got an Exception on execution code with the tinker plugin.
[2020-09-15 14:11:51] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Error: Class 'Laravel\Tinker\ClassAliasAutoloader' not found in Command line code:37
Stack trace:
#0 {main}
thrown in Command line code:37
Stack trace:
#0 /home/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(133): Symfony\Component\Debug\Exception\FatalErrorException->__construct()
#1 /home/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(119): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError()
#2 /home/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(0): Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#3 {main} {"environment":"local","route":null,"ip":"127.0.0.1","url":"cli"}
Environment:
Hello, and thank you for an excellent plugin!
Bug description
Changes in files not always recognized by tinker.
To Reproduce
Make some changes to a file (outside of Tinker Console) and run Laravel Tinker before files are automatically saved to disk.
Expected behavior
Run tinker after all virutal files are saved to disk. Manually force saving files with CMD+S in PHP Storm before running seems to fix this.
Environment (please complete the following information):
Additional context
First off, I can't 100% tell for sure if this is caused by IntelliJ not saving files immediately (or fast enough) to disk, but I do know IntelliJ stores changes in memory to 'virtual files' before saving to disk. That's why I suspect this is the issue, and also since force saving (CMD+S) solves the issue. I could be completely wrong though :)
Is it possible to ensure all files are saved to disk before running tinker?
Again, thanks!
Is your feature request related to a problem? Please describe.
I don't prefer use mouse while coding. I think most people don't
Describe the solution you'd like
a shortcut to run the code
Bug description
Smart action overwrites the already opened/first file
To Reproduce
Open tinker with smart action, type in some code, switch tab, reopen the tab with smart action, typed stuff is gone.
Expected behavior
Just switch back to the tab, don't overwrite it.
Environment (please complete the following information):
Tinker plugin v2.0.0
Additional info
WORKAROUND When this happens, you can immediatly cmd/ctrl-z to undo the overwrite.
Is your feature request related to a problem? Please describe.
I think that the messages // Laravel Tinker started at...
and *** Execution finished ***
are to much in the way...
Describe the solution you'd like
remove the message or at least make it configurable
Describe alternatives you've considered
Move the messages to the bottom/right side or outside of the window
Bug description
Plugin causes errors every ms and slows down entire ide (analyzing... never ends etc.)
when I disable the plugin there are no errors, reenable the plugin the errors reappear
Logs
2021-04-27 10:59:50,304 [ 328304] ERROR - ij.psi.impl.source.PsiFileImpl - PhpStorm 2021.1.1 Build #PS-211.7036.8
2021-04-27 10:59:50,304 [ 328304] ERROR - ij.psi.impl.source.PsiFileImpl - JDK: 11.0.10; VM: Dynamic Code Evolution 64-Bit Server VM; Vendor: JetBrains s.r.o.
2021-04-27 10:59:50,304 [ 328304] ERROR - ij.psi.impl.source.PsiFileImpl - OS: Windows 10
2021-04-27 10:59:50,304 [ 328304] ERROR - ij.psi.impl.source.PsiFileImpl - Last Action: ShowSettings
2021-04-27 10:59:50,304 [ 328304] ERROR - ij.psi.impl.source.PsiFileImpl - readOrBuilt roots = {PhpFileStubImpl Language: PHP}; , stubBindingRoot = PhpFileImpl, languages = [PHP, HTML], fileTypes = [PHP, HTML], files = [PhpFileImpl, HtmlFileImpl], roots = [(php.FILE, Language: PHP -> PhpFileImpl), (FILE, Language: HTML -> HtmlFileImpl)]
java.lang.Throwable: readOrBuilt roots = {PhpFileStubImpl Language: PHP}; , stubBindingRoot = PhpFileImpl, languages = [PHP, HTML], fileTypes = [PHP, HTML], files = [PhpFileImpl, HtmlFileImpl], roots = [(php.FILE, Language: PHP -> PhpFileImpl), (FILE, Language: HTML -> HtmlFileImpl)]
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.psi.impl.source.PsiFileImpl.getStubTree(PsiFileImpl.java:648)
at com.intellij.psi.impl.source.PsiFileImpl.getGreenStubTree(PsiFileImpl.java:952)
at com.jetbrains.php.lang.psi.PhpFileImpl$2.compute(PhpFileImpl.java:81)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:43)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.jetbrains.php.lang.psi.PhpFileImpl.getTopLevelDefs(PhpFileImpl.java:217)
at com.jetbrains.php.lang.psi.PhpPsiUtil.findClasses(PhpPsiUtil.java:516)
at com.jetbrains.php.lang.psi.PhpPsiUtil.findAllClasses(PhpPsiUtil.java:530)
at com.jetbrains.php.projectView.PhpFileNode.getClasses(PhpFileNode.java:35)
at com.jetbrains.php.projectView.PhpFileNode.isDeprecated(PhpFileNode.java:60)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.lambda$doUpdate$1(AbstractPsiBasedNode.java:160)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:814)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.doUpdate(AbstractPsiBasedNode.java:141)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.lambda$update$0(AbstractPsiBasedNode.java:137)
at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:174)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:132)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:121)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:111)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.update(AbstractPsiBasedNode.java:137)
at com.intellij.ide.util.treeView.PresentableNodeDescriptor.getUpdatedPresentation(PresentableNodeDescriptor.java:76)
at com.intellij.ide.util.treeView.PresentableNodeDescriptor.update(PresentableNodeDescriptor.java:29)
at com.intellij.ui.tree.StructureTreeModel$Node.update(StructureTreeModel.java:454)
at com.intellij.ui.tree.StructureTreeModel$Node.<init>(StructureTreeModel.java:435)
at com.intellij.ui.tree.StructureTreeModel$Node.<init>(StructureTreeModel.java:428)
at com.intellij.ui.tree.StructureTreeModel.getValidChildren(StructureTreeModel.java:389)
at com.intellij.ui.tree.StructureTreeModel.validateChildren(StructureTreeModel.java:298)
at com.intellij.ui.tree.StructureTreeModel$Node.isLeaf(StructureTreeModel.java:558)
at com.intellij.ui.tree.StructureTreeModel.isLeaf(StructureTreeModel.java:334)
at com.intellij.ui.tree.LeafState.get(LeafState.java:64)
at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.load(AsyncTreeModel.java:574)
at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:547)
at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:440)
at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:406)
at com.intellij.util.concurrency.Invoker$Task.run(Invoker.java:316)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:79)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:157)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:119)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:57)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:57)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:116)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:79)
at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:205)
at com.intellij.util.concurrency.Invoker.lambda$offerSafely$0(Invoker.java:183)
at com.intellij.util.concurrency.Invoker$Background.lambda$offer$0(Invoker.java:541)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:220)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:216)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:27)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:195)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:184)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)
To Reproduce
Enable plugin
Environment (please complete the following information):
Bug description
PHP Fatal error: Class 'App/Models/Link' not found in Psy Shell code on line 4
To Reproduce
I have Laravel located not in the root folder of the site, but in a subfolder. In one PhpStorm project, I have several Laravel sites.
It would be good to specify a path or several paths to the Laravel root folder in the settings.
Now this plugin is useless for me, unfortunately.
Environment (please complete the following information):
Hello, can we make it work with the LumenοΌ
Please add the possibility to open tinker with params like --env or any other custom param
Restarting the console deletes the code that was in it. I'm creating a cache that rembers the last thing you executed.
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.