@@ 30-96 (lines=67) @@ | ||
27 | use \HOWI3\libhowi\Filesystem\Commons\ObjectInterfaces\FileInterface; |
|
28 | use \HOWI3\libhowi\Filesystem\php5\TraitForSharedMethods; |
|
29 | ||
30 | class FileObject extends SplFileObject implements FileInterface |
|
31 | { |
|
32 | use TraitForSharedMethods; |
|
33 | ||
34 | /** |
|
35 | * |
|
36 | * {@inheritDoc} |
|
37 | * |
|
38 | */ |
|
39 | public function getLinkTarget() |
|
40 | { |
|
41 | return false; |
|
42 | } |
|
43 | ||
44 | /** |
|
45 | * |
|
46 | * {@inheritDoc} |
|
47 | * |
|
48 | */ |
|
49 | public function flock($operation, &$wouldblock = NULL) |
|
50 | { |
|
51 | return ! $wouldblock ? parent::flock($operation) : parent::flock($operation, $wouldblock); |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * |
|
56 | * {@inheritDoc} |
|
57 | * |
|
58 | */ |
|
59 | public function hasChildren() |
|
60 | { |
|
61 | return false; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * |
|
66 | * {@inheritDoc} |
|
67 | * |
|
68 | */ |
|
69 | public function getChildren() |
|
70 | { |
|
71 | return false; |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * |
|
76 | * {@inheritDoc} |
|
77 | * |
|
78 | */ |
|
79 | public function isDot() |
|
80 | { |
|
81 | return false; |
|
82 | } |
|
83 | ||
84 | /** |
|
85 | * Dummy file scale up to x bytes |
|
86 | * @param int $size |
|
87 | */ |
|
88 | public function dummyScale($size) |
|
89 | { |
|
90 | if(!is_int($size) || $this->getSize() > $size) return false; |
|
91 | ||
92 | $this->fseek($size ,SEEK_SET); |
|
93 | $this->fwrite(' '); |
|
94 | return true; |
|
95 | } |
|
96 | } |
|
97 |
@@ 30-96 (lines=67) @@ | ||
27 | use \HOWI3\libhowi\Filesystem\Commons\ObjectInterfaces\FileInterface; |
|
28 | use \HOWI3\libhowi\Filesystem\php7\TraitForSharedMethods; |
|
29 | ||
30 | class FileObject extends SplFileObject implements FileInterface |
|
31 | { |
|
32 | use TraitForSharedMethods; |
|
33 | ||
34 | /** |
|
35 | * |
|
36 | * {@inheritDoc} |
|
37 | * |
|
38 | */ |
|
39 | public function getLinkTarget() |
|
40 | { |
|
41 | return false; |
|
42 | } |
|
43 | ||
44 | /** |
|
45 | * |
|
46 | * {@inheritDoc} |
|
47 | * |
|
48 | */ |
|
49 | public function flock($operation, &$wouldblock = NULL) |
|
50 | { |
|
51 | return ! $wouldblock ? parent::flock($operation) : parent::flock($operation, $wouldblock); |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * |
|
56 | * {@inheritDoc} |
|
57 | * |
|
58 | */ |
|
59 | public function hasChildren() |
|
60 | { |
|
61 | return false; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * |
|
66 | * {@inheritDoc} |
|
67 | * |
|
68 | */ |
|
69 | public function getChildren() |
|
70 | { |
|
71 | return false; |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * |
|
76 | * {@inheritDoc} |
|
77 | * |
|
78 | */ |
|
79 | public function isDot() |
|
80 | { |
|
81 | return false; |
|
82 | } |
|
83 | ||
84 | /** |
|
85 | * Dummy file scale up to x bytes |
|
86 | * @param int $size |
|
87 | */ |
|
88 | public function dummyScale($size) |
|
89 | { |
|
90 | if(!is_int($size) || $this->getSize() > $size) return false; |
|
91 | ||
92 | $this->fseek($size ,SEEK_SET); |
|
93 | $this->fwrite(' '); |
|
94 | return true; |
|
95 | } |
|
96 | } |
|
97 |