Beispiel #1
0
    $date = strtotime($s);
    $fiabiliteDate = 2;
}
$fileInfo = shell_exec("file " . escapeshellarg($path));
if (preg_match("~(image data|MPEG)~i", $fileInfo)) {
    // C'est une image.
    // On tente d'extraire l'exif
    if ($fiabiliteDate < 1) {
        $exif = @exif_read_data($path, null, true, false);
        if ($exif && isset($exif["FILE"]["FileDateTime"])) {
            $date = $exif["FILE"]["FileDateTime"];
            $fiabiliteDate = 1;
        }
    }
    if (preg_match("~scan~", basename($path))) {
        echo docs($date, $path) . "\n";
        exit(0);
    }
    echo photos($date, $path) . "\n";
    exit(0);
}
echo $path . "\n";
exit(1);
/**
 * Range le fichier dans le dossier /data/photos
 *
 * @param $date
 * @param $path
 * @return string
 */
function photos($date, $path)
Beispiel #2
0
        }
        $content .= "</div>";
        file_put_contents($save . $link, $head . $content . $foot);
    }
}
function cleanFile($file)
{
    $res = preg_replace("/[\\.\\(\\)\\s]/", "-", $file);
    if ($res[strlen($res) - 1] == "-") {
        $res = substr($res, 0, -1);
    }
    return $res;
}
function merge($files, $path = "", $save)
{
    $src = "";
    foreach ($files as $file) {
        $src .= file_get_contents($path . $file);
        $src .= "\n\r\n\r";
    }
    file_put_contents($save . "crafty.js", $src);
}
$files = array("license.txt", "core.js", "intro.js", "HashMap.js", "2D.js", "collision.js", "hitbox.js", "DOM.js", "html.js", "storage.js", "extensions.js", "device.js", "sprite.js", "canvas.js", "controls.js", "animate.js", "animation.js", "drawing.js", "isometric.js", "sound.js", "text.js", "loader.js", "math.js", "time.js", "outro.js");
if (!is_dir('api/')) {
    mkdir('api');
}
docs($files, "../src/", "api/");
//merge($files, "../src/",  "../");
?>
<h1>Merged and Built Successfully</h1>
Beispiel #3
0
function docs()
{
    if (isset($_POST['action'])) {
        $action = post('action');
        if ($action == 'verify') {
            verify_user(post('uid'));
        } else {
            if ($action == 'unverify') {
                unverify_user(post('uid'));
            } else {
                throw new Error("unknown action", "unknown action: {$action}");
            }
        }
    }
    show_docs_form();
    if (isset($_GET['uid'])) {
        show_user_documents_for_user(get('uid'));
    } else {
        if (isset($_GET['verified_with_no_docs'])) {
            show_user_verified_with_no_documents();
        } else {
            show_user_documents();
        }
    }
    echo "<div class='content_box'>\n";
    echo "<h3>Upload Docs for Users</h3>\n";
    echo "<p><a href=\"?page=identity\">Upload more docs</a></p>\n";
    echo "</div>\n";
}
docs();