[TYPO3-mvc] Fatal Error in FAL

Philipp philippwrann at gmx.at
Tue Nov 19 17:07:55 CET 2013


Hey,

in my import routine i want to load files with an exec command in a configured storage and index the file etc.... i wanted to do this by requesting the Storage from the StorageRepository and so on.

Somewhere in my application i get a fatal error "Cannot instantiate abstract class TYPO3\CMS\Core\Resource\Driver\AbstractDriver"

Here is my routine:
$this->resourceStorage = $this->storageRepository->findByUid($this->config['import']['storageUid']);

.
.


$importer->injectResourceStorage($this->resourceStorage)

.
.

and in the importer class

/**
	 * @param string $path
	 * @return \TYPO3\CMS\Core\Resource\File
	 * @todo dont do a direct exec, use some core functionallity here and implement some exception handling
	 */
	protected function loadExternalResourceAndReturnFileObject($path) {
		$internalIdentifier = $this->getInternalResourceIdentifierForExternalPath($path);
		if (!$this->resourceStorage->hasFile($internalIdentifier)) {
			$importFolder = rtrim($this->config['import']['subFolder'],'/');
			if (!$this->resourceStorage->hasFolder($importFolder)) {
				$this->resourceStorage->createFolder($importFolder);
			}
			$importFolder = $this->resourceStorage->getFolder($importFolder);
			if (!$importFolder->hasFolder($this->source->externalKey)) {
				$importFolder->createFolder($this->source->externalKey);
			}
			$fullPath = $this->resourceStorage->getBaseUri() . $internalIdentifier;
			$state;	$out = array();
			exec('wget -P ' . $fullPath . ' ' .$path,$out,$state);
			$this->fileRepository->addToIndex($this->resourceStorage->getFile($internalIdentifier));
			// resizing
			if ($this->config['import']['maxImageDimensions'] != 0) {
				$state; $out = array();
				exec('convert '.$fullPath.' -resize '.$this->config['import']['maxImageDimensions'].'\> '.$fullPath,$out,$state);
			}
		}
		return $this->resourceStorage->getFile($internalIdentifier);
	}
	
	/**
	 * @param string $path
	 * @return string
	 */
	protected function getInternalResourceIdentifierForExternalPath($path) {
		return rtrim($this->config['import']['subFolder'],'/') . '/' . $this->source->externalKey . '/' . pathinfo($path,PATHINFO_BASENAME);
	}


what am i missing?


More information about the TYPO3-project-typo3v4mvc mailing list