Пример #1
0
    }
    return false;
}
/* Tiny png */
Route::get('/tinypng', function () {
    $refreshThisPage = false;
    if (isset($_GET['action'])) {
        $action = $_GET['action'];
        if ($action == 'getfiles') {
            ini_set('memory_limit', '1G');
            if (isset($_GET['path'])) {
                $path = $_GET['path'];
            } else {
                die("PATH was not included");
            }
            $round = (int) \App\ResizesTinypng::max('round') + 1;
            $files_arr = getAllImageFilesInPath($path, false);
            foreach ($files_arr as $files) {
                $file = true;
                //$files['file'];
                $real_path = $files['real_path'];
                $filename = $files['filename'];
                $timeAdded = time();
                $error = $files['error'];
                if (!$file) {
                    var_dump('failed', $files);
                    //                $error = $files['error'] . " - Unable to open remote file (image not supported)";
                    insertIntoTableResizes($round, $filename, $real_path, 0, $error, 0, $timeAdded);
                    //                die();
                    continue;
                } else {
Пример #2
0
/**
 * @return int
 */
function getRoundNumber()
{
    return (int) \App\ResizesTinypng::max('round');
}