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 | |
class AWSV4 { | |
private $accessKeyID = null; | |
private $secretAccessKey = null; | |
private $regionName = null; | |
private $serviceName = null; | |
private $httpMethodName = null; | |
private $canonicalURI = "/"; |
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 | |
add_action( 'http_api_debug', 'viper_http_api_debug', 10, 5 ); | |
public function viper_http_api_debug( $response, $type, $class, $args, $url ) { | |
$output = 'Request URL: ' . var_export( $url, true ); | |
$output .= 'Request Args: ' . var_export( $args, true ); | |
$output .= 'Request Response : ' . var_export( $response, true ); | |
echo $output; |
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 | |
$dir = "C:\\"; | |
$start = microtime(true); | |
function recursive_readdir($dir) { | |
$dh = opendir($dir); | |
while (false !== ($filename = readdir($dh))) { | |
if ($filename != '.' && $filename != '..') { | |
if (is_dir($dir . $filename)) { |
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 | |
$dir = "C:\\temp\\"; | |
$start = microtime(true); | |
function recursive_readdir($dir) { | |
$dh = opendir($dir); | |
while (false !== ($filename = readdir($dh))) { | |
if ($filename != '.' && $filename != '..') { |
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 | |
$i = 0; | |
while (true) { | |
echo $i . " abc \n"; | |
time_sleep_until( time() + 10); | |
$i++; | |
} |
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 | |
<?php | |
abstract class Ai1ec_Event_Callback_Abstract { | |
protected $_registry = null; | |
protected $_registry_name = null; | |
protected $_method = null; | |
public function __construct( |
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 | |
class Ai1ec_Event_Dispatcher { | |
public function register( | |
$hook, | |
Ai1ec_Event_Callback_Abstract $entity, | |
$priority = 10, | |
$accepted_args = 1 | |
) { |
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
class Ai1ec_Event_Dispatcher { | |
public function register( | |
$hook, | |
Ai1ec_Event_Callback_Abstract $entity, | |
$priority = 10, | |
$accepted_args = 1 | |
) { | |
if ($entity instanceof Ai1ec_Event_Callback_Filter) { |
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 | |
$dispatcher = new Ai1ec_Event_Dispatcher(); | |
$callback_filter = new Ai1ec_Event_Callback_Filter( $this->_registry, 'model.settings', 'modify2' ); | |
$dispatcher->register( 'title', $callback_filter, 19, 2 ); | |
$callback_filter2 = new Ai1ec_Event_Callback_Filter( $this->_registry, 'model.settings', 'modify' ); | |
$dispatcher->register( 'title', $callback_filter2, 17, 2 ); |
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 | |
$callback = new Ai1ec_Core_Callback( $this->_registry, 'model.settings', 'test' ); | |
$dispatcher = new Ai1ec_Core_Dispatcher(); | |
$dispatcher->register('my-custom-action', $callback, 10, 2); | |
do_action('my-custom-action', 100, 200); |
NewerOlder