You are here

function PclZip::privCheckFormat in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/pclzip/pclzip.lib.php \PclZip::privCheckFormat()
6 calls to PclZip::privCheckFormat()
PclZip::delete in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::extract in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::extractByIndex in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::listContent in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::merge in includes/moodle/lib/pclzip/pclzip.lib.php

... See full list

File

includes/moodle/lib/pclzip/pclzip.lib.php, line 1389

Class

PclZip

Code

function privCheckFormat($p_level = 0) {

  //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", "");
  $v_result = true;

  // ----- Reset the file system cache
  clearstatcache();

  // ----- Reset the error handler
  $this
    ->privErrorReset();

  // ----- Look if the file exits
  if (!is_file($this->zipname)) {

    // ----- Error log
    PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '" . $this->zipname . "'");

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
    return false;
  }

  // ----- Check that the file is readeable
  if (!is_readable($this->zipname)) {

    // ----- Error log
    PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '" . $this->zipname . "'");

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
    return false;
  }

  // ----- Check the magic code
  // TBC
  // ----- Check the central header
  // TBC
  // ----- Check each file header
  // TBC
  // ----- Return

  //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
  return $v_result;
}