Subversion Repositories SmartDukaan

Rev

Rev 14818 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
class ActivationcodeShell extends AppShell {
    public $uses = array('ActivationCode');

    public function main() {
                $file = fopen("codes.csv","r");
                while(! feof($file)) {
                        $row = fgetcsv($file);
                        //print_r($row[0]);
                        $this->ActivationCode->create();
                        try { 
                                $this->ActivationCode->save(array('code' => $row[0]));  
                        }catch(Exception $ex) {
                                $this->out($ex->getMessage());
                        }
                }
    }
}