Changeset 302


Ignore:
Timestamp:
02/24/10 13:28:02 (11 years ago)
Author:
sander
Message:

Save validator responses to files

Location:
trunk/server/www/app/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/www/app/models/request.php

    r301 r302  
    360360 
    361361                        // Save the Markdown version to file 
    362                         $root = $this->field('root'); 
    363                         file_put_contents(FILES . $root . DS . 'description.txt', $this->data['Request']['description']); 
     362                        $path = FILES . $this->field('root') . DS . 'description.txt'; 
     363                        file_put_contents($path, $this->data['Request']['description']); 
    364364                } 
    365365 
  • trunk/server/www/app/models/validator.php

    r285 r302  
    5555                        $this->Request->id = $this->data['Request']['id']; 
    5656                        $file = $this->Request->getPath(); 
     57                        $destination = $this->data['Request']['path']; 
    5758                } else { 
    5859                        $this->Result->id = $this->data['Result']['id']; 
    5960                        $file = $this->Result->getPath(); 
     61                        $destination = $this->data['Result']['path']; 
    6062                } 
    6163 
     
    6870                $validator = new $className(); 
    6971                $validator->run($file); 
     72 
     73                // Save the validator result to file 
     74                $destination = FILES . $destination . DS . strtolower($this->data['Validator']['name']) . '-validator.' . $validator->ext; 
     75                file_put_contents($destination, $validator->response); 
     76 
     77                // Save the validator result to the satabase 
    7078                $this->data['Validator']['state']    = $validator->state; 
    7179                $this->data['Validator']['response'] = $validator->response; 
     
    8795        /** @var string Path to validator.pl */ 
    8896        private $bin = false; 
     97 
     98        /** @var string file extension for the response */ 
     99        public $ext = 'txt'; 
    89100 
    90101        /** 
     
    165176        public $response = false; 
    166177 
     178        /** @var string file extension for the response */ 
     179        public $ext = 'html'; 
     180 
    167181        /** 
    168182         * Run the validator 
     
    232246        /** @var string The validator's full response */ 
    233247        public $response = false; 
     248 
     249        /** @var string file extension for the response */ 
     250        public $ext = 'txt'; 
    234251 
    235252        /** 
Note: See TracChangeset for help on using the changeset viewer.