forked from horde/components
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWrapper.php
74 lines (66 loc) · 1.66 KB
/
Wrapper.php
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
/**
* Copyright 2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @category Horde
* @package Components
* @author Jan Schneider <[email protected]>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
namespace Horde\Components;
/**
* Interface for the component file wrappers.
*
* @category Horde
* @package Components
* @author Jan Schneider <[email protected]>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
interface Wrapper
{
/**
* Returns the full path to the file.
*
* @return string Path to the file.
*/
public function getFullPath();
/**
* Returns the local path to the file inside the package.
*
* @param string $dir The package directory.
*
* @return string Path to the file.
*/
public function getLocalPath($dir);
/**
* Returns the file name.
*
* @return string The file name.
*/
public function getFileName();
/**
* Returns whether the file exists.
*
* @return boolean True if the file exists.
*/
public function exists();
/**
* Returns a diff between the saved and the current version of the file.
*
* @param Wrapper $wrapper Use this instead of the saved version.
*
* @return string File diff.
*/
public function diff(self $wrapper = null);
/**
* Saves this object to the file.
*/
public function save();
/**
* Returns the file contents.
*/
public function __toString(): string;
}