home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (archiver.inc)

This example Drupal source code file (archiver.inc) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

__construct, add, archiverinterface, array, extract, file_path, files, function, interface, listcontents, path, php, public, remove

The archiver.inc Drupal example source code

<?php
// $Id: archiver.inc,v 1.5 2010/02/01 07:17:59 webchick Exp $

/**
 * @file
 * Shared classes and interfaces for the archiver system.
 */

/**
 * Common interface for all Archiver classes.
 */
interface ArchiverInterface {

  /**
   * Constructor for a new archiver instance.
   *
   * @param $file_path
   *   The full system path of the archive to manipulate.  Only local files
   *   are supported.  If the file does not yet exist, it will be created if
   *   appropriate.
   */
  public function __construct($file_path);

  /**
   * Add the specified file or directory to the archive.
   *
   * @param $file_path
   *   The full system path of the file or directory to add. Only local files
   *   and directories are supported.
   * @return ArchiverInterface
   *   The called object.
   */
  public function add($file_path);

  /**
   * Remove the specified file from the archive.
   *
   * @param $path
   *   The file name relative to the root of the archive to remove.
   * @return ArchiverInterface
   *   The called object.
   */
  public function remove($path);

  /**
   * Extract multiple files in the archive to the specified path.
   *
   * @param $path
   *   A full system path of the directory to which to extract files.
   * @param $files
   *   Optionally specify a list of files to be extracted. Files are
   *   relative to the root of the archive. If not specified, all files
   *   in the archive will be extracted
   * @return ArchiverInterface
   *   The called object.
   */
  public function extract($path, Array $files = array());

  /**
   * List all files in the archive.
   *
   * @return
   *   An array of file names relative to the root of the archive.
   */
  public function listContents();
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal archiver.inc source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.