Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.43 KB | None | 0 0
  1. <?php                                                                                                                  
  2.                                                                                                                        
  3. define(VAP_FILE_LOCATION, 'vapdir/vaprun.txt');                                                                        
  4.                                                                                                                        
  5. class VapParameters                                                                                                    
  6. {                                                                                                                      
  7.   public function __construct()                                                                                        
  8.   {                                                                                                                    
  9.     $this->init();                                                                                                    
  10.   }                                                                                                                    
  11.                                                                                                                        
  12.   private function init()                                                                                              
  13.   {                                                                                                                    
  14.     // Open vaprun.txt                                                                                                
  15.     $lines = file(VAP_FILE_LOCATION);                                                                                  
  16.                                                                                                                        
  17.     // Read each line and split using ',' as the delimiter.                                                            
  18.     foreach ($lines as $l) {                                                                                          
  19.       list ($key, $value) = explode(',', trim($l));                                                                    
  20.       $vap_parameters[$key] = $value;                                                                                  
  21.     }                                                                                                                  
  22.                                                                                                                        
  23.     print_r($vap_parameters);                                                                                          
  24.   }                                                                                                                    
  25.                                                                                                                        
  26.   private $vap_parameters;                                                                                            
  27.                                                                                                                        
  28. };                                                                                                                    
  29.                                                                                                                        
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement