plugin/scorm/Manager/ExportManager.php
public function export(ResourceNode $node, $locale = 'en', $scormVersion = '2004')
    {
        if ('2004' !== $scormVersion && '1.2' !== $scormVersion) {
            // Invalid Scorm version
            throw new \Exception('SCORM export : Invalid SCORM version.');
        }

        $resource = $this->resourceManager->getResourceFromNode($node);
        if (!$resource) {
            throw new ResourceNotFoundException('SCORM export : The resource '.$node->getName().' was not found');
        }

        // Export the Resource and all it's sub-resources
        $exportedResources = $this->exportResource($resource, $locale);

        // Create the manifest for the Scorm package
        if ('1.2' === $scormVersion) {
            $manifest = new Scorm12Manifest($node, $exportedResources);
        } else {
            $manifest = new Scorm2004Manifest($node, $exportedResources);
        }

        $package = $this->createPackage($node, $locale, $manifest, $exportedResources);

        return $package;
    }
public function export(ResourceNode $node, $locale = 'en', $scormVersion = '2004')
    {
        if ('2004' !== $scormVersion && '1.2' !== $scormVersion) {
            // Invalid Scorm version
            throw new \Exception('SCORM export : Invalid SCORM version.');
        }

        $resource = $this->resourceManager->getResourceFromNode($node);
        if (!$resource) {
            throw new ResourceNotFoundException('SCORM export : The resource '.$node->getName().' was not found');
        }

        // Export the Resource and all it's sub-resources
        $exportedResources = $this->exportResource($resource, $locale);

        // Create the manifest for the Scorm package
        if ('1.2' === $scormVersion) {
            $manifest = new Scorm12Manifest($node, $exportedResources);
        } else {
            $manifest = new Scorm2004Manifest($node, $exportedResources);
        }

        $package = $this->createPackage($node, $locale, $manifest, $exportedResources);

        return $package;
    }
public function export ( ResourceNode $ node , $ locale = 'en' , $ scormVersion = '2004' ) { if ( '2004' !== $ scormVersion && '1.2' !== $ scormVersion ) { // Invalid Scorm version throw new \ Exception ( 'SCORM export : Invalid SCORM version.' ) ; } $ resource = $ this -> resourceManager -> getResourceFromNode ( $ node ) ; if ( ! $ resource ) { throw new ResourceNotFoundException ( 'SCORM export : The resource ' . $ node -> getName ( ) . ' was not found' ) ; } // Export the Resource and all it's sub-resources $ exportedResources = $ this -> exportResource ( $ resource , $ locale ) ; // Create the manifest for the Scorm package if ( '1.2' === $ scormVersion ) { $ manifest = new Scorm12Manifest ( $ node , $ exportedResources ) ; } else { $ manifest = new Scorm2004Manifest ( $ node , $ exportedResources ) ; } $ package = $ this -> createPackage ( $ node , $ locale , $ manifest , $ exportedResources ) ; return $ package ; }
Create a Scorm archive for a ResourceNode.

@param ResourceNode $node
@param string       $locale
@param string       $scormVersion

@return \ZipArchive

@throws ResourceNotFoundException
@throws \Exception
Create a Scorm archive for a ResourceNode .