2.2 too
git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.2@825 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
		
							parent
							
								
									51f6c486a2
								
							
						
					
					
						commit
						f8b414a15f
					
				@ -12,28 +12,40 @@ class ExtensionInfo { // {{{
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	function ExtensionInfo($main) {
 | 
						function ExtensionInfo($main) {
 | 
				
			||||||
		$matches = array();
 | 
							$matches = array();
 | 
				
			||||||
		$data = file_get_contents($main);
 | 
							$lines = file($main);
 | 
				
			||||||
		preg_match("#contrib/(.*)/main.php#", $main, $matches);
 | 
							preg_match("#contrib/(.*)/main.php#", $main, $matches);
 | 
				
			||||||
		$this->ext_name = $matches[1];
 | 
							$this->ext_name = $matches[1];
 | 
				
			||||||
		$this->name = $matches[1];
 | 
							$this->name = $this->ext_name;
 | 
				
			||||||
 | 
					 | 
				
			||||||
		if(preg_match("/Name: (.*)/", $data, $matches)) {
 | 
					 | 
				
			||||||
			$this->name = $matches[1];
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if(preg_match("/Link: (.*)/", $data, $matches)) {
 | 
					 | 
				
			||||||
			$this->link = $matches[1];
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if(preg_match("/Author: (.*) [<\(](.*@.*)[>\)]/", $data, $matches)) {
 | 
					 | 
				
			||||||
			$this->author = $matches[1];
 | 
					 | 
				
			||||||
			$this->email = $matches[2];
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		else if(preg_match("/Author: (.*)/", $data, $matches)) {
 | 
					 | 
				
			||||||
			$this->author = $matches[1];
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if(preg_match("/Description: (.*)/", $data, $matches)) {
 | 
					 | 
				
			||||||
			$this->description = $matches[1];
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		$this->enabled = $this->is_enabled($this->ext_name);
 | 
							$this->enabled = $this->is_enabled($this->ext_name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for($i=0; $i<count($lines); $i++) {
 | 
				
			||||||
 | 
								$line = $lines[$i];
 | 
				
			||||||
 | 
								if(preg_match("/Name: (.*)/", $line, $matches)) {
 | 
				
			||||||
 | 
									$this->name = $matches[1];
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if(preg_match("/Link: (.*)/", $line, $matches)) {
 | 
				
			||||||
 | 
									$this->link = $matches[1];
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if(preg_match("/Author: (.*) [<\(](.*@.*)[>\)]/", $line, $matches)) {
 | 
				
			||||||
 | 
									$this->author = $matches[1];
 | 
				
			||||||
 | 
									$this->email = $matches[2];
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								else if(preg_match("/Author: (.*)/", $line, $matches)) {
 | 
				
			||||||
 | 
									$this->author = $matches[1];
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if(preg_match("/(.*)Description: (.*)/", $line, $matches)) {
 | 
				
			||||||
 | 
									$this->description = $matches[2];
 | 
				
			||||||
 | 
									$start = $matches[1]." ";
 | 
				
			||||||
 | 
									$start_len = strlen($start);
 | 
				
			||||||
 | 
									while(substr($lines[$i+1], 0, $start_len) == $start) {
 | 
				
			||||||
 | 
										$this->description .= substr($lines[$i+1], $start_len);
 | 
				
			||||||
 | 
										$i++;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if(preg_match("/\*\//", $line, $matches)) {
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private function is_enabled($fname) {
 | 
						private function is_enabled($fname) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user