2011-02-23 09:39:25
class bullshit {
 
    public $total_engineers;
    public $total_drinks;
    public $engineer = array();
    public $drink = array();
    public $path;
    private $io;
    private $errors = array();
 
    public function __construct($p) {
        $this->total_engineers = 0;
        $this->total_drinks = 0;
        $this->path = $p;
    }
 
    public function __readfile() {
        $this->io = fopen($this->path, "r") or die("aaa");
        flock($this->io, 2);
    }
 
    private function __setTotalDrinks($value)
    {
        $this->total_drinks = $value;
    }
 
    private function __setTotalEngineers($value)
    {
        $this->total_engineers = $value;
    }
 
    public function __readline($line) {
        $total_rows = 0;
        for ($i = 0; !feof($this->io); $i++) {
            $elementBySpace = fgetcsv($this->io, 1000, " ");
            $elementByTab = fgetcsv($this->io, 1000, "\t");
 
            if ($total_rows < $line) {
                if ($total_rows == 0) {
                    $this->__setTotalEngineers($elementBySpace[0]);
                    $this->__setTotalDrinks($elementBySpace[1]);
                } else if ($total_rows <= $this->total_drinks) {
                    array_push($this->drink,$elementByTab[1]);
                } else {
                    array_push($this->engineer,$elementByTab[1]);
                }
 
            }
            $total_rows++;
        }
    }
 
    public function __output()
    {
 
    }
 
}
Invalid Email or Password