Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12741348
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
declare
(
strict_types
=
1
);
namespace
Keruald\OmniTools\IO
;
class
File
{
/**
* @var string
*/
private
$path
;
///
/// Constructors
///
public
function
__construct
(
string
$path
=
null
)
{
$this
->
path
=
$path
;
}
/**
* @return static
*/
public
static
function
from
(
string
$path
)
:
self
{
return
new
static
(
$path
);
}
///
/// Getters and setters
///
public
function
getPath
()
:
string
{
return
$this
->
path
;
}
public
function
setPath
(
string
$path
)
:
self
{
$this
->
path
=
$path
;
return
$this
;
}
///
/// File properties methods
///
public
function
exists
()
:
bool
{
return
file_exists
(
$this
->
path
);
}
public
function
isReadable
()
:
bool
{
return
is_readable
(
$this
->
path
);
}
public
function
getPathInfo
()
:
array
{
return
pathinfo
(
$this
->
path
);
}
public
function
getDirectory
()
:
string
{
return
pathinfo
(
$this
->
path
,
PATHINFO_DIRNAME
);
}
public
function
getFileName
()
:
string
{
return
pathinfo
(
$this
->
path
,
PATHINFO_BASENAME
);
}
public
function
getFileNameWithoutExtension
()
:
string
{
return
pathinfo
(
$this
->
path
,
PATHINFO_FILENAME
);
}
public
function
getExtension
()
:
string
{
return
pathinfo
(
$this
->
path
,
PATHINFO_EXTENSION
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 16, 13:25 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3160665
Default Alt Text
File.php (1 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment