public function startPoll($id, $size)
    {
        if ($size > 12) $size = 12;
        $this->state->poll = array(
            'id' => $id,
            'size' => $size,
            'opened' => 1,
            'answers' => array()
        );
        $voteDir = $this->state->directory . '/votes';
        if (is_dir($voteDir)) {
            foreach (scanDir($voteDir) as $file) {
                if ($file != '.' && $file != '..') {
                    unlink($voteDir . '/' . $file);
                }
            }
        } else {
            mkdir($voteDir);
        }
        $this->state->persistPoll();
    }
public function startPoll($id, $size)
    {
        if ($size > 12) $size = 12;
        $this->state->poll = array(
            'id' => $id,
            'size' => $size,
            'opened' => 1,
            'answers' => array()
        );
        $voteDir = $this->state->directory . '/votes';
        if (is_dir($voteDir)) {
            foreach (scanDir($voteDir) as $file) {
                if ($file != '.' && $file != '..') {
                    unlink($voteDir . '/' . $file);
                }
            }
        } else {
            mkdir($voteDir);
        }
        $this->state->persistPoll();
    }
public function startPoll ( $ id , $ size ) { if ( $ size > 12 ) $ size = 12 ; $ this -> state -> poll = array ( 'id' => $ id , 'size' => $ size , 'opened' => 1 , 'answers' => array ( ) ) ; $ voteDir = $ this -> state -> directory . '/votes' ; if ( is_dir ( $ voteDir ) ) { foreach ( scanDir ( $ voteDir ) as $ file ) { if ( $ file != '.' && $ file != '..' ) { unlink ( $ voteDir . '/' . $ file ) ; } } } else { mkdir ( $ voteDir ) ; } $ this -> state -> persistPoll ( ) ; }
Starts a poll
Starts a poll