You are here

protected function OpignoTincanQuestionTypeQuestion::unzipPackage in Opigno TinCan Question Type 7

This method will unzip the package to the public extracted folder.

It will use the constants self::PATH_PUBLIC_EXTRACTED_PACKAGE_FOLDER.

Parameters

object $file: The file to unzip.

Return value

bool TRUE if success, else FALSE.

Throws

\Exception If the file is unsupported.

1 call to OpignoTincanQuestionTypeQuestion::unzipPackage()
OpignoTincanQuestionTypeQuestion::validateNode in includes/opigno_tincan_question_type.question.inc
Provides validation for question before it is created.

File

includes/opigno_tincan_question_type.question.inc, line 334
This file contains the class OpignoTincanQuestionTypeQuestion.

Class

OpignoTincanQuestionTypeQuestion
This class goal is to provide specific TinCan question information.

Code

protected function unzipPackage($file) {
  $archiver = archiver_get_archiver($file->uri);
  if (!$archiver) {
    return FALSE;
  }
  else {
    $archiver
      ->extract(self::getExtractPath($file));
    return TRUE;
  }
}