break; case UPLOAD_ERR_EXTENSION: echo "A PHP extension stopped the file upload UPLOAD_ERR_EXTENSION({$err})"; break; } goto end; } unphar_toZip($file["tmp_name"], $result, substr($file["name"], 0, -5)); /** @var string|null $tmpDir */ /** @var string|null $zipPath */ /** @var string|null $zipRelativePath */ /** @var string|null $basename */ /** @var bool $error */ extract($result); if ($error) { goto end; } usage_inc("unphar", $timestamp); echo <<<EOS <h1>Success</h1> <p>Phar has been successfully converted to zip.<br> Download the ZIP file <a href="{$zipRelativePath}">here</a>, or download with an alternative name:</p> <p><i><font color="#2f4f4f">The altname download is currently not available.</font></i></p> <!--<iframe width="500" src="/data/dlPhar.php?path={$basename}"></iframe>--> <p>The download link is available for <i>at least</i> <b>2 hours</b>.</p> EOS; end: ?> </font></body> </html>
echo $MAKEPHAR_ERROR_MESSAGES[$result["error"]]; echo "<br>"; echo "<code>" . $result["error_name"] . "(" . $result["erorr_id"] . ")</code>: "; echo $result["error_msg"]; echo "</p>"; goto the_end; } $url = $result["pharpath"]; $basename = urlencode(substr($url, 12)); echo <<<EOP <h1>Phar has been successfully created.</h1> <p><a href="{$url}">Download the phar here</a>, or download with an alternative name:</p> <iframe width="500" src="/data/dlPhar.php?path={$basename}"></iframe> <p>The download link is available for at least two hours.</p> EOP; $cnt = usage_inc("pharbuild", $time); $diff = time() - $time; $itv = ""; if ($diff >= 3600 * 24) { $itv .= (int) ($diff / (3600 * 24)) . " day(s), "; $diff %= 3600 * 24; while ($diff < 0) { $diff += 3600 * 24; } } if ($diff >= 3600) { $itv .= (int) ($diff / 3600) . " hour(s), "; $diff %= 3600; while ($diff < 0) { $diff += 3600; }