Hoa central
Static Public Member Functions | Public Attributes | List of all members
Hoa\Console\Chrome\Pager Class Reference

Static Public Member Functions

static less ($output, $mode)
 
static more ($output, $mode)
 
static pager ($output, $mode, $type=null)
 

Public Attributes

const LESS = 'less'
 
const MORE = 'more'
 

Detailed Description

Class .

Use a pager for the output buffer. Example:

ob_start('Hoa\Console\Chrome\Pager::less');
echo file_get_contents(__FILE__);

Definition at line 52 of file Pager.php.

Member Function Documentation

static Hoa\Console\Chrome\Pager::less (   $output,
  $mode 
)
static

Use less.

Parameters
string$outputOutput (from the output buffer).
int$modeMode (from the output buffer).
Returns
string

Definition at line 77 of file Pager.php.

78  {
79  return self::pager($output, $mode, self::LESS);
80  }
static Hoa\Console\Chrome\Pager::more (   $output,
  $mode 
)
static

Use more.

Parameters
string$outputOutput (from the output buffer).
int$modeMode (from the output buffer).
Returns
string

Definition at line 89 of file Pager.php.

90  {
91  return self::pager($output, $mode, self::MORE);
92  }
static Hoa\Console\Chrome\Pager::pager (   $output,
  $mode,
  $type = null 
)
static

Use pager set in the environment (i.e. $_ENV['PAGER']).

Parameters
string$outputOutput (from the output buffer).
int$modeMode (from the output buffer).
string$typeType. Please, see self::LESS or self::MORE.
Returns
string

Definition at line 102 of file Pager.php.

103  {
104  static $process = null;
105 
106  if ($mode & PHP_OUTPUT_HANDLER_START) {
107  $pager
108  = null !== $type
110  : (isset($_ENV['PAGER']) ? $_ENV['PAGER'] : null);
111 
112  if (null === $pager) {
113  return $output;
114  }
115 
116  $process = new Console\Processus(
117  $pager,
118  null,
119  [['pipe', 'r']]
120  );
121  $process->open();
122  }
123 
124  $process->writeAll($output);
125 
126  if ($mode & PHP_OUTPUT_HANDLER_FINAL) {
127  $process->close();
128  }
129 
130  return null;
131  }
static locate($binary)
Definition: Processus.php:1133

Here is the call graph for this function:

Member Data Documentation

const Hoa\Console\Chrome\Pager::LESS = 'less'

Represent LESS(1).

string

Definition at line 59 of file Pager.php.

const Hoa\Console\Chrome\Pager::MORE = 'more'

Represent MORE(1).

string

Definition at line 66 of file Pager.php.


The documentation for this class was generated from the following file: