Giter VIP home page Giter VIP logo

Comments (19)

indigoxela avatar indigoxela commented on July 23, 2024 1

I think the bee_format_date helper function is a sensible extra...

Phew... I wasn't 100% sure, if that's the case (would have reverted it to inline code then). 😄

One suggestion I have is theme_debug...

I've just added that... after a little head scratching I put it near error_display - I think these both are settings you wouldn't want to be turned on on production sites. But we can move that around as needed.

is it mostly the case that PHP CLI is the same version as the web version...

Not really, but I don't know of any trick to get the http information from command line (drush doesn't do that, either - also displays cli). Via web frontend the php version should never be exposed. If your hoster does somehow - switch hosting. 😁

from bee.

indigoxela avatar indigoxela commented on July 23, 2024 1

... can you point to the relevant bits and explain how it's doing it?

Instead of manually including settings.php, I switched to global $settings, $config_directories;, as backdrop_settings_initialize() has already run (see includes/miscellaneous.inc / bee_initialize_console()).

The way I did it before (not using the globals, but including settings.php) war wrong, as it didn't properly initialize the overridden values (all config values can be overridden via settings.php).

from bee.

BWPanda avatar BWPanda commented on July 23, 2024

Also, here's the info from the same Drupal installation as above, but run from outside of the site directory (i.e. the above was run from within the site dir):

Drupal version
PHP configuration
PHP OS
Drush script
Drush version
Drush temp directory
Drush configuration
Drush alias files
Drupal root
Drupal Settings File

Much less info (because the site-specific info isn't available), but it still gives generic Drupal info at least.

In Backdrop no info is given at all outside a site directory. I'm sure we can improve that too.

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

I started to enhance "b st".

What other information could be interesting?

from bee.

BWPanda avatar BWPanda commented on July 23, 2024

I think #96 will be handy here as then we'll know when to provide information about the site itself (as opposed to generic Backdrop info).

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

I think #96 will be handy here

I agree. And we could probably grab interesting states info (via state_get()).
For instance update_last_check or install_time.

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

I'll close my PR as I see no chance that it can get merged.

from bee.

klonos avatar klonos commented on July 23, 2024

@indigoxela care to elaborate on your last comment here please? Are you frustrated that it took long for people to review your code and provide feedback, or have things changed that your PR does no longer apply.

Regardless, and as general feedback on this thread, I think that at the very minimum we should be reporting php version (which is what drove me here TBH) and bee version.

Also, I don't see any real value in this line of the output:

Database password   ********** 

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

@klonos there wasn't much interest for more than two years, and now the patch doesn't apply anymore, anyway.

I think that at the very minimum we should be reporting php version (which is what drove me here TBH) and bee version.

    $rows[] = array(
      array('value' => bt('PHP version')),
      array('value' => PHP_VERSION),
    );

I don't think that bee has versions, yet.

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

Here we go, yet another PR: #219

Sample output:

 Backdrop CMS           1.23.0                               
 Root directory         /var/www/crashburn/html              
 Site type              Single                               
 Database               mysql                                
 Database name          bd_crashburn                         
 Database username      bd_crashburn                         
 Database password      **********                           
 Database host          127.0.0.1                            
 Database port                                               
 Cron last run          2022-10-20 09:48:01 CEST             
 Install time           2022-07-21 10:14:28 CEST             
 Maintenance mode       off                                  
 Update last check      2022-10-19 19:48:06 CEST             
 Settings.php path      /var/www/crashburn/html/settings.php 
 Drupal compatibility   on                                   
 Config dir active      /var/www/crashburn/bd-config/active  
 Config dir staging     /var/www/crashburn/bd-config/staging 
 Site name              My crashburn site                   
 Default theme          basis                                
 Admin theme            seven                                
 Public files path      /var/www/crashburn/html/files        
 Private files path     /var/www/crashburn/privatefiles      
 Temporary files path   /tmp                                 
 Preprocess CSS         on                                   
 Preprocess JS          off                                  
 Theme debug            off                                  
 Error display level    all                                  
 PHP cli version        8.1.11                               
 PHP ini path           /etc/php/8.1/cli/php.ini

^^ we triple the information. 😉

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

Also, I don't see any real value in this line of the output:

@klonos that's hidden by default for security reasons, you can display the pw value with a param bee st --show-password

from bee.

yorkshire-pudding avatar yorkshire-pudding commented on July 23, 2024

Thanks @indigoxela - this looks great. I think the bee_format_date helper function is a sensible extra that enhances this and is available to use elsewhere.
Bee version - there is a separate issue for this (#203) and it would probably make sense to add in here when we start doing releases (@ElusiveMind - FYI)
One suggestion I have is theme_debug; it would probably make sense near preprocess CSS or underneath the themes but open to other suggestions.

Just wondering, is it mostly the case that PHP CLI is the same version as the web version. Are there many places where they might be different and if so, would it be possible to get the PHP version in use on the web front end?

from bee.

yorkshire-pudding avatar yorkshire-pudding commented on July 23, 2024

Thanks @indigoxela - this looks really good. @klonos - any further thoughts?

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

Some Office Hours outcome:

  • We show absolute paths (our conclusion: that's OK) (/path/to/private/files instead of ../files). That's easier to understand, especially when running bee from outside the install
  • More feedback re the new bee_format_date() helper function would be great. What's the output on your dev? (We already had a Debian Linux and a Lando output example.)

Note: The intention of the new helper is to require no bootstrap level at all to display a timestamp in a readable way - the B format_date() function would require us to raise the bootstrap level for the status command (and that makes no sense for just outputting a date).

More feedback on the values and eventually redundant or missing info would be cool, too. That could eventually go into a follow-up for quicker progress.

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

Oh, dang, back to "needs work" - I just realized that reading only the config isn't sufficient, as that ignores overridden values from settings.php. So we have to raise the bootstrap level.

from bee.

yorkshire-pudding avatar yorkshire-pudding commented on July 23, 2024

Well spotted @indigoxela - I hadn't thought of that.

from bee.

indigoxela avatar indigoxela commented on July 23, 2024

Fixed. I verified with an overridden "site_name" value in settings.php.

Raising the bootstrap level is counter-productive, as we end up with empty settings - we ran into that problem before. It's caused by the require_once in core's backdrop_settings_initialize().

from bee.

yorkshire-pudding avatar yorkshire-pudding commented on July 23, 2024

Thanks @indigoxela - I've tested and it works with config override. I'm looked at the code, but I can't quite work out which bit is doing this clever bit. For my benefit (not that there is anything wrong, just I don't fully understand it), please can you point to the relevant bits and explain how it's doing it?

from bee.

yorkshire-pudding avatar yorkshire-pudding commented on July 23, 2024

Thank you @indigoxela - this is a really great improvement to the usefulness of this function.

from bee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.