From aa92ad5d0318539c1182f19ea44ffa0597cba5b2 Mon Sep 17 00:00:00 2001 From: Nicolas Vion Date: Sun, 26 Oct 2008 15:27:59 +0000 Subject: [PATCH] * Add php binding for caca_export_memory (called caca_export_string) * Rename php function caca_import_memory to caca_import_string * Add sample program "text.php" (php port of examples/text.c) * Add php binding for "caca_set_attr" --- caca-php/examples/example1.php | 2 +- caca-php/examples/text.php | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100755 caca-php/examples/text.php diff --git a/caca-php/examples/example1.php b/caca-php/examples/example1.php index dda24cd..d62fb48 100755 --- a/caca-php/examples/example1.php +++ b/caca-php/examples/example1.php @@ -36,7 +36,7 @@ if (!$display) { caca_set_color_ansi($pig, CACA_LIGHTMAGENTA, CACA_TRANSPARENT); caca_set_color_ansi($canvas, CACA_LIGHTBLUE, CACA_TRANSPARENT); -caca_import_memory($pig, $pig_str, "text"); +caca_import_string($pig, $pig_str, "text"); caca_set_display_time($display, 30000); $x = $y = 0; diff --git a/caca-php/examples/text.php b/caca-php/examples/text.php new file mode 100755 index 0000000..7d9d5da --- /dev/null +++ b/caca-php/examples/text.php @@ -0,0 +1,62 @@ +#!/usr/bin/php5 + + * + * This file is a Php port of the official libcaca's sample program "demo.c" + * which is: + * Copyright (c) 2003 Sam Hocevar + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://sam.zoy.org/wtfpl/COPYING for more details. + */ + +$string = <<