Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezpautoloadclioutput.php
Go to the documentation of this file.
1 <?php
17 class ezpAutoloadCliOutput implements ezpAutoloadOutput
18 {
24 protected $output = null;
25
31 protected $fileSearchProgress = null;
37 protected $tokenizerProgress = null;
38
44 protected $data = null;
45
53 public function __construct( $quiet = false )
54 {
55 $this->output = new ezcConsoleOutput();
56 $this->output->formats->warning->color = 'red';
57 $this->output->options->verbosityLevel = $quiet ? 0 : 1;
58
59 $this->data = array();
60 $this->data['phase1'] = array();
61 $this->data['phase2'] = array();
62 }
63
72 public function outputCli( $message, $type )
73 {
74 if ( $type == 'normal' )
75 {
76 $this->output->outputLine( $message );
77 $this->output->outputLine();
78 }
79 else if ( $type == 'warning' )
80 {
81 $this->output->outputLine( "Warning: ", 'warning' );
82 $this->output->outputLine( $message);
83 $this->output->outputLine();
84 }
85 }
86
92 public function initPhase1()
93 {
94 $this->fileSearchProgress = new ezcConsoleStatusbar( $this->output );
95 $this->fileSearchProgress->setOptions( array( 'successChar' => '.' ) );
96 }
97
103 public function progressUpdatePhase1()
104 {
105 $this->fileSearchProgress->add( true );
106 }
107
114 public function finishPhase1()
115 {
116 $this->output->outputLine();
117 $this->output->outputLine();
118 }
119
139 public function initPhase2()
140 {
141 // In this implementation we are using a progress bar to show the
142 // progress of the tokenizing process.
143
144 $this->tokenizerProgress = new ezcConsoleProgressbar( $this->output, $this->data['phase2']['nFiles'] );
145 }
146
152 public function progressUpdatePhase2()
153 {
154 $this->tokenizerProgress->advance();
155 }
156
164 public function finishPhase2()
165 {
166 $this->tokenizerProgress->finish();
167 $this->output->outputLine();
168 $this->output->outputLine();
169 }
170
179 public function getData( $phase )
180 {
181 switch( $phase )
182 {
183 case eZAutoloadGenerator::OUTPUT_PROGRESS_PHASE1:
184 return $this->data['phase1'];
185 break;
186
187 case eZAutoloadGenerator::OUTPUT_PROGRESS_PHASE2:
188 return $this->data['phase2'];
189 break;
190 }
191 }
192
200 public function updateData( $phase, $data )
201 {
202 $phase = 'phase' . $phase;
203 $this->data[$phase] = $data;
204 }
205
212 public function updateProgress( $phase )
213 {
214 switch( $phase )
215 {
216 case eZAutoloadGenerator::OUTPUT_PROGRESS_PHASE1:
217 $this->progressUpdatePhase1();
218 break;
219
220 case eZAutoloadGenerator::OUTPUT_PROGRESS_PHASE2:
221 $this->progressUpdatePhase2();
222 break;
223 }
224 }
225 }
226 ?>
$message
$message
Definition: admin/message.php:51
eZAutoloadGenerator\OUTPUT_PROGRESS_PHASE1
const OUTPUT_PROGRESS_PHASE1
Definition: ezautoloadgenerator.php:134
eZAutoloadGenerator\OUTPUT_PROGRESS_PHASE2
const OUTPUT_PROGRESS_PHASE2
Definition: ezautoloadgenerator.php:140
$type
$type
Definition: classes/admin/linkselect.php:220
ezpAutoloadCliOutput
Definition: ezpautoloadclioutput.php:18
ezpAutoloadCliOutput\$fileSearchProgress
$fileSearchProgress
Definition: ezpautoloadclioutput.php:31
ezpAutoloadCliOutput\outputCli
outputCli( $message, $type)
Definition: ezpautoloadclioutput.php:72
ezpAutoloadCliOutput\getData
getData( $phase)
Definition: ezpautoloadclioutput.php:179
ezpAutoloadCliOutput\finishPhase2
finishPhase2()
Definition: ezpautoloadclioutput.php:164
ezpAutoloadCliOutput\updateData
updateData( $phase, $data)
Definition: ezpautoloadclioutput.php:200
ezpAutoloadCliOutput\finishPhase1
finishPhase1()
Definition: ezpautoloadclioutput.php:114
ezpAutoloadCliOutput\progressUpdatePhase1
progressUpdatePhase1()
Definition: ezpautoloadclioutput.php:103
ezpAutoloadCliOutput\initPhase2
initPhase2()
Definition: ezpautoloadclioutput.php:139
ezpAutoloadCliOutput\$output
$output
Definition: ezpautoloadclioutput.php:24
ezpAutoloadCliOutput\$data
$data
Definition: ezpautoloadclioutput.php:44
ezpAutoloadCliOutput\updateProgress
updateProgress( $phase)
Definition: ezpautoloadclioutput.php:212
ezpAutoloadCliOutput\__construct
__construct( $quiet=false)
Definition: ezpautoloadclioutput.php:53
ezpAutoloadCliOutput\initPhase1
initPhase1()
Definition: ezpautoloadclioutput.php:92
ezpAutoloadCliOutput\$tokenizerProgress
$tokenizerProgress
Definition: ezpautoloadclioutput.php:37
ezpAutoloadCliOutput\progressUpdatePhase2
progressUpdatePhase2()
Definition: ezpautoloadclioutput.php:152
ezpAutoloadOutput
Definition: ezpautoloadoutput.php:18
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.