1 | <?php |
||
12 | class Stencil_Installable_Plugin extends Stencil_Abstract_Installable implements Stencil_Installable_Interface { |
||
13 | /** |
||
14 | * Download format. |
||
15 | */ |
||
16 | const DOWNLOAD_FORMAT = 'https://github.com/moorscode/%s/archive/master.zip'; |
||
17 | |||
18 | /** |
||
19 | * Required PHP version. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $required_php_version = '0.0.0'; |
||
24 | |||
25 | /** |
||
26 | * Stencil_Installable constructor. |
||
27 | * |
||
28 | * @param string $slug Slug of the module. |
||
29 | * @param string $name Name of this module. |
||
30 | * @param string $required_php_version Minimal PHP version required. |
||
31 | */ |
||
32 | public function __construct( $slug, $name, $required_php_version = '5.2.0' ) { |
||
36 | |||
37 | /** |
||
38 | * Get the download link |
||
39 | * |
||
40 | * @return bool|string |
||
41 | */ |
||
42 | public function get_download_link() { |
||
45 | |||
46 | /** |
||
47 | * Check if there is an upgrade available |
||
48 | * |
||
49 | * @return bool|mixed |
||
50 | */ |
||
51 | public function has_upgrade() { |
||
67 | |||
68 | /** |
||
69 | * Do all requirements pass so it is usable. |
||
70 | * |
||
71 | * @return bool|array TRUE if passed, array of errors if failed. |
||
72 | */ |
||
73 | public function passed_requirements() { |
||
82 | |||
83 | |||
84 | /** |
||
85 | * Get base directory |
||
86 | */ |
||
87 | public function get_directory() { |
||
90 | |||
91 | /** |
||
92 | * Get file headers |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | public function get_file_data() { |
||
101 | |||
102 | /** |
||
103 | * Upgrader |
||
104 | * |
||
105 | * @param bool $upgrading Upgrading or installing. |
||
106 | * |
||
107 | * @return Plugin_Upgrader |
||
108 | */ |
||
109 | public function get_upgrader( $upgrading = false ) { |
||
114 | } |
||
115 |