Skip to content
Snippets Groups Projects
020_is_executable_in_tmp.php 368 B
#!/usr/bin/env php
<?php

echo "
WHAT: Check if $AMCLI is executable in another place, eg.tmp
";

if(strstr($AMCLI, ".php")){
    echo "SKIP: not for php script - it is for the binary only.\n";
    return true;
}

$tmpfile="/tmp/".basename($AMCLI);
file_put_contents($tmpfile, file_get_contents($AMCLI));
chmod($tmpfile, 0700);
_exec("$tmpfile -V");
unlink($tmpfile);