Subscribe

How to view Drupal7 Blobs in phpmyadmin

  1. 2011-02-12 18:36:49 PST
    Hi, Drupal 7 now uses blobs to store much of it's configuration information. This config info is serialised php data. I found: $cfg['ProtectBinary'] = FALSE; Which displays the blobs as: 733a31333a227465737440746573742e636f6d223b But what I really want to see is the de-hexed version: s:13:"test@test.com"; What's the best way to do this? I am unable to alter the schema as, like phpmyadmin, it's an open-source project with alot of contributers and I couldn't build enough consensus. Thanks, Mike
  2. 2011-02-12 20:30:44 PST
    I tried for quite a few minutes to find the code to create a drupal 7 database, but it seems to me it's built in to the PHP code and I'd have to go through the whole installer, which is a bit much for me tonight. But it seems to me this is probably a good use of a phpMyAdmin transformation. You can read about them at http://www.phpmyadmin.net/documentation/Documentation.html#transformations.
  3. 2011-03-11 20:38:16 PST
    Hi ibennetch, I didn't get an email for your response, so sorry it took so long to get back to you. Thanks for commenting back. I made a copy of the schema here: http://www.michaelcole.com/sites/default/files/example_dev.sql.zip You're right that it's generated through php code. And the core system creates tables on the fly to add "fields" to new content types. This is a major feature for Drupal. These tables are named based on user data, so they would be unpredictable to setup before hand. I'm using the 3.3.7 version of phpmyadmin, and I'd guess that the project is used by 500-1000 developers. (http://drupal.org/project/quickstart) For the blob, I tried setting the MIME type to text/plain, but this didn't show up. Using $cfg['ProtectBinary'] = FALSE; I can get the hex data on the detail page, but the real win is to get the unhexed data on the list page. Is there a way to use a transformation globally on all blobs? Thanks, Mike
  4. 2011-03-12 03:13:29 PST
    When you browse a table, you get an Options link. Did you try clicking it and untikcing the "Show binary contents as HEX" option?
  5. 2011-03-12 13:59:06 PST
    Hi lem9, Yes! This worked great. Now I can see and edit the data on the detail form. I used this: echo "\$cfg['ProtectBinary'] = false;" | sudo tee -a /etc/phpmyadmin/config.inc.php echo "\$cfg['DisplayBinaryAsHex'] = false;" | sudo tee -a /etc/phpmyadmin/config.inc.php Is there a way to get a summary of the blob on the "browse" page? Thanks! Mike
  6. 2011-03-14 04:57:30 PDT
    Please give an example for "summary of the blob".
  7. 2011-03-14 09:27:40 PDT
    Hi Lem9, Below is an example. The problem is that Drupal7 stores serialized php data into blob fields. Developers and admins will want to "see" whats in those fields for debugging. Having this available in the "browse table" view saves a click, and gives awareness of the unexpected when browsing: "Wait, why is it set to *that*?" By default on Ubuntu, the blobs are all locked up. With the config changes above, the data is available on the row detail page. Here is an example of making it available on the "browse table" page: Current browse table list on "cache_update" table: Edit Delete fetch_task::drupal [BLOB - 0B] 0 1295545751 0 Edit Delete update_project_projects [BLOB - 1.2KiB] 1295549351 1295545751 1 ... Blob summary table list: (note the blob data is truncated for first 10 or so characters) Edit Delete fetch_task::drupal [BLOB - 0B] 0 1295545751 0 Edit Delete update_project_projects a:1:{s:6:"drup 1295549351 1295545751 1 ... Current browse table list on "variable" table - used to store random config variables: Edit Delete admin_theme [BLOB - 12B] Edit Delete clean_url [BLOB - 8B] Edit Delete comment_page [BLOB - 4B] Edit Delete cron_key [BLOB - 51B] Edit Delete cron_last [BLOB - 13B] Edit Delete css_js_query_string [BLOB - 13B] Edit Delete date_default_timezone [BLOB - 23B] Edit Delete file_temporary_path [BLOB - 11B] Edit Delete filter_fallback_format [BLOB - 18B] ... Blob summary table list: Edit Delete admin_theme s:5:"seven"; Edit Delete clean_url s:1:"1"; Edit Delete comment_page i:0; Edit Delete cron_key s:43:"WfNgFkDq0vrfu1OssF9xKHyGCx5KpyS3btUiZa70eAU"; Edit Delete cron_last i:1295545751; Edit Delete css_js_query_string s:6:"lfc1hz"; Edit Delete date_default_timezone s:15:"America/Chicago"; Edit Delete file_temporary_path s:4:"/tmp"; Edit Delete filter_fallback_format s:10:"plain_text"; ... I hope the formatting comes out ok. Thanks for taking a look. What do you think?
  8. 2011-03-14 09:49:07 PDT
    In the display options, are you with "partial texts" or "full texts" ?
  9. 2011-03-14 12:25:11 PDT
    Hi Lem9, I'm using "Partial Texts", as this is the default. After playing with it, if I enable "Show BLOB contents", I get almost exactly what I'm looking for. Is there a config value for this to make it the default selection? Through some grepping, it appears it's coded to default to "false" on in ./libraries/display_tbl.lib.php on line 597. But somehow it seems the default is per table. I didn't fully understand this. Is this a possible feature for the next version? Or is it already in? I'm using Ubuntu's 3.3.7deb5build0.10.10.1 E.g. In the config file: $cfg['browse_defaults']['ShowBLOBContents'] = true; ... I came up with a hack for this in my config file, to turn this on permanently (overriding the options): $_REQUEST['display_blob'] = true; Thanks again for the help Lem9, Mike
Jump To:
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.