Komut Satırı Yürütmesini İşleyen Sınıf

PHP
17 lines
<?php
class calistir {
public function komut($komut) {
$komut .= ' 2>&1';
$devral = popen($komut, 'r');
$kayit = '';
while (!feof($devral)) {
$line = fread($devral, 1024);
$kayit .= $line;
}
pclose($devral);
return $kayit;
}
}
$c=new calistir;
echo $c->komut("DIR");
?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Çıktısı

PowerShell
3 lines
Volume in drive C has no label. Volume Serial Number is XXXX-1234 Directory of C:\Program Files\EasyPHP-DevServer\data\localweb 06.05.2018 23:22
. 06.05.2018 23:22
.. 06.05.2018 23:19 310 index.php 1 File(s) 310 bytes 2 Dir(s) 26.303.090.688 bytes free
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

Sizin Değerli Görüşlerinize İhtiyacımız Var.