PluginProbe
TablePress – Tables in WordPress made easy / 3.2.2
TablePress – Tables in WordPress made easy v3.2.2
3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 All 44 releases
tablepress / classes / class-import-file.php

class-import-file.php in TablePress – Tables in WordPress made easy 3.2.2, at classes/class-import-file.php

84 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * TablePress Table Import File Class
4 *
5 * @package TablePress
6 * @subpackage Import
7 * @author Tobias Bäthge
8 * @since 2.3.0
9 */
10
11 namespace TablePress\Import;
12
13 // Prohibit direct script loading.
14 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
15
16 /**
17 * TablePress Table Import File Class
18 *
19 * @package TablePress
20 * @subpackage Import
21 * @author Tobias Bäthge
22 * @since 2.3.0
23 */
24 class File {
25
26 /**
27 * Local file path location of the file to import.
28 *
29 * @since 2.3.0
30 */
31 public string $location = '';
32
33 /**
34 * File extension of the file to import.
35 *
36 * @since 2.3.0
37 */
38 public string $extension = '';
39
40 /**
41 * MIME type of the file to import.
42 *
43 * @since 2.3.0
44 */
45 public string $mime_type = '';
46
47 /**
48 * Name of the file to import, used as the table name.
49 *
50 * @since 2.3.0
51 */
52 public string $name = '';
53
54 /**
55 * Error code related to the import of the file.
56 *
57 * @since 2.3.0
58 */
59 public ?\WP_Error $error = null;
60
61 /**
62 * Whether the file should be kept or deleted after import.
63 *
64 * @since 2.3.0
65 */
66 public bool $keep_file = false;
67
68 /**
69 * Creates a new File object, from an array of file properties.
70 *
71 * @since 1.0.0
72 *
73 * @param array<string, string|bool|\WP_Error> $properties Array of file properties.
74 */
75 public function __construct( array $properties ) {
76 foreach ( $properties as $property => $value ) {
77 if ( property_exists( $this, $property ) ) {
78 $this->$property = $value;
79 }
80 }
81 }
82
83 } // class File
84