public function run($params)
 {
     if (!C('IFRESH.IS_GEN')) {
         off('export_map_end', 'IframeRefreshPlugin::handleMap');
         off('write_build_file_start', 'IframeRefreshPlugin::addContent');
         off('process_js_start', 'IframeRefreshImport');
     }
 }
Beispiel #2
0
/**
 * Trigger only once.
 *
 * @param $event
 * @param callable $listener
 * @param int $priority
 */
function one($event, callable $listener, $priority = 10)
{
    $once = function () use(&$once, $event, $listener) {
        off($event, $once);
        return call_user_func_array($listener, func_get_args());
    };
    on($event, $once, $priority);
}
 public function dim($level)
 {
     $this->level = $level;
     if ($level == 0) {
         off();
     } else {
         println("Light is dimmed to " . $level . "%");
     }
 }
 public function run($params)
 {
     if (!$this->options['svnop.is_svn']) {
         off('process_end', 'SvnOperatorPlugin::ci');
         off('imerge_end', 'SvnOperatorPlugin::ciImerge');
         return;
     }
     self::ciImerge();
     self::svnUp();
 }
Beispiel #5
0
 public static function init()
 {
     if (!C('INCRE.IS_INCRE')) {
         off('process_start', 'IncreMap::init');
         off(array('css_import', 'css_background_change', 'js_import', 'js_replace', 'html_href_change'), 'IncreMap::update');
         off('process_end', 'IncreMap::export');
         return;
     }
     self::genMd5Map();
     self::genLatestRevision();
 }
 public function run($params)
 {
     if (!C('JCSS.IS_JCSS')) {
         off('processor_init', 'JCssParser');
         return;
     }
     $tool = $params[1];
     // 第1个参数是PreprocessTool对象
     $options = $params[2];
     // 第2个参数是配置信息
     $processor = $params[3];
     // 第3个参数是返回,将最后的预处理器对象赋给$processor->return
     // 判断当前是否在初始化CssPreprocess
     if ($options['processor'] === 'css') {
         $processor->return = new JCssPreprocess($tool->getMap(), $options);
         Preprocess::setInstance('CssPreprocess', $processor->return);
     }
 }
Beispiel #7
0
    $GLOBALS["CLASS_USERS"] = new usersMenus();
    $users = $GLOBALS["CLASS_USERS"];
} else {
    $users = $GLOBALS["CLASS_USERS"];
}
if ($_GET["function"] == "quicklinks_account") {
    quicklinks_account();
    exit;
}
if (!$GLOBALS["AS_ROOT"]) {
    if (!$users->AsAnAdministratorGeneric) {
        die("Not autorized");
    }
}
if (isset($_GET["off"])) {
    off();
    exit;
}
if (isset($_GET["squidcklinks-host-infos"])) {
    squidcklinks_host_infos();
    exit;
}
if (isset($_GET["RefreshMyIp"])) {
    RefreshMyIp();
    exit;
}
if (function_exists($_GET["function"])) {
    call_user_func($_GET["function"]);
    exit;
}
if (!$GLOBALS["AS_ROOT"]) {
if(isset($_GET["architecture-content"])){section_architecture_content();exit;}
if(isset($_GET["architecture-adv"])){section_architecture_advanced();exit;}
if(isset($_GET["architecture-users"])){section_architecture_users();exit;}
if(isset($_GET["architecture-filters"])){section_architecture_filters();exit;}
if(isset($_GET["ptx-status"])){ptx_status();exit;}
if(isset($_GET["members-status"])){section_members_status();exit;}
if(isset($_GET["members-content"])){section_members_content();exit;}



//ini_set('display_errors', 1);
//ini_set('error_reporting', E_ALL);
if(isset($_GET["verbose"])){$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);}
if(!isset($GLOBALS["CLASS_USERS"])){$GLOBALS["CLASS_USERS"]=new usersMenus();$users=$GLOBALS["CLASS_USERS"];}else{$users=$GLOBALS["CLASS_USERS"];}
if(!$users->AsAnAdministratorGeneric){die("Not autorized");}
if(isset($_GET["off"])){off();exit;}
if(function_exists($_GET["function"])){call_user_func($_GET["function"]);exit;}

$page=CurrentPageName();
$tpl=new templates();
$sock=new sockets();
$users=new usersMenus();
$SQUIDEnable=trim($sock->GET_INFO("SQUIDEnable"));
if(!is_numeric($SQUIDEnable)){$SQUIDEnable=1;}
$EnableRemoteStatisticsAppliance=$sock->GET_INFO("EnableRemoteStatisticsAppliance");
if(!is_numeric($EnableRemoteStatisticsAppliance)){$EnableRemoteStatisticsAppliance=0;}
$DisableArticaProxyStatistics=$sock->GET_INFO("DisableArticaProxyStatistics");
if(!is_numeric($DisableArticaProxyStatistics)){$DisableArticaProxyStatistics=0;}
$StatsPerfsSquidAnswered=$sock->GET_INFO("StatsPerfsSquidAnswered");
if(!is_numeric($StatsPerfsSquidAnswered)){$StatsPerfsSquidAnswered=0;}
	if(!$users->PROXYTINY_APPLIANCE){
Beispiel #9
0
 /**
  * @test
  */
 public function it_has_a_helper_function_for_removing_hooks_now_and_in_the_future()
 {
     // exhibit A
     add_action('hook_one', 'cb_one');
     $this->assertTrue(off('hook_one', 'cb_one'));
     // exhibit B
     $boom = function () {
         throw Exception('This should be removed or the test will fail!');
     };
     $hook = off('hook_two', $boom);
     $this->assertInstanceOf(Hook::class, $hook);
     // could be added waaaay later, sometime, we don't even know
     add_action('hook_two', $boom);
     do_action('hook_two');
 }
 /**
  * 解绑事件
  */
 private static function off()
 {
     off('rm_old_build_file', 'IncreProcessPlugin::remain');
     off('one_process_start', 'IncreProcessPlugin::importMap');
     off('processor_fetch_files', 'IncreProcessPlugin::getFileList');
     off('change_file', 'IncreProcessPlugin::addChangeList');
 }