protected function validateFileExport()
    {
        $directory = gplcart_file_private_module('export');

        if (!file_exists($directory) && !mkdir($directory, 0775, true)) {
            $this->setError('file', $this->text('Unable to create @name', array('@name' => $directory)));
            return false;
        }

        $date = date('d-m-Y--H-i');
        $file = gplcart_file_unique("$directory/$date.csv");

        if (file_put_contents($file, '') === false) {
            $this->setError('file', $this->text('Unable to create @name', array('@name' => $file)));
            return false;
        }

        $this->setSubmitted('file', $file);
        return true;
    }
protected function validateFileExport()
    {
        $directory = gplcart_file_private_module('export');

        if (!file_exists($directory) && !mkdir($directory, 0775, true)) {
            $this->setError('file', $this->text('Unable to create @name', array('@name' => $directory)));
            return false;
        }

        $date = date('d-m-Y--H-i');
        $file = gplcart_file_unique("$directory/$date.csv");

        if (file_put_contents($file, '') === false) {
            $this->setError('file', $this->text('Unable to create @name', array('@name' => $file)));
            return false;
        }

        $this->setSubmitted('file', $file);
        return true;
    }
protected function validateFileExport ( ) { $ directory = gplcart_file_private_module ( 'export' ) ; if ( ! file_exists ( $ directory ) && ! mkdir ( $ directory , 0775 , true ) ) { $ this -> setError ( 'file' , $ this -> text ( 'Unable to create @name' , array ( '@name' => $ directory ) ) ) ; return false ; } $ date = date ( 'd-m-Y--H-i' ) ; $ file = gplcart_file_unique ( "$directory/$date.csv" ) ; if ( file_put_contents ( $ file , '' ) === false ) { $ this -> setError ( 'file' , $ this -> text ( 'Unable to create @name' , array ( '@name' => $ file ) ) ) ; return false ; } $ this -> setSubmitted ( 'file' , $ file ) ; return true ; }
Validates destination directory and file
@return boolean
Validates destination directory and file