NAME

Articulate::Content::Local - store your content locally

DESCRIPTION

This content storage interface works by placing content and metadata in a folder structure.

For a given location, metadata is stored in meta.yml, content in content.blob.

Set content_base in your config to specify where to place the content.

Caching is not implemented: get_content_cached simpy calls get_content.

METHODS

get_item

$storage->get_item( 'zone/public/article/hello-world' )

Retrieves the metadata for the content at that location.

get_meta

$storage->get_meta( 'zone/public/article/hello-world' )

Retrieves the metadata for the content at that location.

set_meta

$storage->set_meta( 'zone/public/article/hello-world', {...} )

Sets the metadata for the content at that location.

patch_meta

$storage->patch_meta( 'zone/public/article/hello-world', {...} )

Alters the metadata for the content at that location. Existing keys are retained.

CURRENTLY this affects top-level keys only, but a descent algorigthm is planned.

get_settings

$storage->get_settings('zone/public/article/hello-world')

Retrieves the settings for the content at that location.

set_settings

$storage->set_settings('zone/public/article/hello-world', $amended_settings)

Retrieves the settings for the content at that location.

get_settings_complete

$storage->get_settings_complete('zone/public/article/hello-world')

Retrieves the settings for the content at that location.

get_content

$storage->get_content('zone/public/article/hello-world')

Retrieves the content at that location.

set_content

$storage->set_content('zone/public/article/hello-world', $blob);

Places content at that location.

create_item

$storage->create_item('zone/public/article/hello-world', $meta, $blob);

Places meta and content at that location.

item_exists

if ($storage->item_exists( 'zone/public/article/hello-world')) {
  ...
}

Determines if the item has been created (only the meta.yml is tested).

list_items

$storage->list_items ('/zone/public'); # 'hello-world', 'second-item' )

Returns a list of items in the.

empty_all_content

$storage->empty_all_content;

Removes all content. This is totally irreversible, unless you took a backup!

delete_item

$storage->delete_item ('/zone/public');

Deletes the item and all its descendants.

SEE ALSO