public function validate($source)
    {
        $this->assertSourceAsDirectory($source);

        $definitionFiles = $this->getModel()->getDefinitionFiles();
        foreach ($definitionFiles as $file) {
            if (! file_exists($source . DIRECTORY_SEPARATOR . $file)) {
                throw new PortableElementParserException('A portable element package must contains a "' . $file .
                    '" file at the root of the directory: "' . $source . '"');
            }
        }

        $this->getModel()->createDataObject($this->getManifestContent($source));
        return true;
    }
public function validate($source)
    {
        $this->assertSourceAsDirectory($source);

        $definitionFiles = $this->getModel()->getDefinitionFiles();
        foreach ($definitionFiles as $file) {
            if (! file_exists($source . DIRECTORY_SEPARATOR . $file)) {
                throw new PortableElementParserException('A portable element package must contains a "' . $file .
                    '" file at the root of the directory: "' . $source . '"');
            }
        }

        $this->getModel()->createDataObject($this->getManifestContent($source));
        return true;
    }
public function validate ( $ source ) { $ this -> assertSourceAsDirectory ( $ source ) ; $ definitionFiles = $ this -> getModel ( ) -> getDefinitionFiles ( ) ; foreach ( $ definitionFiles as $ file ) { if ( ! file_exists ( $ source . DIRECTORY_SEPARATOR . $ file ) ) { throw new PortableElementParserException ( 'A portable element package must contains a "' . $ file . '" file at the root of the directory: "' . $ source . '"' ) ; } } $ this -> getModel ( ) -> createDataObject ( $ this -> getManifestContent ( $ source ) ) ; return true ; }
Validate the source directory

@param string $source Directory path to validate
@return bool
@throws ExtractException
@throws PortableElementParserException
@throws common_Exception
Validate the source directory