Skip to content

Instantly share code, notes, and snippets.

@philwinkle
Last active December 19, 2015 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philwinkle/6000650 to your computer and use it in GitHub Desktop.
Save philwinkle/6000650 to your computer and use it in GitHub Desktop.
Update using Zend_Feed_Rss
<?php
require_once 'app/Mage.php';
Mage::app();
$xml = new Zend_Feed_Rss('https://my.pingdom.com/probes/feed');
$debugIps = Mage::getStoreConfig('dev/restrict/allow_ips');
if($debugIps) {
$string = $debugIps.",";
} else {
$string = null;
}
foreach($xml->channel->item as $item) {
$parts = explode(";",$item->description);
$ip = trim(substr($parts[0],4));
$string .= $ip . ",";
}
$config = Mage::getModel('core/config');
$config->saveConfig('dev/restrict/allow_ips',$string);
echo "Debug IP list updated to ".$string."\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment