bernhard Posted November 3, 2024 Author Posted November 3, 2024 RockShell v3.4.0 Added PR #16 from lemachinarbo that improves host checking to support different ports and DDEV env variables; Thank you! 🚀 Added module:create command Added module:install command
bernhard Posted November 8, 2024 Author Posted November 8, 2024 Please update to v3.4.1 which updates dependencies because of this security issue with symfony/process: Quote Symfony vulnerable to command execution hijack on Windows with Process class
bernhard Posted January 21 Author Posted January 21 Please upgrade to v3.5.2 which updates all dependencies due to security updates: symfony/http-client CVE-2024-50342 Low severity nesbot/carbon CVE-2025-22145 Moderate severity
Jonathan Lahijani Posted May 1 Posted May 1 @bernhard Somewhere in my codebase, an exception is occurring. It's not rockshell specific, but I'm using rockshell to run a background job and at some point this exception occurs. However, the exception details are very minimal in rockshell's output (just a simple line) which doesn't give me enough information me to track it down. I would think the exception would get placed in ProcessWire's own logs, but it doesn't. Any thoughts on how I can get the exceptions to get logged to help me debug?
bernhard Posted May 1 Author Posted May 1 Hey @Jonathan Lahijani what you provide to me might be even more vague than what RockShell provided to you 😉 So I don't have any idea so far. What is your exception that you see? What is that one line that you get from RockShell?
Jonathan Lahijani Posted May 1 Posted May 1 Basically, I'm running a rockshell command and I get this error due to a logic bug in my own code: Call to a member function getProduction() on null However because the error isn't really specific, I'm not sure where in my codebase that's exactly occurring (like which file and which line). It doesn't log it to ProcessWire's 'errors' log. If I run the same code that's inside my rockshell command "outside" of rockshell (using php on the command line), it will also error, but details about it like this: PHP Fatal error: Uncaught Error: Call to a member function getProduction() on null in /path/to/pw/site/classes/BlahPage.php:210 Stack trace: ... Is it possible to log errors to the error log?
bernhard Posted May 1 Author Posted May 1 2 minutes ago, Jonathan Lahijani said: Is it possible to log errors to the error log? I'm not sure, but I think so and that might be a good thing to add. Can you try to modify the rock.php file. There I catch any exceptions and only write the ->getMessage() output to the console. If you remove the try/catch, do you get more helpful output?
Jonathan Lahijani Posted May 1 Posted May 1 4 minutes ago, bernhard said: If you remove the try/catch, do you get more helpful output? That worked... I replaced the try/catch block with just $app->run(); The error appeared in the console and logged to 'errors' log. I wonder if it can be refactored a bit? Ideally I'd like to run try/catch in my own rockshell command, but with the current approach rockshell's try/catch will override it, right?
Jonathan Lahijani Posted June 3 Posted June 3 On 6/1/2025 at 7:57 AM, bernhard said: @Jonathan Lahijani just pushed this to v3.6.0 🙂 Thank you very much. This adjustment also fixes admin emails being sent when errors occur. Awesome! 1
bernhard Posted June 10 Author Posted June 10 RockShell currently uses the following composer.json file: { "require": { "illuminate/console": "^8.40", "illuminate/events": "^8.40", "symfony/browser-kit": "^5.4", "symfony/css-selector": "^5.4", "symfony/dom-crawler": "^5.4", "symfony/http-client": "^5.4", "symfony/mime": "^5.4" }, "autoload": { "files": [ "Application.php" ] }, "config": { "platform": { "php": "7.4.0" } } } I'm using PHP8.4 on my latest project and get many warnings like this: Quote PHP Deprecated: optional(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/RockShell/vendor/illuminate/support/helpers.php on line 184 So I thought just update dependencies... Turns out it's not that simple. "composer update" will only update to the listed versions, which are already quite dated. Any experienced composer users here @teppo @Jonathan Lahijani that know an easy way to do this? illuminate/console for example is version 12.17 at the moment.
Ivan Gretsky Posted June 10 Posted June 10 Not so fluent with composer. So consulted the docs. Seems like composer update --with-all-dependencies will do it. 1
bernhard Posted June 10 Author Posted June 10 Thx, already tried that, no luck. Also when updating dependencies manually which I already did I get some PHP errors 😞 Seems there is more to it, so if anybody wants to contribute his/her time and knowledge for this update it would be highly appreciated 🙂
Jonathan Lahijani Posted September 20 Posted September 20 @bernhard Is there a way for ProcessWire to know if it was executed from RockShell? Does RockShell leave some sort of signature that could be detected? Right now I'm working around this by putting this in the handle() method: $this->wire()->config->isRockShell = true; Somewhat related: Does it make sense to have RockShell put ProcessWire in CLI mode by default, because currently it doesn't do that and my assumption is that it would? Not sure of the pros/cons of doing that, but I'm assuming you given it some thought.
bernhard Posted September 20 Author Posted September 20 hi @Jonathan Lahijani I can't remember of any flag that I set, but there is $config->external that should be true when used from the cli, which is the case with rockshell. 1 hour ago, Jonathan Lahijani said: Somewhat related: Does it make sense to have RockShell put ProcessWire in CLI mode by default, because currently it doesn't do that and my assumption is that it would? Not sure of the pros/cons of doing that, but I'm assuming you given it some thought. What is "put PW in CLI mode?", I don't understand.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now