本文整理汇总了PHP中Console::WriteLine方法的典型用法代码示例。如果您正苦于以下问题:PHP Console::WriteLine方法的具体用法?PHP Console::WriteLine怎么用?PHP Console::WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Console
的用法示例。
在下文中一共展示了Console::WriteLine方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Display
public function Display(Console $con, $resIps, $errorsOnly)
{
foreach ($this->GetChangedLines() as $line) {
$con->WritePart('[' . $con->Colorize('ERROR', Console::C_RED) . '] ');
$con->WritePart($con->Colorize($resIps ? substr(str_pad($this->ResolveIP($line->ip), 48), 0, 48) : str_pad($line->ip, 16), Console::C_YELLOW) . ' ');
$con->WritePart($con->Colorize(str_pad($line->domain, 32), Console::C_BROWN) . ' ');
$long_mesg = $con->Colorize($line->message, Console::C_RED);
$con->WriteLine($long_mesg);
}
}
示例2: start
public function start($port = 8080)
{
if (!$this->status) {
$this->server->port = $port;
$this->server->run();
$this->status = true;
} else {
Console::WriteLine("WebServerAPI already started !");
}
}
示例3: Display
public function Display(Console $con, $resIps, $errorsOnly)
{
foreach ($this->GetChangedLines() as $line) {
if ($errorsOnly && $line->code < 400) {
continue;
// not an error entry, go to next one
}
$con->WritePart('[' . $con->Colorize('ACCESS', Console::C_CYAN) . '] ');
$con->WritePart($con->Colorize($resIps ? substr(str_pad($this->ResolveIP($line->ip), 48), 0, 48) : str_pad($line->ip, 16), Console::C_YELLOW) . ' ');
$con->WritePart($con->Colorize(str_pad($line->domain, 32), Console::C_BROWN) . ' ');
$con->WritePart($con->Colorize(str_pad($line->method, 8), Console::C_LIGHT_PURPLE));
$long_mesg = '' . $con->ColorizeUrl($line->url) . $con->Colorize(' > ', Console::C_DARK_GRAY) . $con->Colorize($line->code, $line->code < 400 ? Console::C_GREEN : Console::C_RED) . $con->Colorize(' (', Console::C_DARK_GRAY) . $con->Colorize($line->size, Console::C_WHITE) . $con->Colorize(' bytes)', Console::C_DARK_GRAY);
$con->WriteLine($long_mesg);
}
}
示例4: PrintVersion
protected function PrintVersion()
{
date_default_timezone_set('Europe/Berlin');
$this->console->WriteLine('httpdmon ' . VERSION);
$this->console->WriteLine('Copyright (c) 2013-' . date('Y') . ' Christian Sciberras');
}
示例5: Error
private function Error($name, $direction)
{
Console::WriteLine($name . " " . ($direction == 1 ? "incoming" : "outgoing") . " not found !");
return 0;
}
示例6: use
$util->HeaderManager =& $headermanager;
$util->RSA =& $rsa;
$util->Database =& $database;
$util->Cache =& $cache;
$util->Config =& $config;
$util->RoomManager =& $roommanager;
$service->execute(function () use($user, $events, $util) {
ob_implicit_flush(true);
while ($buffer = $user->socketInput->read(4096)) {
if ($buffer == "<policy-file-request/>" . chr(0)) {
$user->send(Util::Crossdomain());
continue;
}
$buffer = String::decode($buffer, 'ISO-8859-1');
if ($user->rc4initialized) {
$buffer = $user->rc4client->Parse($buffer);
}
foreach (BufferManager::Parser($buffer) as $packet) {
$packet = new PacketParser($packet);
$header = $packet->getHeader();
if (isset($events[$header])) {
eval($events[$header]["parent"] . '::' . $events[$header]["method"] . '($user, $packet, $util);');
Console::WriteLine("- Executed event for " . $header . " (" . $events[$header]["parent"] . '::' . $events[$header]["method"] . ") ");
} else {
Console::WriteLine("- Not found event for " . $header . " : " . $packet->getFullPacket());
}
}
}
$user->disconnect();
}, $environment);
}
示例7: CleanDatabase
public function CleanDatabase()
{
Console::Write("Cleaning Database...");
$this->database->Exec("UPDATE users SET online = '0'");
$this->database->Exec("UPDATE rooms SET users_now = 0");
$this->database->Exec("UPDATE server_status SET users_online = 0, rooms_loaded = 0");
Console::WriteLine("completed!");
}
示例8: SSOTicketMessageEvent
public static function SSOTicketMessageEvent(User $user, PacketParser $packet, ClassContainer $util)
{
$ticket = $packet->readString();
$query = $util->Database->Query("SELECT * FROM users WHERE auth_ticket = ? LIMIT 1", array($ticket));
if (count($query) == 0) {
Console::WriteLine("User not found, ticket : " . $ticket);
$user->disconnect();
} else {
$check = $util->index->GetUserbyHabboId($query[0]['id']);
if ($check) {
$check->disconnect();
}
$user->habbo = $query[0];
$util->index->habboid[$user->habbo['id']] =& $user;
Console::WriteLine("- " . $user->habbo['username'] . " logged in !");
$util->Database->Exec("UPDATE users SET online = '1' WHERE id = ?", array($user->habbo['id']));
$util->Database->Exec("UPDATE server_status SET users_online = users_online + 1");
$response = new PacketConstructor();
$response->SetHeader($util->HeaderManager->Outgoing("UniqueMachineIDMessageComposer"));
$response->WriteString($user->HWID);
$user->Send($response->Finalize());
$response = new PacketConstructor();
$response->SetHeader($util->HeaderManager->Outgoing("AuthenticationOKMessageComposer"));
$user->Send($response->Finalize());
$response = new PacketConstructor();
$response->SetHeader($util->HeaderManager->Outgoing("HomeRoomMessageComposer"));
$response->WriteInt32($user->habbo['home_room']);
$response->WriteInt32($user->habbo['home_room']);
$user->Send($response->Finalize());
$response = new PacketConstructor();
$response->SetHeader($util->HeaderManager->Outgoing("MinimailCountMessageComposer"));
$response->WriteInt32(0);
$user->Send($response->Finalize());
$favoriterooms = $util->Database->Query("SELECT room_id FROM user_favorites WHERE user_id = ?", array($user->habbo['id']));
$response = new PacketConstructor();
$response->SetHeader($util->HeaderManager->Outgoing("FavouriteRoomsMessageComposer"));
$response->WriteInt32(30);
$response->WriteInt32(count($favoriterooms));
foreach ($favoriterooms as $favorite) {
$response->WriteInt32($favorite['room_id']);
}
$user->Send($response->Finalize());
$response = new PacketConstructor();
$response->SetHeader($util->HeaderManager->Outgoing("EnableNotificationsMessageComposer"));
$response->WriteBoolean(true);
$response->WriteBoolean(false);
$user->Send($response->Finalize());
$response = new PacketConstructor();
$response->SetHeader($util->HeaderManager->Outgoing("EnableTradingMessageComposer"));
$response->WriteBoolean(true);
$user->Send($response->Finalize());
}
}