public function plainTextAction($path)
    {
        try {
            $this->setPath($path);
        } catch (NotFoundException $e) {
            throw $e;
        }

        $dbfile = new WDBFile($this->getpath());
        if (!$dbfile->isFile()) {
            throw new NotFoundException(
                'Can not send raw content of a directory!',
                0, null, TemplateHelper::getRoute($dbfile->getWDBPath())
            );
        }

        $response = $this->wdb->getResponse();

        // mime header
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        $mime = finfo_file($finfo, $this->getPath());
        if ( ! in_array($mime, $response::$content_types)) {
            $mime = 'text/plain';
        }
        finfo_close($finfo);

        // content
        $ctt = $response->flush(file_get_contents($this->getPath()), $mime);
        return array('layout_empty_txt', $ctt);
    }
public function plainTextAction($path)
    {
        try {
            $this->setPath($path);
        } catch (NotFoundException $e) {
            throw $e;
        }

        $dbfile = new WDBFile($this->getpath());
        if (!$dbfile->isFile()) {
            throw new NotFoundException(
                'Can not send raw content of a directory!',
                0, null, TemplateHelper::getRoute($dbfile->getWDBPath())
            );
        }

        $response = $this->wdb->getResponse();

        // mime header
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        $mime = finfo_file($finfo, $this->getPath());
        if ( ! in_array($mime, $response::$content_types)) {
            $mime = 'text/plain';
        }
        finfo_close($finfo);

        // content
        $ctt = $response->flush(file_get_contents($this->getPath()), $mime);
        return array('layout_empty_txt', $ctt);
    }
public function plainTextAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getpath ( ) ) ; if ( ! $ dbfile -> isFile ( ) ) { throw new NotFoundException ( 'Can not send raw content of a directory!' , 0 , null , TemplateHelper :: getRoute ( $ dbfile -> getWDBPath ( ) ) ) ; } $ response = $ this -> wdb -> getResponse ( ) ; // mime header $ finfo = finfo_open ( FILEINFO_MIME_TYPE ) ; $ mime = finfo_file ( $ finfo , $ this -> getPath ( ) ) ; if ( ! in_array ( $ mime , $ response :: $ content_types ) ) { $ mime = 'text/plain' ; } finfo_close ( $ finfo ) ; // content $ ctt = $ response -> flush ( file_get_contents ( $ this -> getPath ( ) ) , $ mime ) ; return array ( 'layout_empty_txt' , $ ctt ) ; }
Raw plain text action of a path

@param string $path
@return array
@throws \WebDocBook\Exception\NotFoundException
Raw plain text action of a path