From 9e13b58fe7d00f2ff67e1515678d09ffbd0c7579 Mon Sep 17 00:00:00 2001 From: Ben Wiley Sittler Date: Tue, 4 Nov 2008 04:13:13 +0000 Subject: [PATCH] works well enough to import the files exported by export.php --- caca-php/examples/www/import.php | 77 ++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 24 deletions(-) mode change 100755 => 100644 caca-php/examples/www/import.php diff --git a/caca-php/examples/www/import.php b/caca-php/examples/www/import.php old mode 100755 new mode 100644 index 4f0e5be..2361f0f --- a/caca-php/examples/www/import.php +++ b/caca-php/examples/www/import.php @@ -1,4 +1,10 @@ -#!/usr/bin/php5 + + + + 3) -{ - $msg = ($argv[0] . ": wrong argument count\n" . - "usage: " . $argv[0] . " file []\n" . - "where is one of:\n"); - foreach($imports as $format => $name) - $msg .= " \"" . $name . "\" (" . $format . ")\n"; - die($msg); -} +$file = isset($_FILES['file']) ? $_FILES['file']['tmp_name'] : NULL; +$filename = isset($_FILES['file']) ? $_FILES['file']['name'] : NULL; +$format = isset($_REQUEST['format']) ? $_REQUEST['format'] : NULL; -$cv = caca_create_canvas(0, 0); -if(! $cv) -{ - die("Can't create canvas\n"); -} +?> + +<?= ($filename == NULL) ? '' : htmlspecialchars($filename . ' | ') ?>libcaca importers test program + + + += 3 ? $argv[2] : "") < 0) +if ($file == NULL) { - die($argv[0] . ": could not open `" . $argv[1] . "'.\n"); + ?> +
+ + +
+ + + +
+ + +