NAME

PFT::Content::Entry - Content edited by user.

SYNOPSIS

use PFT::Content::Entry;

my $p = PFT::Content::Entry->new({
    tree => $tree,
    path => $path,
    name => $name, 
})

DESCRIPTION

PFT::Content::Entry is the basetype for all text-based content files. It inherits from PFT::Content::File and has two specific subtypes: PFT::Content::Blog (representing an entry with date) and PFT::Content::Page (representing an entry withouth date).

Methods

open

Open the file, return a file handler. Sets the binmode according to the locale.

Reads the header from the page.

Returns undef if the entry is not backed by a file. Croaks if the file does not contain a healty header.

read

Read the page.

In scalar context returns an open file descriptor configured with the correct `binmode` according to the header. In list context returns the header and the same descriptor. Returns undef if the file does not exist.

Croaks if the header is broken.

set_header

Sets a new header, passed by parameter.

This will rewrite the file. Content will be maintained.

make_consistent

Make page consistent with the filesystem tree.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 26:

=back without =over