Installing and upgrading help

Ia there a command line version of the environment check?

Picture of Leon Stringer
Re: Ia there a command line version of the environment check?
Particularly helpful Moodlers

If you have SSH access back to your client (i.e. you're SSHing to one server then to another) and can thus scp a file back then this might work:

One Wget:

wget --save-cookies cookies.txt \
     --keep-session-cookies \
     --delete-after \

Then another Wget:

wget --load-cookies cookies.txt \
     --post-data 'username=admin&password=[ADMINPASSWORD]' \
     --output-document=environment.html \

This is based on a StackOverflow post and works in two steps because the first request for /admin/environment.php needs you to be a site admin and you're not logged in so it sets the session variable wantsurl to the requested page and redirects you to the login page. The second step sends credentials to the login page but includes the session cookie from the first response so the login page sees the wantsurl value and redirects you there. Wget responds to this redirect saving the resulting page to environment.html.

This depends on the server you run this on being able to resolve the site domain name and access itself on port 443 or 80.

Possibly a bit messier than you were hoping but it seems to work.

Average of ratings: Useful (2)
Picture of Ken Task
Re: Ia there a command line version of the environment check?
Particularly helpful Moodlers

Thanks, Leon!  A +20 ... and you are right ... 'a bit messier' is really an understatement. :\

Environment Check
pardon the rant but ...


Is one of the few if not the only 'component' that gets updated manually.
It is crucial to those with little admin experience to know if their server
meets specs when it comes to versions of things like PHP/MySQL, php extensions, etc..   How many times in forums have we seen posters who didn't check environment and are somewhere in la-la-land in attempts
to upgrade.   That is never a fun time to fix ... especially via forum exchange of information.  Wonder if those persons feel a little 'trapped' and a little resentful they might have to hire someone to fix it?

The files, environment.php and environment.xml do get updated on git updates/upgrades on point releases and on upgrades for sure.   But once that's done, newbie admins don't think to check it when they notice in noitications page they are multiple versions behind.  Besides that, there is the 'nag' that 'encourages' admins to keep their site up to date.
"It is strongly recommended that you update your site to the latest version to obtain all recent security and bug fixes."

For years, I have been manually editing language files to include a link to the environment checks from the Notifications page.  Most of the time, that edit stays ... sometimes it's gets wiped out and I have to put it in again.

And to add more ... environment check should have a CLI version of updating environment
check (a tool?) and/or just running it.

Ok ... end rant.

Think I'll attempt 'cli'zing' a copy of environment.php in admin/cli/ with the appropriate 'requires' to see if I can't get a difficult to read table via CLI that I could 'live' with. :\

Thanks, again Leon ... when I have a few hours will attempt to wrap feeble brain around that and try it out. smile

Hmmmm ... that's why I make the 'big bucks' ... right? (I'd rather not!) :\

'spirit of sharing', Ken

Average of ratings: -