PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.1
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.1
3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 2.8.17 2.8.18 All 259 releases
wpfunnels / vendor / intervention / image / src / Intervention / Image / File.php

File.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.1, at vendor/intervention/image/src/Intervention/Image/File.php

93 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Intervention\Image;
4
5 class File
6 {
7 /**
8 * Mime type
9 *
10 * @var string
11 */
12 public $mime;
13
14 /**
15 * Name of directory path
16 *
17 * @var string
18 */
19 public $dirname;
20
21 /**
22 * Basename of current file
23 *
24 * @var string
25 */
26 public $basename;
27
28 /**
29 * File extension of current file
30 *
31 * @var string
32 */
33 public $extension;
34
35 /**
36 * File name of current file
37 *
38 * @var string
39 */
40 public $filename;
41
42 /**
43 * Sets all instance properties from given path
44 *
45 * @param string $path
46 */
47 public function setFileInfoFromPath($path)
48 {
49 $info = pathinfo($path);
50 $this->dirname = array_key_exists('dirname', $info) ? $info['dirname'] : null;
51 $this->basename = array_key_exists('basename', $info) ? $info['basename'] : null;
52 $this->extension = array_key_exists('extension', $info) ? $info['extension'] : null;
53 $this->filename = array_key_exists('filename', $info) ? $info['filename'] : null;
54
55 if (file_exists($path) && is_file($path)) {
56 $this->mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);
57 }
58
59 return $this;
60 }
61
62 /**
63 * Get file size
64 *
65 * @return mixed
66 */
67 public function filesize()
68 {
69 $path = $this->basePath();
70
71 if (file_exists($path) && is_file($path)) {
72 return filesize($path);
73 }
74
75 return false;
76 }
77
78 /**
79 * Get fully qualified path
80 *
81 * @return string
82 */
83 public function basePath()
84 {
85 if ($this->dirname && $this->basename) {
86 return ($this->dirname .'/'. $this->basename);
87 }
88
89 return null;
90 }
91
92 }
93