debug Function

	private function debug($mixedValue){
                  DebuggerUtility::var_dump($mixedValue);
	        \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($mixedValue);
	}
	private function debugLog($mixedValue){
	        unlink("logger.log");
			error_log(print_r($mixedArray,true), 3, "logger.log");
	}

    /**
     * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $queryResult
     * @param boolean $explainOutput
     * @return void
     */
    public function debugQuery(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $queryResult, $explainOutput = FALSE){
        $GLOBALS['TYPO3_DB']->debugOutput = 2;
        if($explainOutput){
            $GLOBALS['TYPO3_DB']->explainOutput = true;
        }
        $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;
        $queryResult->toArray();
        \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);
        $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = false;
        $GLOBALS['TYPO3_DB']->explainOutput = false;
        $GLOBALS['TYPO3_DB']->debugOutput = false;
    }

Enable debug info
config.contentObjectExceptionHandler = 0

GET templateRootPath

$templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($config['view']['templateRootPath']);

sample.xml To $xmlArray

$xmlContent = file_get_contents($this->getTemplateRootPath().'sample.xml');
$xmlArray = GeneralUtility::xml2array($xmlContent);

FrontendConfigurationManager

Extern: Config überall aufrufen

$cManager = $this->objectManager->get('TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager');
$extensionConfig = $cManager->getConfiguration($extensionName, NULL);

Intern: In der Extension aufrufen

$config = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);

Projekt: T3Sugar

T3Sugar ist ein Installations-Assistent für Typo3-Distributionen. Der Installer kann verglichen
werden als ein Linux für Content-Managment-Systeme. Bei dem Betriebssystem Linux gibt es
ebenfalls verschiedene Distributionen für die unterschiedlichen Anwendungsbereiche. T3Sugar
dient zur Entwicklung eines ‚Out-of-the-Box‘ -Installationsassistenten für Firmenseiten oder
Webshops. Der Assistent konfiguriert alle wichtigen Programme, Layout und die Datenbank.

Artikel aus der TYPO3-Fachzeitschrift T3N

StorageRepository & Move File

StorageRepository

$storageRepository = $this->objectManager->get('TYPO3\CMS\Core\Resource\StorageRepository');
// storage 1 == fileadmin
$storage = $storageRepository->findByUid('1');
$subFolder = $storage->createFolder('subFolder');
$tempFile = 'typo3temp/filePathTemp.jpg';
$moveFile = $storage->addFile($tempFile,$subFolder,'newFile.jpg');

Move File

$fileReference = $this->objectManager->get('TYPO3\CMS\Extbase\Domain\Model\FileReference');
$fileReference->setFile($moveFile);

Add File To News

 $news->addFalMedia($fileReference);    

shortcut

sudo chmod 777 -R /opt/lampp/htdocs/

sudo /opt/lampp/lampp start