Changeset 3276 for libcaca


Ignore:
Timestamp:
Nov 4, 2008, 6:12:17 AM (11 years ago)
Author:
bsittler
Message:

htmlize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/www/transform.php

    • Property svn:executable deleted
    r3275 r3276  
    1 #!/usr/bin/php5
     1<?php
     2header('Content-Type: text/html; charset=UTF-8');
     3?>
     4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     5    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     6
     7<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    28<?php
    39/*
     
    1824 *  http://sam.zoy.org/wtfpl/COPYING for more details.
    1925 */
    20 
    21 if (php_sapi_name() != "cli") {
    22         die("You have to run this program with php-cli!\n");
    23 }
     26?>
     27<head>
     28<title>transformation test program</title>
     29<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     30</head>
     31<body text="silver" bgcolor="black">
     32<?php
    2433
    2534$pig = (
     
    3847        " `---'     `-.____,'\n");
    3948
    40 $cv = caca_create_canvas(0, 0);
     49$cv = caca_create_canvas(80, 25);
    4150if(! $cv)
    4251{
    4352        die("Can't created canvas\n");
    44 }
    45 $dp = caca_create_display($cv);
    46 if(! $dp)
    47 {
    48         die("Can't create display\n");
    4953}
    5054
     
    98102caca_blit($cv, 10, 18, $tmp);
    99103
    100 caca_refresh_display($dp);
     104echo caca_export_string($cv, "html3");
    101105
    102 caca_get_event($dp, CACA_EVENT_KEY_PRESS, -1);
    103106?>
     107</body>
     108</html>
Note: See TracChangeset for help on using the changeset viewer.