Skip to content

Instantly share code, notes, and snippets.

@shaneharter
Created December 18, 2012 22:48
Show Gist options
  • Save shaneharter/4332807 to your computer and use it in GitHub Desktop.
Save shaneharter/4332807 to your computer and use it in GitHub Desktop.
<?php
ini_set('display_errors', 1);
require_once 'include/local.conf';
require_once (COMMON_INCLUDE_PATH.'email/EmailTypes.php');
$mutex = sem_get(ftok(__file__, 'D'), 1, 0666, 1);
register_shutdown_function(function() use($mutex) {
@sem_release($mutex);
});
foreach (glob("/data/home/shane/public_html/email/include/email/handlers/*.php") as $filename) {
$class = str_replace('.php', '', basename($filename));
$pid = pcntl_fork();
if ($pid == 0) {
sem_acquire($mutex);
echo PHP_EOL;
echo str_repeat("=", 100);
echo PHP_EOL;
echo "$class...";
require_once $filename;
$o = new $class();
echo "Success!";
die();
}
}
echo PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment