Created
November 12, 2014 16:25
-
-
Save fernandez14/0e49b1941e1d2e5a3b85 to your computer and use it in GitHub Desktop.
Forking curl process
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 | |
private function request($url, $payload) { | |
$cmd = "curl -X POST -H 'Content-Type: application/json'"; | |
$cmd.= " -d '" . $payload . "' " . "'" . $url . "'"; | |
if (!$this->debug()) { | |
$cmd .= " > /dev/null 2>&1 &"; | |
} | |
exec($cmd, $output, $exit); | |
return $exit == 0; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment