Plugin.php
998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
namespace AC;
use AC\Asset\Location;
use AC\Plugin\Version;
class Plugin {
/**
* @var string
*/
private $file;
/**
* @var Version
*/
private $version;
/**
* @var string $file
* @var Version $version
*/
protected function __construct( $file, Version $version ) {
$this->file = (string) $file;
$this->version = $version;
}
/**
* @return string
*/
public function get_basename() {
return plugin_basename( $this->file );
}
/**
* @return string
*/
public function get_dir() {
return plugin_dir_path( $this->file );
}
/**
* @return string
*/
public function get_url() {
return plugin_dir_url( $this->file );
}
/**
* @return Version
*/
public function get_version() {
return $this->version;
}
/**
* @return Location\Absolute
*/
public function get_location() {
return new Location\Absolute(
$this->get_url(),
$this->get_dir()
);
}
/**
* @return void
* @deprecated
*/
public function install() {
}
}