1: <?php
2: /**
3: * An item returned from a folder list.
4: *
5: * Copyright 2002-2007 Jon Wood <jon@jellybob.co.uk>
6: *
7: * See the enclosed file COPYING for license information (LGPL). If you
8: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
9: *
10: * @author Jon Wood <jon@jellybob.co.uk>
11: * @package Vfs
12: */
13: class Horde_Vfs_ListItem
14: {
15: /**
16: * VFS path.
17: *
18: * @var string
19: */
20: protected $_path;
21:
22: /**
23: * Filename.
24: *
25: * @var string
26: */
27: protected $_name;
28:
29: /**
30: * File permissions (*nix format: drwxrwxrwx).
31: *
32: * @var string
33: */
34: protected $_perms;
35:
36: /**
37: * Owner user.
38: *
39: * @var string
40: */
41: protected $_owner;
42:
43: /**
44: * Owner group.
45: *
46: * @var string
47: */
48: protected $_group;
49:
50: /**
51: * Size.
52: *
53: * @var string
54: */
55: protected $_size;
56:
57: /**
58: * Last modified date.
59: *
60: * @var string
61: */
62: protected $_date;
63:
64: /**
65: * Type.
66: * <pre>
67: * .* - File extension
68: * **none - Unrecognized type
69: * **sym - Symlink
70: * **dir - Directory
71: * </pre>
72: *
73: * @var string
74: */
75: protected $_type;
76:
77: /**
78: * Type of target if type is '**sym'.
79: * NB. Not all backends are capable of distinguishing all of these.
80: * <pre>
81: * .* - File extension
82: * **none - Unrecognized type
83: * **sym - Symlink to a symlink
84: * **dir - Directory
85: * **broken - Target not found - broken link
86: * </pre>
87: *
88: * @var string
89: */
90: protected $_linktype;
91:
92: /**
93: * Constructor
94: *
95: * Requires the path to the file, and it's array of properties,
96: * returned from a standard Horde_Vfs::listFolder() call.
97: *
98: * @param string $path The path to the file.
99: * @param array $fileArray An array of file properties.
100: */
101: public function __construct($path, $fileArray)
102: {
103: $this->_path = $path . '/' . $fileArray['name'];
104: $this->_name = $fileArray['name'];
105: $this->_dirname = $path;
106: $this->_perms = $fileArray['perms'];
107: $this->_owner = $fileArray['owner'];
108: $this->_group = $fileArray['group'];
109: $this->_size = $fileArray['size'];
110: $this->_date = $fileArray['date'];
111: $this->_type = $fileArray['type'];
112: $this->_linktype = $fileArray['linktype'];
113: }
114:
115: }
116: