Skip to content

Instantly share code, notes, and snippets.

@brunsgaard
Created October 19, 2012 09:48
Show Gist options
  • Save brunsgaard/3917214 to your computer and use it in GitHub Desktop.
Save brunsgaard/3917214 to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
require_once 'intro.php';
$x = new GSB_Updater($storage, $network, $logger);
// get new chunks
$x->downloadData($gsblists, FALSE);
// zap outdated fullhash definitions (they are only good for 45m)
$storage->fullhash_delete_old();
<?php
error_reporting(-1);
ini_set('error_log', '/dev/stderr');
ini_set('max_execution_time', -1);
ini_set('memory_limit', -1);
date_default_timezone_set('UTC');
#define('BASE_DIR', str_replace('//','/',dirname(__FILE__)).'/');
set_include_path('.' . PATH_SEPARATOR . '../lib');
// turn off output buffering
//ob_end_flush();
require_once 'lib/GSB_Updater.php';
require_once 'lib/GSB_Request.php';
require_once 'GSB_Storage.php';
require_once 'GSB_Exception.php';
require_once 'GSB_Logger.php';
$api = 'ABQIAAAAMqZLBC2NVJWwikyKSAXBKBQWTqr7Y7-tVGpbcTnwRGDOjNXnlQ';
$gsblists = array('goog-malware-shavar', 'googpub-phish-shavar');
$dbh = new PDO('mysql:host=127.0.0.1;dbname=SiteBeak', 'root', '6xgj95ty');
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$storage = new GSB_Storage($dbh);
$network = new GSB_Request($api);
$logger = new GSB_Logger(5);
@brunsgaard
Copy link
Author

./bin-sample/update.php                                                                                                                                                    !42
[19-Oct-2012 09:49:13 UTC] PHP Warning:  require_once(GSB_Storage.php): failed to open stream: No such file or directory in /home/brunsgaard/gsb4ugc/bin-sample/intro.php on line 19
[19-Oct-2012 09:49:13 UTC] PHP Fatal error:  require_once(): Failed opening required 'GSB_Storage.php' (include_path='.:../lib') in /home/brunsgaard/gsb4ugc/bin-sample/intro.php on line 19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment