Created
December 18, 2012 22:48
-
-
Save shaneharter/4332807 to your computer and use it in GitHub Desktop.
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 | |
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