public function assemble() {
		$hashdata = '';
		$linker   = new Linker();
		$linker->setOutputPath($this->getPath());
		
		foreach ($this->resources as $resource) {
			$path      = $resource->getPath();
			$hashdata .= $path;
			
			$linker->append($path);
		}
		
		$hash = substr(md5($hashdata), 24);
		$meta = $this->getMetadata();
		
		if ($meta !== false && isset($meta->shash) && $meta->shash === $hash) {
			$linker->write();
			return;
		}
		
		// Update metadata
		$this->metadataManager->getMetadata($this, true);
		$this->metadataManager->setMetaParam($this, 'shash', $hash);
		
		// Force (re)assemble
		$linker->write(true);
	}
public function assemble() {
		$hashdata = '';
		$linker   = new Linker();
		$linker->setOutputPath($this->getPath());
		
		foreach ($this->resources as $resource) {
			$path      = $resource->getPath();
			$hashdata .= $path;
			
			$linker->append($path);
		}
		
		$hash = substr(md5($hashdata), 24);
		$meta = $this->getMetadata();
		
		if ($meta !== false && isset($meta->shash) && $meta->shash === $hash) {
			$linker->write();
			return;
		}
		
		// Update metadata
		$this->metadataManager->getMetadata($this, true);
		$this->metadataManager->setMetaParam($this, 'shash', $hash);
		
		// Force (re)assemble
		$linker->write(true);
	}
public function assemble ( ) { $ hashdata = '' ; $ linker = new Linker ( ) ; $ linker -> setOutputPath ( $ this -> getPath ( ) ) ; foreach ( $ this -> resources as $ resource ) { $ path = $ resource -> getPath ( ) ; $ hashdata .= $ path ; $ linker -> append ( $ path ) ; } $ hash = substr ( md5 ( $ hashdata ) , 24 ) ; $ meta = $ this -> getMetadata ( ) ; if ( $ meta !== false && isset ( $ meta -> shash ) && $ meta -> shash === $ hash ) { $ linker -> write ( ) ; return ; } // Update metadata $ this -> metadataManager -> getMetadata ( $ this , true ) ; $ this -> metadataManager -> setMetaParam ( $ this , 'shash' , $ hash ) ; // Force (re)assemble $ linker -> write ( true ) ; }
Assemble the package
Assemble the package