Overview

Namespaces

  • GLFramework
    • Cache
    • Controller
    • DaMa
      • Manipulators
    • Database
    • HTTP
    • Mail
    • Middleware
    • Model
    • Module
    • Tests
    • Upload
    • Utils
  • None

Classes

  • GLFramework\Bootstrap
  • GLFramework\Cache\Cache
  • GLFramework\Cache\MemcachedCache
  • GLFramework\Cache\MemoryCache
  • GLFramework\Controller
  • GLFramework\Controller\AdminController
  • GLFramework\Controller\APIController
  • GLFramework\Controller\AuthController
  • GLFramework\Controller\ErrorController
  • GLFramework\Controller\ExceptionController
  • GLFramework\DaMa\Association
  • GLFramework\DaMa\DataManipulation
  • GLFramework\DaMa\Manipulator
  • GLFramework\DaMa\Manipulators\CSVManipulator
  • GLFramework\DaMa\Manipulators\ManipulatorCore
  • GLFramework\DaMa\Manipulators\XLSManipulator
  • GLFramework\DaMa\Manipulators\XLSXManipulator
  • GLFramework\Database\Connection
  • GLFramework\Database\MySQLConnection
  • GLFramework\DatabaseManager
  • GLFramework\DBStructure
  • GLFramework\Events
  • GLFramework\Filesystem
  • GLFramework\HTTP\API
  • GLFramework\Log
  • GLFramework\Mail
  • GLFramework\Mail\Mail
  • GLFramework\Mail\MailSystem
  • GLFramework\Mail\PHPMailer
  • GLFramework\MailView
  • GLFramework\Middleware\APIAuthorizationMiddleware
  • GLFramework\Middleware\ControllerMiddleware
  • GLFramework\Model
  • GLFramework\Model\Page
  • GLFramework\Model\User
  • GLFramework\Model\UserPage
  • GLFramework\ModelResult
  • GLFramework\Module\Module
  • GLFramework\Module\ModuleManager
  • GLFramework\Request
  • GLFramework\Response
  • GLFramework\Tests\DatabaseTestCase
  • GLFramework\Tests\TestCase
  • GLFramework\Upload\Upload
  • GLFramework\Upload\Uploads
  • GLFramework\Utils\DataTablesManager
  • GLFramework\Versions
  • GLFramework\View

Interfaces

  • GLFramework\Middleware

Functions

  • array_merge_recursive_ex
  • e
  • file_get_php_classes
  • fix_date
  • fix_date_format
  • fix_decimal
  • fix_url
  • get
  • get_php_classes
  • http_response_code
  • instance_method
  • is_module_enabled
  • now
  • post
  • print_array
  • print_brief_debug
  • print_debug
  • random_str
  • reArrayFiles
  • reArrayPost
  • today
  • Overview
  • Namespace
  • Class
 1: <?php
 2: /**
 3:  * Created by PhpStorm.
 4:  * User: manus
 5:  * Date: 7/03/16
 6:  * Time: 9:53
 7:  */
 8: 
 9: namespace GLFramework\Upload;
10: 
11: 
12: class Upload
13: {
14: 
15:     var $upload;
16:     var $uploads;
17:     var $hash;
18:     /**
19:      * Upload constructor.
20:      * @param $uploads Uploads
21:      * @param $upload
22:      */
23:     public function __construct($uploads, $upload)
24:     {
25:         $this->uploads = $uploads;
26:         $this->upload = $upload;
27: 
28:         $this->hash = date("Y-m-d_H-i-s") . "_";
29:     }
30: 
31:     public function isMultiple()
32:     {
33:         return is_array($this->upload['name']);
34:     }
35: 
36:     public function getLength()
37:     {
38:         return count($this->upload['name']);
39:     }
40: 
41:     public function getFilename($index = null)
42:     {
43:         return $this->uploads->folder . "/" . $this->hash . $this->name($index);
44:     }
45: 
46:     public function getAbsolutePath($index = false)
47:     {
48:         return $this->uploads->dir . "/" . $this->getFilename($index);
49:     }
50: 
51:     public function move($index = false)
52:     {
53:         $source = $this->tmpName($index);
54:         $dest = $this->getAbsolutePath($index);
55:         return move_uploaded_file($source, $dest);
56:     }
57: 
58:     public function error($index = false)
59:     {
60:         if($index === false)
61:             return $this->upload['error'];
62:         return $this->upload['error'][$index];
63:     }
64: 
65:     public function name($index = false)
66:     {
67:         if($index === false)
68:             return $this->upload['name'];
69:         return $this->upload['name'][$index];
70:     }
71: 
72:     public function tmpName($index = false)
73:     {
74:         if($index === false)
75:             return $this->upload['tmp_name'];
76:         return $this->upload['tmp_name'][$index];
77:     }
78: 
79:     public function isEmpty($index = false)
80:     {
81:         return $this->error($index) == 4;
82:     }
83: 
84:     public function isSuccess($index = false)
85:     {
86:         return $this->error($index) == 0;
87:     }
88: 
89: }
API documentation generated by ApiGen