Aller au contenu principal Aide Panneau de contrôle

A+   A-

Logiciel serveur «  

Documentation : agents/uploads.php

class Uploads - Process uploads

The hook 'tick' triggers periodic checks of the inbox/entries directory. If a file, uploaded from handx weblog, is found, its content is parsed, related pages are created, and it is then archived.

handx weblog generates one file per day, containing all entries for the day. YACS uses such files as input queues.

YACS parses input queues and uses regular expressions to split weblog entries. The date of the entry is taken from the file name. The hour is taken from the standard separator. The content may use standard yacs codes, plus specific elements <title>, <introduction> and <source>. If no title element is provided, the first sentence is used instead.

Note that YACS parser does not support customised separators. Please be careful to not change related parameters in weblog configuration.

Following parameters are used while processing uploaded weblog entries:
  • user nick name
  • section to anchor posted pages


These parameters are set in agents/configure.php, and saved in parameters/agents.include.php.

Items processed by YACS are saved in backup queues. Backup queues have the same names than input queues, with an additional .bak extension. Basically, you just have to suppress the .bak extension to make YACS process related entries again.

This script is a reference file of this system.

Licence : GNU Lesser General Public License

Auteurs :

list_files() - List files into one directory

function list_files($path)

  • $path - string the directory to look at
  • returns an array of directory entries, or NULL

process_handx_entry() - Process one handx entry

function process_handx_entry($text, $stamp=NULL)

  • $text - string entry content
  • $stamp=NULL - time stamp

This function actually creates an article out an entry

process_handx_weblog() - Process one file uploaded by handx weblog

function process_handx_weblog($file)

  • $file - string the file to process

tick_hook() - Process new uploads, if any

function tick_hook()

  • returns a string to be displayed in resulting page, if any

This function checks the input queue, and process new files on their arrival.

This function is aiming to run silently, therefore errors are logged in a file.
tn