PerlDoc

24 June 2022 - 08:02 | Version 1 |
See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview


Parent package: Foswiki::Store
Child packages:

    internal package Foswiki::Store::RcsFast is a Foswiki::Store

    Single-file implementation of Foswiki::Store

    ClassMethod new() → $core

    constructor for a store object

    ObjectMethod finish()

    ObjectMethod readTopic($meta, $version) → ($rev, $isLatest)

    ObjectMethod saveTopic( $meta, $cUID, $options ) → $integer

    ObjectMethod moveTopic( $oldTopicObject, $newTopicObject, $cUID )

    ObjectMethod topicExists( $web, $topic ) → $boolean

    ObjectMethod openAttachment( $meta, $attachment, $mode, %opts ) → $text

    ObjectMethod saveAttachment( $meta, $attachment, $stream, $cUID, \%options ) → $revNum

    ObjectMethod moveAttachment( $oldTopicObject, $oldAttachment, $newTopicObject, $newAttachment, $cUID )

    ObjectMethod copyAttachment( $oldTopicObject, $oldAttachment, $newTopicObject, $newAttachment )

    ObjectMethod attachmentExists( $meta, $att ) → $boolean

    ObjectMethod testAttachment( $meta, $attachment, $test ) → $value

    ObjectMethod moveWeb( $oldWebObject, $newWebObject, $cUID )

    ObjectMethod webExists( $web ) → $boolean

    ObjectMethod getRevisionHistory ( $meta [, $attachment] ) → $iterator

    ObjectMethod getNextRevision ($meta ) → $revision

    ObjectMethod getRevisionDiff ( $meta, $rev2, $contextLines ) → \@diffArray

    ObjectMethod getVersionInfo($meta, $rev, $attachment) → \%info

    ObjectMethod repRev( $meta, $cUID, %options ) → $rev

    ObjectMethod delRev( $meta, $cUID ) → $rev

    ObjectMethod atomicLockInfo( $meta ) → ($cUID, $time)

    ObjectMethod atomicLock( $meta, $cUID )

    ObjectMethod atomicUnlock( $meta )

    ObjectMethod getApproxRevTime ( $web, $topic ) → $epochSecs

    ObjectMethod getRevisionAtTime( $meta, $time ) → $rev

    ObjectMethod eachChange( $meta, $time ) → $iterator

    ObjectMethod recordChange(%args)

    ObjectMethod eachAttachment( $meta ) → \$iterator

    ObjectMethod eachTopic( $webObject ) → $iterator

    ObjectMethod eachWeb($webObject, $all ) → $iterator

    ObjectMethod remove( $cUID, $om, $attachment )

    ObjectMethod query($query, $inputTopicSet, $session, \%options) → $outputTopicSet

    ObjectMethod getLease( $meta ) → $lease

    ObjectMethod setLease( $meta, $length )

    ObjectMethod removeSpuriousLeases( $web )

    ObjectMethod _json() → $json

    returns a JSON object

    ObjectMethod _encoder() → $encoder

    returns a Sereal::Encoder object

    ObjectMethod _decoder() → $decoder

    returns a Sereal::Decoder object

    ObjectMethod _enterCritical(%args) → $lock

    The args hash consists of:

    * meta (either meta or web, topic) * web * topic * file * attachment (optional) * mode

    See _getPath().

    This establishes the start of a critical transaction onto the given resource. The resource is depicted by $meta and an optional $attachement name.

    The $mode param can either LOCK_EX or LOCK_SH, defaulting to LOCK_SH. The resource will be locked exclusively using LOCK_EX or shared with a LOCK_SH mode. An exclusive lock is required to establish safe read/write access to a resource. The same resource cannot be locked by any other critical path. A shared lock protect the resource from writing while concurrent read-only operations are fine.

    The function returns a $lock object to be used in _leaveCritical(). Note that everytime you enter a critical transaction you must exlicitly leave it as well. While all remaining locks left behind are being cleared in the deconstructor, this is considered an error.

    ObjectMethod _leaveCritical($lock)

    This method destroys the lock with the given id.

    ObjectMethod _getTopic($meta, $version) → ($tex, $version)

    ObjectMethod _getRevInfo($meta, $attachment, $version) → \%info

    ObjectMethod _getRevInfoFromHistory($meta, $attachment, $version) → \%info

    ObjectMethod _readAttachment($meta, $attachment, $version) → $data

    ObjectMethod _readMetaDB($meta) → $boolean

    loads the meta object by decoding the Sereal object stored in meta.db fie. returns true on success.

    ObjectMethod _writeMetaDB($meta)

    writes the meta object by encoding it into a Sereal file

    ObjectMethod _deleteMetaDB($meta)

    ObjectMethod _getPath(%args) → $filepath

    returns the path to an object on the store. args may contain keys:

    • meta: object to get the store file for
    • web, topic: either meta or web, topic params are required
    • subdir: intermedium directory
    • attachment: name of an attachment
    • extension: defaults to .txt
    • file: explicit filename

    note that the return value has been encoded to utf8

    ObjectMethod _getMutexFile(%args) → $filePath

    returns the file path used to create a mutex while entering a critical area

    args:

    • meta
    • web
    • topic
    • attachment
    • file

    ObjectMethod _readTopic($meta) → $text

    ObjectMethod _readFile($file, $isBinary) → $data

    reads a file from disck

    ObjectMethod _move($from, $to)

    ObjectMethod _copy($from, to)

    ObjectMethod _checkIn($meta, $attachment, $comment, $user, $data)

    ObjectMethod _rcsLock($file)

    ObjectMethod _rcsUnlock($file)

    ObjectMethod _saveFile($file, $text)

    ObjectMethod _saveStream($file, $fh)

    ObjectMethod _readChanges($files) →> \@changes

    ObjectMethod _getWebs($meta, $all, $result) → $result

    gather all webs; if all is true then recursively

    ObjectMethod _deleteRevision($meta, $rev)

    ObjectMethod _getLatestRevFromHistory($file) → $rev

    This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
    Ideas, requests, problems regarding arbeitsgruppe.ch? Send feedback
    This page was cached on 29 Dec 2025 - 01:28.