PHP 8.2.30
Preview: example_output.php Size: 2.06 KB
//opt/alt/php54/usr/share/doc/pear/ConsoleTools/docs/example_output.php

<?php
/**
 * Example for the usage of ezcConsoleOutput class.
 *
 * @package ConsoleTools
 * @version 1.6.1
 * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */

require_once 'Base/src/base.php';

/**
 * Autoload ezc classes 
 * 
 * @param string $className 
 */
function __autoload( $className )
{
    ezcBase::autoload( $className );
}

// Create the output handler
$out = new ezcConsoleOutput();

// Set the verbosity to level 10
$out->options->verbosityLevel = 10;
// Enable auto wrapping of lines after 40 characters
$out->options->autobreak    = 40;

// Set the color of the default output format to green
$out->formats->default->color   = 'green';

// Set the color of the output format named 'success' to white
$out->formats->success->color   = 'white';
// Set the style of the output format named 'success' to bold
$out->formats->success->style   = array( 'bold' );

// Set the color of the output format named 'failure' to red
$out->formats->failure->color   = 'red';
// Set the style of the output format named 'failure' to bold
$out->formats->failure->style   = array( 'bold' );
// Set the background color of the output format named 'failure' to blue
$out->formats->failure->bgcolor = 'blue';

// Output text with default format
$out->outputText( 'This is default text ' );
// Output text with format 'success'
$out->outputText( 'including success message', 'success' );
// Some more output with default output.
$out->outputText( "and a manual linebreak.\n" );

// Manipulate the later output
$out->formats->success->color = 'green';
$out->formats->default->color = 'blue';

// This is visible, since we set verboseLevel to 10, and printed in default format (now blue)
$out->outputText( "Some verbose output.\n", null, 10 );
// This is not visible, since we set verboseLevel to 10
$out->outputText( "Some more verbose output.\n", null, 20 );
// This is visible, since we set verboseLevel to 10, and printed in format 'failure'
$out->outputText( "And some not so verbose, failure output.\n", 'failure', 5 );

?>

Directory Contents

Dirs: 1 × Files: 31

Name Size Perms Modified Actions
img DIR
- drwxr-xr-x 2024-03-03 22:54:48
Edit Download
229 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
2.64 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
624 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
2.06 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
3.36 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
1.07 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
613 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
461 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
630 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
987 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
2.09 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
1.71 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
1.53 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
23.92 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
495 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
184 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
657 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
755 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
399 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
1.11 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
271 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
596 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
656 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
1.06 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
1.00 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
299 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
1.41 KB lrw-r--r-- 2019-12-18 11:17:09
Edit Download
552 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
334 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
739 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download
308 B lrw-r--r-- 2019-12-18 11:17:09
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).