コード例 #1
0
 final function make(IOutput $writeStream)
 {
     $this->classMethods = array();
     $this->classProperties = array();
     $this->findMembers();
     $writeStream->write($this->getFileHeader())->write($this->getClassHeader())->write($this->getClassBody())->write($this->getClassFooter())->write($this->getFileFooter());
 }
コード例 #2
0
ファイル: StreamResponseTest.php プロジェクト: evanjt/core
 public function testOutputReadFileError()
 {
     $path = __FILE__;
     $this->output->expects($this->once())->method('getHttpResponseCode')->will($this->returnValue(Http::STATUS_OK));
     $this->output->expects($this->once())->method('setReadfile')->will($this->returnValue(false));
     $this->output->expects($this->once())->method('setHttpResponseCode')->with($this->equalTo(Http::STATUS_BAD_REQUEST));
     $response = new StreamResponse($path);
     $response->callback($this->output);
 }
コード例 #3
0
 function render(IOutput $output)
 {
     $this->assertOutsideRenderingContext();
     $this->inRenderingContext = true;
     $this->output = $output;
     ob_start();
     // isolate inclusion to introduce a clean scope
     $this->injectLayout();
     $output->write(ob_get_clean());
     $this->inRenderingContext = false;
     $this->output = null;
 }
コード例 #4
0
 /**
  * @return void
  */
 function write(IOutput $output)
 {
     $options = array();
     foreach ($this->options as $option => $value) {
         if (!empty($value)) {
             $options[] = $option . ' = ' . $this->prepareValue($value[0]);
             foreach (array_slice($value, 1) as $value) {
                 $options[] = $option . ' += ' . $this->prepareValue($value);
             }
         }
     }
     $output->write(join(StringUtils::DELIM_UNIX, $options));
 }
コード例 #5
0
    /**
     * Dumps schema
     *
     * @param IOutput $writeStream stream to write the dump to
     * @param IDialect $dialect database dialect to use
     *
     * @return void
     */
    function make(IOutput $writeStream, IDialect $dialect)
    {
        $now = date('Y/m/d H:i');
        $product = PHOEBIUS_FULL_PRODUCT_NAME;
        $start = <<<EOT
--
-- {$product}
-- Generated at {$now} for {$dialect->getDBDriver()->getValue()}
--


EOT;
        $writeStream->write($start)->write($this->dbSchema->toDialectString($dialect));
    }
コード例 #6
0
 /**
  * In-place render of a separate UIControl
  *
  * @param string $view name of the view to render
  * @param Model $model optional custom model to pass; if not set, the current model will be passed
  *
  * @return void
  */
 protected function renderPartial($view, Model $model = null)
 {
     $this->assertInsideRenderingContext();
     $presentation = $this->spawn($view, $model);
     $control = $this->getUserControl($presentation);
     if ($this->control) {
         $control->setParentControl($this->control);
     }
     $presentation->setUIControl($control);
     // this is not good to handle output buffering cause the actual implemention
     // of output buffering can be unknown in the internals of a base class but
     // this is the only way to implement renderPartial() and we know explicilty how
     // is the base class implemented
     $this->output->write(ob_get_clean());
     ob_start();
     $control->render($this->output);
 }
コード例 #7
0
 /**
  * @return void
  */
 function write(IOutput $output)
 {
     $output->write($this->getHeader())->write($this->getBody())->write($this->getFooter());
 }