Created
September 6, 2013 18:40
-
-
Save mpezzi/6468134 to your computer and use it in GitHub Desktop.
Find corrupt values in variable table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = db_select('variable', 'v') | |
->fields('v', array('name', 'value')) | |
->orderBy('name', 'ASC') | |
->execute() | |
->fetchAll(); | |
$rows = array(); | |
foreach ($result as $row) { | |
$value = @unserialize($row->value); | |
if ($value === FALSE && $row->value != serialize(FALSE)) { | |
$rows[$row->name] = array('name' => $row->name, 'value' => $row->value); | |
} | |
} | |
dpm($rows); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment