This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>WebSocket Client</title> | |
</head> | |
<body> | |
<button onclick="sendCalculation()">Calculate</button> | |
<div id="result"></div> |
This file contains hidden or 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 | |
$date = date('Y-m-d H:i:s'); | |
$socket_client = stream_socket_client('tcp://localhost:8080'); | |
while (true) { | |
fwrite($socket_client, "son gelen $date"); | |
echo fread($socket_client, 1024).PHP_EOL; | |
sleep(1); | |
} |
This file contains hidden or 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 Permission | |
{ | |
private const int READ = 10; | |
private const int WRITE = 20; | |
private const int DELETE = 40; | |
This file contains hidden or 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 | |
interface Subscriber | |
{ | |
public function handle(Blog $blog): void; | |
} | |
trait ObserveAble | |
{ |
This file contains hidden or 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
input { | |
jdbc { | |
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/database_name" | |
jdbc_user => "admin" | |
jdbc_password => "admin" | |
jdbc_driver_library => "/home/log-stash/drivers/mysql-connector-java-8.0.25.jar" | |
jdbc_driver_class => "com.mysql.jdbc.Driver" | |
statement => "SELECT * FROM my_table_input WHERE id > :sql_last_value ORDER BY id ASC limit 1" | |
tracking_column => "id" | |
tracking_column_type => "numeric" |
This file contains hidden or 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 RouteManager | |
{ | |
private string $middleware; | |
private string $name; |
This file contains hidden or 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 ExceptionHandler | |
{ | |
private static array $exceptionHandlers = []; | |
public function __construct() | |
{ | |
set_exception_handler(/** |
This file contains hidden or 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 Response | |
{ | |
public function __construct(private string $body, private CurlHandle $curlHandle) | |
{ | |
} | |
public function body(): string | |
{ | |
return $this->body; | |
} |
This file contains hidden or 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 Http | |
{ | |
/** | |
* @var CurlHandle|false $curl | |
*/ | |
private CurlHandle|false $curl; | |
private array $curlArray = []; | |
private string|false $response; |
This file contains hidden or 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 Xmlbuilder | |
{ | |
private SimpleXMLElement $element; | |
public function __construct(SimpleXMLElement $simpleXMLElement = new SimpleXMLElement('<root/>')) |