mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-09 03:50:26 +08:00
24 lines
379 B
PHP
24 lines
379 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
// test command storage
|
||
|
|
|
||
|
|
// open access log file
|
||
|
|
$fp = fopen("/tmp/goedge-command-storage.log", "a+");
|
||
|
|
|
||
|
|
// read access logs from stdin
|
||
|
|
$stdin = fopen("php://stdin", "r");
|
||
|
|
while(true) {
|
||
|
|
if (feof($stdin)) {
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
$line = fgets($stdin);
|
||
|
|
|
||
|
|
// write to access log file
|
||
|
|
fwrite($fp, $line);
|
||
|
|
}
|
||
|
|
|
||
|
|
// close file pointers
|
||
|
|
fclose($fp);
|
||
|
|
fclose($stdin);
|
||
|
|
|
||
|
|
?>
|