Esempio n. 1
0
 /**
  * finish method
  * @throws Error
  * */
 private static function finish()
 {
     if (self::validate()) {
         $imgName = self::$name;
         self::$name = self::$randomName ? Generate::token(13) . "_VarYan`s_" . Generate::token(13) . '.' . self::$ext : self::$name;
         if (move_uploaded_file(self::$tmp_name, self::$path . self::$name)) {
             self::$multiNames[] = self::$name;
         } else {
             throw new Error('canNotUploadFile', array('error' => 'Can not upload file', 'fileName' => $imgName));
         }
     } else {
         throw new Error('canNotUploadFile', array('error' => 'Can not upload file ' . self::$name));
     }
 }
Esempio n. 2
0
<?php

/**
 * Created by PhpStorm.
 * User: design
 * Date: 12/22/2015
 * Time: 3:42 PM
 */
$session = array('encryption_key' => \System\Core\Helpers\Other\Generate::token(32), 'expire_time' => 20);