Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12870427
File.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
File.php
View Options
<?php
namespace
Keruald\OmniTools\Reflection
;
class
File
{
/**
* @var string
*/
private
$filename
;
///
/// Constructors
///
public
static
function
from
(
string
$filename
)
:
self
{
$instance
=
new
self
;
$instance
->
filename
=
$filename
;
return
$instance
;
}
///
/// Getters and setters
///
public
function
getFilename
()
:
string
{
return
$this
->
filename
;
}
public
function
setFilename
(
string
$filename
)
:
self
{
$this
->
filename
=
$filename
;
return
$this
;
}
///
/// File properties methods
///
public
function
exists
()
:
bool
{
return
file_exists
(
$this
->
filename
);
}
public
function
isReadable
()
:
bool
{
return
is_readable
(
$this
->
filename
);
}
///
/// Include methods
///
public
function
tryInclude
()
:
bool
{
if
(!
$this
->
canBeIncluded
())
{
return
false
;
}
include
(
$this
->
filename
);
return
true
;
}
public
function
canBeIncluded
()
:
bool
{
return
$this
->
exists
()
&&
$this
->
isReadable
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 17, 15:48 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3162634
Default Alt Text
File.php (1 KB)
Attached To
Mode
rKOT Keruald OmniTools
Attached
Detach File
Event Timeline
Log In to Comment