/**
  * @param Tx_ExtensionBuilder_Domain_Model_Extension $extension
  * @param array $propertyConfiguration
  * @return void
  */
 protected function setExtensionProperties(&$extension, $propertyConfiguration)
 {
     // name
     $extension->setName(trim($propertyConfiguration['name']));
     // description
     $extension->setDescription($propertyConfiguration['description']);
     // extensionKey
     $extension->setExtensionKey(trim($propertyConfiguration['extensionKey']));
     if ($propertyConfiguration['emConf']['disableVersioning']) {
         $extension->setSupportVersioning(FALSE);
     }
     // various extension properties
     $extension->setVersion($propertyConfiguration['emConf']['version']);
     if (!empty($propertyConfiguration['emConf']['dependsOn'])) {
         $dependencies = array();
         $lines = t3lib_div::trimExplode("\n", $propertyConfiguration['emConf']['dependsOn']);
         foreach ($lines as $line) {
             if (strpos($line, '=>')) {
                 list($extensionKey, $version) = t3lib_div::trimExplode('=>', $line);
                 $dependencies[$extensionKey] = $version;
             }
         }
         $extension->setDependencies($dependencies);
     }
     if (!empty($propertyConfiguration['emConf']['targetVersion'])) {
         $extension->setTargetVersion(floatval($propertyConfiguration['emConf']['targetVersion']));
     }
     if (!empty($propertyConfiguration['emConf']['custom_category'])) {
         $category = $propertyConfiguration['emConf']['custom_category'];
     } else {
         $category = $propertyConfiguration['emConf']['category'];
     }
     $extension->setCategory($category);
     $extension->setShy($propertyConfiguration['emConf']['shy']);
     $extension->setPriority($propertyConfiguration['emConf']['priority']);
     // state
     $state = 0;
     switch ($propertyConfiguration['emConf']['state']) {
         case 'alpha':
             $state = Tx_ExtensionBuilder_Domain_Model_Extension::STATE_ALPHA;
             break;
         case 'beta':
             $state = Tx_ExtensionBuilder_Domain_Model_Extension::STATE_BETA;
             break;
         case 'stable':
             $state = Tx_ExtensionBuilder_Domain_Model_Extension::STATE_STABLE;
             break;
         case 'experimental':
             $state = Tx_ExtensionBuilder_Domain_Model_Extension::STATE_EXPERIMENTAL;
             break;
         case 'test':
             $state = Tx_ExtensionBuilder_Domain_Model_Extension::STATE_TEST;
             break;
     }
     $extension->setState($state);
     if (!empty($propertyConfiguration['originalExtensionKey'])) {
         // handle renaming of extensions
         // original extensionKey
         $extension->setOriginalExtensionKey($propertyConfiguration['originalExtensionKey']);
         t3lib_div::devlog('Extension setOriginalExtensionKey:' . $extension->getOriginalExtensionKey(), 'extbase', 0, $propertyConfiguration);
     }
     if (!empty($propertyConfiguration['originalExtensionKey']) && $extension->getOriginalExtensionKey() != $extension->getExtensionKey()) {
         $settings = $this->configurationManager->getExtensionSettings($extension->getOriginalExtensionKey());
         // if an extension was renamed, a new extension dir is created and we
         // have to copy the old settings file to the new extension dir
         copy($this->configurationManager->getSettingsFile($extension->getOriginalExtensionKey()), $this->configurationManager->getSettingsFile($extension->getExtensionKey()));
     } else {
         $settings = $this->configurationManager->getExtensionSettings($extension->getExtensionKey());
     }
     if (!empty($settings)) {
         $extension->setSettings($settings);
         t3lib_div::devlog('Extension settings:' . $extension->getExtensionKey(), 'extbase', 0, $extension->getSettings());
     }
 }