1. Go to this page and download the library: Download nubs/hiatus library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nubs / hiatus example snippets
// Get the directory listing of the directory given by the user.
// NOTE: This is probably not a good idea to let users run arbitrary directory
// listings.
list($exitStatus, $stdout, $stderr) = \Hiatus\exec('ls -l', [$_POST['dir']]);
if ($exitStatus !== 0) {
throw new Exception('Command failed.');
}
echo $stdout;
// Download the url given by the user, but fail if it takes more than 10
// seconds.
// NOTE: This is probably not a good idea to let users download arbitrary urls.
list($exitStatus, $stdout, $stderr) = \Hiatus\exec(
'curl',
[$_POST['url']],
10
);
if ($exitStatus !== 0) {
throw new Exception('Command failed.');
}
echo $stdout;