model/modx/modstaticresource.class.php
- package
- modx
- Classes
- modStaticResource
Description
A derivative of modResource that stores content on the filesystem.
{@inheritdoc}
\modStaticResource
- Extends from
- \modResource
- package
- modx
- Properties
- $_sourceFile
- $_sourceFileSize
- $_sourcePath
- Methods
- __construct
- _bytes
- getContent
- getFileContent
- getSourceFile
- getSourceFileSize
Description
A derivative of modResource that stores content on the filesystem.
{@inheritdoc}
Properties
$_sourceFile
string $_sourceFile = ''
Details
- string
Path of the file containing the source content, relative to the {@link modStaticResource::$_sourcePath}. - visibility
- protected
- default
- final
- false
- static
- false
$_sourceFileSize
integer $_sourceFileSize = '0'
Details
- integer
Size of the source file content in bytes. - visibility
- protected
- default
- 0
- final
- false
- static
- false
$_sourcePath
string $_sourcePath = ''
Details
- string
An absolute base filesystem path where the source file exists. - visibility
- protected
- default
- final
- false
- static
- false
Methods
__construct
__construct(
\xPDO $xpdo
)
:
\xPDOObject
Creates a modTemplateVar instance, and sets the token of the class to *
{@inheritdoc}
Arguments
- $xpdo
- \xPDO
&$xpdo A reference to a valid xPDO instance.
Output
Details
- visibility
- public
- final
- false
- static
- false
_bytes
_bytes(
string $value
)
:
integer
Converts to bytes from PHP ini_get() format.
PHP ini modifiers for byte values:
- G = gigabytes
- M = megabytes
- K = kilobytes
Arguments
- $value
- string
Number of bytes represented in PHP ini value format.
Output
- integer
- The value converted to bytes.
Details
- visibility
- protected
- final
- false
- static
- false
- access
- protected
getContent
getContent(
array $options
=
array
)
:
string
Treats the local content as a filename to load the raw content from.
{@inheritdoc}
Arguments
- $options
- array
An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.
Output
- string
- The raw source content for the resource.
Details
- visibility
- public
- final
- false
- static
- false
getFileContent
getFileContent(
string $file, $options
=
array
)
:
string
Retrieve the resource content stored in a physical file.
Arguments
- $file
- string
A path to the file representing the resource content. - $options
Output
- string
- The content of the file, of false if it could not be retrieved.
Details
- visibility
- public
- final
- false
- static
- false
- access
- public
getSourceFile
getSourceFile(
array $options
=
array
)
:
string
Get the absolute path to the static source file represented by this instance.
Arguments
- $options
- array
An array of options.
Output
- string
- The absolute path to the static source file.
Details
- visibility
- public
- final
- false
- static
- false
getSourceFileSize
getSourceFileSize(
array $options
=
array
)
:
integer
Get the filesize of the static source file represented by this instance.
Arguments
- $options
- array
An array of options.
Output
- integer
- The filesize of the source file in bytes.
Details
- visibility
- public
- final
- false
- static
- false