public function updateLayout(Layout $layout)
    {
        if (null === $layout->getSite()) {
            return false;
        }

        $layoutfile = $this->getLayoutFile($layout);
        File::resolveFilepath($layoutfile, null, array('include_path' => $this->_layoutdir));

        if (false === file_exists($layoutfile)) {
            File::resolveFilepath($layoutfile, null, array('base_dir' => $this->_layoutdir[1]));
        }

        if (false === file_exists($layoutfile) && false === touch($layoutfile)) {
            throw new RendererException(sprintf('Unable to create file %s.', $layoutfile), RendererException::LAYOUT_ERROR);
        }

        if (!is_writable($layoutfile)) {
            throw new RendererException(sprintf('Unable to open file %s in writing mode.', $layoutfile), RendererException::LAYOUT_ERROR);
        }

        return $layoutfile;
    }
public function updateLayout(Layout $layout)
    {
        if (null === $layout->getSite()) {
            return false;
        }

        $layoutfile = $this->getLayoutFile($layout);
        File::resolveFilepath($layoutfile, null, array('include_path' => $this->_layoutdir));

        if (false === file_exists($layoutfile)) {
            File::resolveFilepath($layoutfile, null, array('base_dir' => $this->_layoutdir[1]));
        }

        if (false === file_exists($layoutfile) && false === touch($layoutfile)) {
            throw new RendererException(sprintf('Unable to create file %s.', $layoutfile), RendererException::LAYOUT_ERROR);
        }

        if (!is_writable($layoutfile)) {
            throw new RendererException(sprintf('Unable to open file %s in writing mode.', $layoutfile), RendererException::LAYOUT_ERROR);
        }

        return $layoutfile;
    }
public function updateLayout ( Layout $ layout ) { if ( null === $ layout -> getSite ( ) ) { return false ; } $ layoutfile = $ this -> getLayoutFile ( $ layout ) ; File :: resolveFilepath ( $ layoutfile , null , array ( 'include_path' => $ this -> _layoutdir ) ) ; if ( false === file_exists ( $ layoutfile ) ) { File :: resolveFilepath ( $ layoutfile , null , array ( 'base_dir' => $ this -> _layoutdir [ 1 ] ) ) ; } if ( false === file_exists ( $ layoutfile ) && false === touch ( $ layoutfile ) ) { throw new RendererException ( sprintf ( 'Unable to create file %s.' , $ layoutfile ) , RendererException :: LAYOUT_ERROR ) ; } if ( ! is_writable ( $ layoutfile ) ) { throw new RendererException ( sprintf ( 'Unable to open file %s in writing mode.' , $ layoutfile ) , RendererException :: LAYOUT_ERROR ) ; } return $ layoutfile ; }
Updates a file script of a layout.

@param Layout $layout The layout to update

@return string The filename of the updated script
Updates a file script of a layout .