Pārlūkot izejas kodu

* Check that samples programs are executed with php-cli

tags/v0.99.beta17
Nicolas Vion nico pirms 17 gadiem
vecāks
revīzija
77d1ef7e7d
6 mainītis faili ar 19 papildinājumiem un 1 dzēšanām
  1. +3
    -0
      caca-php/examples/cacainfo.php
  2. +4
    -0
      caca-php/examples/demo.php
  3. +4
    -1
      caca-php/examples/dithering.php
  4. +2
    -0
      caca-php/examples/figfont.php
  5. +3
    -0
      caca-php/examples/polyline.php
  6. +3
    -0
      caca-php/examples/text.php

+ 3
- 0
caca-php/examples/cacainfo.php Parādīt failu

@@ -46,6 +46,9 @@ EOT;
} }


if (!posix_isatty(STDOUT))
die("You have to run this program with php-cli!\n");

just_for_fun(); just_for_fun();


//--- Show caca's information ---// //--- Show caca's information ---//


+ 4
- 0
caca-php/examples/demo.php Parādīt failu

@@ -359,6 +359,10 @@ function demo_triangles($cv, $bounds, $outline) {
function demo_render($cv, $bounds, $outline) { function demo_render($cv, $bounds, $outline) {
} }



if (!posix_isatty(STDOUT))
die("You have to run this program with php-cli!\n");

main(); main();


?> ?>

+ 4
- 1
caca-php/examples/dithering.php Parādīt failu

@@ -11,6 +11,9 @@
* http://sam.zoy.org/wtfpl/COPYING for more details. * http://sam.zoy.org/wtfpl/COPYING for more details.
*/ */


if (!posix_isatty(STDOUT))
die("You have to run this program with php-cli!\n");

$img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png"); $img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png");
if (!$img) if (!$img)
die("Can not open image.\n"); die("Can not open image.\n");
@@ -27,6 +30,6 @@ if (!$display)
caca_dither_bitmap($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img); caca_dither_bitmap($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img);
caca_refresh_display($display); caca_refresh_display($display);


caca_get_event($display, CACA_EVENT_KEY_PRESS, 5000000);
caca_get_event($display, CACA_EVENT_KEY_PRESS, -1);


?> ?>

+ 2
- 0
caca-php/examples/figfont.php Parādīt failu

@@ -23,6 +23,8 @@ function unistr_to_ords($str, $encoding = 'UTF-8'){
return $result; return $result;
} }


if (!posix_isatty(STDOUT))
die("You have to run this program with php-cli!\n");


if ($argc < 3) { if ($argc < 3) {
die("Too few arguments.\nUsage: cmd <path of font> <utf8 string>\n"); die("Too few arguments.\nUsage: cmd <path of font> <utf8 string>\n");


+ 3
- 0
caca-php/examples/polyline.php Parādīt failu

@@ -18,6 +18,9 @@ function transform($tbl, $tx, $ty, $sx, $sy) {
return $result; return $result;
} }


if (!posix_isatty(STDOUT))
die("You have to run this program with php-cli!\n");

$canvas = caca_create_canvas(0, 0); $canvas = caca_create_canvas(0, 0);
$display = caca_create_display($canvas); $display = caca_create_display($canvas);
if (!$display) { if (!$display) {


+ 3
- 0
caca-php/examples/text.php Parādīt failu

@@ -15,6 +15,9 @@
* http://sam.zoy.org/wtfpl/COPYING for more details. * http://sam.zoy.org/wtfpl/COPYING for more details.
*/ */


if (!posix_isatty(STDOUT))
die("You have to run this program with php-cli!\n");

$string = <<<EOT $string = <<<EOT
|_| |_|
_,----._ | | _,----._ | |


Notiek ielāde…
Atcelt
Saglabāt