本文整理汇总了PHP中events函数的典型用法代码示例。如果您正苦于以下问题:PHP events函数的具体用法?PHP events怎么用?PHP events使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了events函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: review
function review()
{
$id = (int) $_GET['user'];
$q = mysql_query("select * from users where id='{$id}' ");
$w = mysql_fetch_array($q);
echo '<h2 class="ui header">
<i class="user icon"></i>
<div class="content">';
echo $w['name'] . " " . $w['surname'];
echo '</div></h2>';
echo '<h5 class="ui top attached header">
Etkinlikler
</h5>';
$eventQuery = mysql_query("select * from events where uid='{$id}'");
while ($w = mysql_fetch_array($eventQuery)) {
if ($w['event'] == 4 || $w['event'] == 6) {
$icon = events($w['event'])[$w['state']]['icon'];
$desc = events($w['event'])[$w['state']]['desc'];
} else {
$icon = events($w['event'])['icon'];
$desc = events($w['event'])['desc'];
}
$pos = $w['videoPosition'];
echo "<div class='ui attached segment'>\n\t\t\t<i class=' {$icon} icon'></i>\n\t\t\t{$desc} <b>[ {$pos} ]</b>\n\t\t\t<span style='float:right'>" . $w['clock'] . "</span>\n\t\t</div>";
echo "<div class='aciklama'>\n\t\t\t\n\t\t\t<table class='ui definition table'>\n\t\t\t <tbody>\n\t\t\t <tr>\n\t\t\t <td class='two wide column'>Size</td>\n\t\t\t <td>1 x 2</td>\n\t\t\t </tr>\n\t\t\t <tr>\n\t\t\t <td>Weight</td>\n\t\t\t <td>6 ounces</td>\n\t\t\t </tr>\n\t\t\t <tr>\n\t\t\t <td>Color</td>\n\t\t\t <td>Yellowish</td>\n\t\t\t </tr>\n\t\t\t <tr>\n\t\t\t <td>Odor</td>\n\t\t\t <td>Not Much Usually</td>\n\t\t\t </tr>\n\t\t\t </tbody>\n\t\t\t </table>\n\n\t\t</div>";
}
echo '<div class="ui bottom attached warning message">
<i class="warning icon"></i>
Başka bir işlem görünmüyor..
</div>';
}
示例2: DirListsql
function DirListsql($path)
{
$dir_handle = @opendir($path);
if (!$dir_handle) {
events("Unable to open \"{$path}\"");
return array();
}
$count = 0;
while ($file = readdir($dir_handle)) {
if ($file == '.') {
continue;
}
if ($file == '..') {
continue;
}
if (!is_file("{$path}/{$file}")) {
continue;
}
if (!preg_match("#\\.sql\$#", $file)) {
continue;
}
$array[$file] = $file;
}
if (!is_array($array)) {
return array();
}
@closedir($dir_handle);
return $array;
}
示例3: start
function start()
{
$events = events(1);
$html = "\n\t<H1>{APP_PUREFTPD} {events}</H1>\n\t<div id='showevents' style='width:100%;height:250px;overflow:auto'>\n\t\t{$events}\n\t</div>\n\t";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例4: popup
function popup()
{
$tpl = new templates();
$logs = events();
$html = "\n\t<H1>{APP_DHCP_EVENTS}</H1>\n\t" . RoundedLightWhite("\n\t<div style='width:100%;height:350px;overflow:auto' id='DHCPDL'>{$logs}</div>");
echo $tpl->_ENGINE_parse_body($html);
}
示例5: afficherPageAdminGE
function afficherPageAdminGE()
{
require './Modele/admins.php';
verifAdmin($db);
require './Modele/evenements.php';
require_once './Modele/utilisateurs.php';
$events = events($db);
include "./Vue/Admin/gestionEvent.php";
}
示例6: reservation
function reservation()
{
checkPerm('view');
require_once _base_ . '/lib/lib.tab.php';
require_once _base_ . '/lib/lib.urlmanager.php';
require_once _base_ . '/lib/lib.form.php';
require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
$mod_perm = checkPerm('mod', true);
$lang =& DoceboLanguage::createInstance('reservation');
$um =& UrlManager::getInstance("reservation");
$out = $GLOBALS['page'];
$out->setWorkingZone('content');
$man_res = new Man_Reservation();
$tab_man = new TabView('reservation', '');
$tab_events = new TabElemDefault('events', $lang->def('_RESERVATION_EVENTS'));
$tab_my_events = new TabElemDefault('my_events', $lang->def('_RESERVATION_MY_EVENTS'));
$tab_past_event = new TabElemDefault('past_events', $lang->def('_RESERVATION_PAST_EVENTS'));
if ($mod_perm) {
$tab_subscribed_user = new TabElemDefault('subscribed_user', $lang->def('_RESERVATION_SUBSCRIBED_USER'));
}
$tab_man->addTab($tab_events);
$tab_man->addTab($tab_my_events);
$tab_man->addTab($tab_past_event);
if ($mod_perm) {
$tab_man->addTab($tab_subscribed_user);
}
$tab_man->parseInput($_POST, $_SESSION);
$active_tab = $tab_man->getActiveTab();
if ($active_tab != 'events' && $active_tab != 'my_events' && $active_tab != 'past_events' && $active_tab != 'subscribed_user') {
$active_tab = importVar('active_tab', false, 'events');
$tab_man->setActiveTab($active_tab);
}
$out->add(getTitleArea(Lang::t('_RESERVATION', 'reservation')) . '<div class="std_block">', 'content');
$out->add(Form::openForm('tab_reservation', 'index.php?modname=reservation&op=reservation&confirm=1&ap=mod_profile&from=2') . $tab_man->printTabView_Begin('', false), 'content');
switch ($active_tab) {
case 'events':
events();
break;
case 'my_events':
myEvents();
break;
case 'past_events':
pastEvents();
break;
case 'subscribed_user':
subscribedUser();
break;
}
$out->add($tab_man->printTabView_End() . Form::closeForm(), 'content');
$out->add('</div>', 'content');
}
示例7: ParseLogsDir
function ParseLogsDir()
{
$d = 0;
$h = 0;
$sock = new sockets();
$workingDir = $sock->GET_INFO("SquidOldLogsDefaultDir");
if (!($handle = opendir($workingDir))) {
@mkdir($workingDir, 0755, true);
return;
}
$squidtail = new squid_tail();
while (false !== ($filename = readdir($handle))) {
if ($filename == ".") {
continue;
}
if ($filename == "..") {
continue;
}
$targetFile = "{$workingDir}/{$filename}";
if (!is_file($targetFile)) {
continue;
}
$d++;
$h++;
$c = 0;
if ($d > 300) {
if (systemMaxOverloaded()) {
$array_load = sys_getloadavg();
$internal_load = $array_load[0];
events("ParseSquidLogBrutProcess()::{$workingDir}:: Overloaded: {$internal_load} system, break loop...", __LINE__);
break;
}
$d = 0;
}
$handle = @fopen($targetFile, "r");
if (!$handle) {
events("Failed to open file", __LINE__);
continue;
}
while (!feof($handle)) {
$c++;
$buffer = trim(fgets($handle, 4096));
if (!$squidtail->parse_tail($buffer, null)) {
continue;
}
}
}
}
示例8: Builsql
function Builsql($uri, $ip, $virus)
{
$virus = str_replace("+", " ", $virus);
$virus = trim($virus);
$md5 = md5(time() . "{$uri},{$ip},{$virus}");
$ip = GetComputerName($ip);
$sql = "INSERT INTO `antivirus_events` (`zDate`, `TaskName`, `email`, `VirusName`, `InfectedPath`, `ComputerName`, `zmd5`) \n\tVALUES (NOW(), 'HTTP Scan', 0, '{$virus}', '{$uri}', '{$ip}', '{$md5}')";
$q = new mysql();
$q->QUERY_SQL($sql, "artica_events");
if (!$q->ok) {
events($q->mysql_error);
events($sql);
return;
}
events("Virus {$virus} found from {$uri} to {$ip}");
}
示例9: off
/**
* Remove one or all listeners from event.
*
* @param $event
* @param callable $listener
* @return bool
*/
function off($event, callable $listener = null)
{
if (!isset(events()->{$event})) {
return;
}
if ($listener === null) {
unset(events()->{$event});
} else {
foreach (events()->{$event} as $priority => $listeners) {
if (false !== ($index = array_search($listener, $listeners, true))) {
unset(events()->{$event}[$priority][$index]);
}
}
}
return true;
}
示例10: checkdates
function checkdates($workfile)
{
$handle = @fopen($workfile, "r");
if (!$handle) {
events("Fopen failed on {$workfile}");
return false;
}
while (!feof($handle)) {
$buffer = trim(fgets($handle));
$t = explode(",", $buffer);
if (intval($t[1]) < 100) {
continue;
}
$IPAddr = $t[0];
$date = date("Y-m-d H:i:s", $t[1]);
echo "{$IPAddr} : {$date}\n";
}
}
示例11: xstart
function xstart()
{
$Directory = "/home/artica-postfix/squid/StatsApplicance/BEREKLEY";
if (!is_dir($Directory)) {
return;
}
if (!($handle = opendir($Directory))) {
return;
}
while (false !== ($fileZ = readdir($handle))) {
if ($fileZ == ".") {
continue;
}
if ($fileZ == "..") {
continue;
}
$path = "{$Directory}/{$fileZ}";
$lockfile = "{$Directory}/{$fileZ}.LCK";
events("parse_stats(): Scanning {$path}");
$t1 = microtime_float();
if (preg_match("#^(.+?)-UserAuthDB\\.db#", $fileZ, $re)) {
if (is_file($lockfile)) {
continue;
}
@file_put_contents($lockfile, time());
parse_userauthdb($path, $re[1], true);
events("{$fileZ} " . microtime_ms($t1));
@unlink($path);
@unlink($lockfile);
continue;
}
if (preg_match("#^(.+?)-[0-9]+_QUOTASIZE\\.db#", $fileZ, $re)) {
if (is_file($lockfile)) {
continue;
}
@file_put_contents($lockfile, time());
ParseDB_FILE($path, $re[1], true);
events("{$fileZ} " . microtime_ms($t1));
@unlink($lockfile);
@unlink($path);
continue;
}
}
}
示例12: Parseline
function Parseline($buffer)
{
$buffer = trim($buffer);
if ($buffer == null) {
return null;
}
if (!preg_match("#^[0-9]+,\\s+\\[(.+?)]#", $buffer, $re)) {
events("Not filtered: {$buffer}");
return;
}
$date = date("Y-m-d H:i:00");
$category = trim(strtolower($re[1]));
if (!isset($GLOBALS["MAIN"][$date][$category])) {
$GLOBALS["MAIN"][$date][$category] = 1;
} else {
$GLOBALS["MAIN"][$date][$category] = $GLOBALS["MAIN"][$date][$category] + 1;
}
if (count($GLOBALS["MAIN"]) > 2) {
dump_main();
}
}
示例13: test01_Conveniences
/**
* The only tests done here are for existence and validation.
*/
public function test01_Conveniences()
{
/*
* Test each function twice - first for value then after caching
*/
$this->assertTrue(forge() instanceof Forge);
$this->assertTrue(forge('ioc') instanceof IlluminateContainer);
$this->assertTrue(config() instanceof Config);
$this->assertTrue(config() instanceof Config);
$this->assertTrue(path() instanceof Paths);
$this->assertTrue(path() instanceof Paths);
$this->assertTrue(events() instanceof Events);
$this->assertTrue(events() instanceof Events);
//$this->assertTrue(router() instanceof Router);
//$this->assertTrue(router() instanceof Router);
//$this->assertTrue(routing() instanceof Routing);
//$this->assertTrue(routing() instanceof Routing);
$test = function () {
return "test";
};
$this->assertEquals("test", value($test));
}
示例14: Parseline
function Parseline($buffer){
$buffer=trim($buffer);
if($buffer==null){return null;}
if(strpos($buffer,"init urllist")>0){return ;}
if(strpos($buffer,"init expressionlist")>0){return ;}
if(strpos($buffer,"init domainlist")>0){return ;}
if(preg_match('#INFO: loading dbfile (.+)#',$buffer,$re)){
events("LOADING $re[1]");
$GLOBALS[__FILE__]["DBFILE"]=trim($re[1]);
return null;
}
if(preg_match("#FATAL: Error db_open: Unknown error#",$buffer,$re)){
events("ERROR ON {$GLOBALS[__FILE__]["DBFILE"]}");
$file="/etc/artica-postfix/croned.1/squidguard.". md5($GLOBALS[__FILE__]["DBFILE"]).".error";
if(IfFileTime($file)){
shell_exec(LOCATE_PHP5_BIN2()." /usr/share/artica-postfix/exec.squidguard.php --compile-single \"{$GLOBALS[__FILE__]["DBFILE"]}\" &");
WriteFileCache($file);
}
return null;
}
if(strpos($buffer,"ERROR: Going into emergency mode")>0){
events("ERROR: Going into emergency mode");
send_email_events("squidguard: squidguard turn to emergency mode","SquidGuard claim\n$buffer\nPlease contact your support to fix this problem\ncurrently, no filtering urls will be enabled","proxy");
return ;
}
events("Not filtered: $buffer");
}
示例15: restore
function restore($id, $target_resource, $db)
{
$sql = "SELECT * FROM dar_index where filekey='{$id}'";
$q = new mysql();
$ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
$ressource = $ligne["mount_md5"];
$sourcefile = $ligne["filepath"];
if ($_GET["RESTORE_DIR"]) {
$sourcefile = dirname($sourcefile);
}
$ini = new Bs_IniHandler("/tmp/restore.{$id}.ini");
$ini->set('INFO', "backup_resource", $ressource);
$ini->set('INFO', "target_resource", $target_resource);
$ini->set('INFO', "database", $db);
$ini->set('INFO', "source_path", $sourcefile);
$ini->saveFile("/tmp/restore.{$id}.ini");
$ini = new Bs_IniHandler(dirname(__FILE__) . "/ressources/logs/exec.dar.find.restore.ini");
$ini->set("STATUS", "progress", 15);
$ini->set("STATUS", "text", "{Executing}...");
$ini->saveFile(dirname(__FILE__) . "/ressources/logs/exec.dar.find.restore.ini");
$cmd = "/usr/share/artica-postfix/bin/artica-backup --dar-restore-path /tmp/restore.{$id}.ini";
events($cmd);
system($cmd);
}