public function createManifestFile() {
		
		$app = Application::getInstance();
		
		// lambda method to add an array to the XML
		$addChildArray = function ($element, $list) use ($app, &$addChildArray) {
			
			foreach ($list as $name => $value) {
				
				// if is an array, run again recursively
				if (is_array($value)) {
					$listChild = $element->addChild($name);
					$addChildArray($listChild, $value);
				} else if (is_int($value) or is_string($value)) {
					$element->addChild($name, (string)$value);
				} else {
					$app->logError('Option item ' . $name . ' is not valid');
				}
			
			}
			
		};
		
		// prevent missing folders
		if (!is_dir($this->baseFolder)) {
			$app->logError('Folder ' . $this->baseFolder . ' of ' . $this->name . ' ' . $this->type . ' plugin cannot be accessed');
			return FALSE;
		}
	
		$manifest = new \SimpleXMLElement('<!DOCTYPE xml><manifest></manifest>');
	
		$plugin = $manifest->addChild('plugin');

		// plugin type
		$plugin->addAttribute('type', $this->type);
		
		// more infos
		$plugin->addChild('name',			$this->name);
		$plugin->addChild('folder',			basename($this->baseFolder));
		$plugin->addChild('version',		$this->version);
		$plugin->addChild('dateReleased',	$this->dateReleased);
		$plugin->addChild('appVersion',		$this->appVersion);
		
		// custom options
		$optionsChild = $plugin->addChild('options');
		
		// recursively add options elements
		$addChildArray($optionsChild, $this->options);
		
		// will contains all found files
		$filesChild = $plugin->addChild('files');
		
		// list all found files as multi-dimensional array
		$files = Utilities::getDirectoryFilenames($this->baseFolder);
		
		// adds file to <files> child
		foreach ($files as $file) {
			$filesChild->addChild('file', $file);
		}
	
		$filename = $this->baseFolder . '/manifest.xml';
		
		try {
			$res = $manifest->asXML($filename);
			$app->logEvent('Created manifest file ' . $filename . ' for ' . $this->type . ' plugin');
		} catch (\Exception $e) {
			$res = FALSE;
			$app->logError('Manifest file ' . $filename . ' creation failed for ' . $this->type . ' plugin: ' . $e->getMessage());
		}
		
		return $res;
	
	}
public function createManifestFile() {
		
		$app = Application::getInstance();
		
		// lambda method to add an array to the XML
		$addChildArray = function ($element, $list) use ($app, &$addChildArray) {
			
			foreach ($list as $name => $value) {
				
				// if is an array, run again recursively
				if (is_array($value)) {
					$listChild = $element->addChild($name);
					$addChildArray($listChild, $value);
				} else if (is_int($value) or is_string($value)) {
					$element->addChild($name, (string)$value);
				} else {
					$app->logError('Option item ' . $name . ' is not valid');
				}
			
			}
			
		};
		
		// prevent missing folders
		if (!is_dir($this->baseFolder)) {
			$app->logError('Folder ' . $this->baseFolder . ' of ' . $this->name . ' ' . $this->type . ' plugin cannot be accessed');
			return FALSE;
		}
	
		$manifest = new \SimpleXMLElement('<!DOCTYPE xml><manifest></manifest>');
	
		$plugin = $manifest->addChild('plugin');

		// plugin type
		$plugin->addAttribute('type', $this->type);
		
		// more infos
		$plugin->addChild('name',			$this->name);
		$plugin->addChild('folder',			basename($this->baseFolder));
		$plugin->addChild('version',		$this->version);
		$plugin->addChild('dateReleased',	$this->dateReleased);
		$plugin->addChild('appVersion',		$this->appVersion);
		
		// custom options
		$optionsChild = $plugin->addChild('options');
		
		// recursively add options elements
		$addChildArray($optionsChild, $this->options);
		
		// will contains all found files
		$filesChild = $plugin->addChild('files');
		
		// list all found files as multi-dimensional array
		$files = Utilities::getDirectoryFilenames($this->baseFolder);
		
		// adds file to <files> child
		foreach ($files as $file) {
			$filesChild->addChild('file', $file);
		}
	
		$filename = $this->baseFolder . '/manifest.xml';
		
		try {
			$res = $manifest->asXML($filename);
			$app->logEvent('Created manifest file ' . $filename . ' for ' . $this->type . ' plugin');
		} catch (\Exception $e) {
			$res = FALSE;
			$app->logError('Manifest file ' . $filename . ' creation failed for ' . $this->type . ' plugin: ' . $e->getMessage());
		}
		
		return $res;
	
	}
public function createManifestFile ( ) { $ app = Application :: getInstance ( ) ; // lambda method to add an array to the XML $ addChildArray = function ( $ element , $ list ) use ( $ app , & $ addChildArray ) { foreach ( $ list as $ name => $ value ) { // if is an array, run again recursively if ( is_array ( $ value ) ) { $ listChild = $ element -> addChild ( $ name ) ; $ addChildArray ( $ listChild , $ value ) ; } else if ( is_int ( $ value ) or is_string ( $ value ) ) { $ element -> addChild ( $ name , ( string ) $ value ) ; } else { $ app -> logError ( 'Option item ' . $ name . ' is not valid' ) ; } } } ; // prevent missing folders if ( ! is_dir ( $ this -> baseFolder ) ) { $ app -> logError ( 'Folder ' . $ this -> baseFolder . ' of ' . $ this -> name . ' ' . $ this -> type . ' plugin cannot be accessed' ) ; return FALSE ; } $ manifest = new \ SimpleXMLElement ( '<!DOCTYPE xml><manifest></manifest>' ) ; $ plugin = $ manifest -> addChild ( 'plugin' ) ; // plugin type $ plugin -> addAttribute ( 'type' , $ this -> type ) ; // more infos $ plugin -> addChild ( 'name' , $ this -> name ) ; $ plugin -> addChild ( 'folder' , basename ( $ this -> baseFolder ) ) ; $ plugin -> addChild ( 'version' , $ this -> version ) ; $ plugin -> addChild ( 'dateReleased' , $ this -> dateReleased ) ; $ plugin -> addChild ( 'appVersion' , $ this -> appVersion ) ; // custom options $ optionsChild = $ plugin -> addChild ( 'options' ) ; // recursively add options elements $ addChildArray ( $ optionsChild , $ this -> options ) ; // will contains all found files $ filesChild = $ plugin -> addChild ( 'files' ) ; // list all found files as multi-dimensional array $ files = Utilities :: getDirectoryFilenames ( $ this -> baseFolder ) ; // adds file to <files> child foreach ( $ files as $ file ) { $ filesChild -> addChild ( 'file' , $ file ) ; } $ filename = $ this -> baseFolder . '/manifest.xml' ; try { $ res = $ manifest -> asXML ( $ filename ) ; $ app -> logEvent ( 'Created manifest file ' . $ filename . ' for ' . $ this -> type . ' plugin' ) ; } catch ( \ Exception $ e ) { $ res = FALSE ; $ app -> logError ( 'Manifest file ' . $ filename . ' creation failed for ' . $ this -> type . ' plugin: ' . $ e -> getMessage ( ) ) ; } return $ res ; }
Creates or updates manifest.xml file for declare package content.

@return	bool
Creates or updates manifest . xml file for declare package content .