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 ReflectionClosure extends ReflectionFunction | |
{ | |
const string REGEX_PATTERN = '/function\s*\(\s*(.*?)\s*\)\s*(?:use\s*\(([^)]*)\)\s*)?{\s*(.*?)\s*}/s'; | |
public function getCode(): string | |
{ | |
$startLine = $this->getStartLine(); | |
$endLine = $this->getEndLine(); |
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
//dilo surucu | |
class Step | |
{ | |
/** | |
* @var Closure[] $steps | |
*/ | |
private array $steps; | |
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 BookEntity | |
{ | |
public function __construct(private int $id, private string $title) | |
{ | |
} | |
public function getId(): int |
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 | |
//Dilo surucu | |
$spec = array( | |
0 => array('pipe', 'r'), // stdin | |
1 => array('pipe', 'w'), // stdout | |
2 => array('pipe', 'w') // stderr | |
); | |
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 Parallel | |
{ | |
private array $threads = []; | |
private array $process = []; | |
public function add(PromiseInterface $promise): self | |
{ | |
$this->threads[] = $promise; | |
return $this; |
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
<!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 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 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 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 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" |
NewerOlder