public function saveSnapshot($dir){
        
        if(!is_dir($dir)){
            mkdir($dir, 0775, true);
        }
        
        $jpeg = $this->takeSnapShot();
        $file = $dir.'/'.date('Y_m_d_H_i_s').'.jpg';
        if(file_put_contents($file, $jpeg)){
            return $file;
        }
        
        return '';
    }
public function saveSnapshot($dir){
        
        if(!is_dir($dir)){
            mkdir($dir, 0775, true);
        }
        
        $jpeg = $this->takeSnapShot();
        $file = $dir.'/'.date('Y_m_d_H_i_s').'.jpg';
        if(file_put_contents($file, $jpeg)){
            return $file;
        }
        
        return '';
    }
public function saveSnapshot ( $ dir ) { if ( ! is_dir ( $ dir ) ) { mkdir ( $ dir , 0775 , true ) ; } $ jpeg = $ this -> takeSnapShot ( ) ; $ file = $ dir . '/' . date ( 'Y_m_d_H_i_s' ) . '.jpg' ; if ( file_put_contents ( $ file , $ jpeg ) ) { return $ file ; } return '' ; }
Retrieves and stores a snapshot by date
@param type $dir
@return string Path if saved, empty string if not
Retrieves and stores a snapshot by date