Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12870854
FilesListingController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
977 B
Referenced Files
None
Subscribers
None
FilesListingController.php
View Options
<?php
class
FilesListingController
{
///
/// Private members and properties
///
/**
* QueryResult
* @var array
*/
private
$result
;
/**
* The directory to query
* @var string
*/
public
$directory
;
/**
* The extension of files to query
* @var string
*/
public
$extension
;
///
/// Construtor
///
public
function
__construct
(
$directory
,
$extension
)
{
$this
->
directory
=
$directory
;
$this
->
extension
=
$extension
;
}
///
/// Public methods
///
/**
* Queries the files
*
* @return FilesListing the current class instance
*/
public
function
query
()
{
$files
=
get_files
(
$this
->
directory
,
$this
->
extension
);
//Prepends URL directory
array_walk
(
$files
,
function
(&
$file
)
{
$file
=
get_url_for
(
$this
->
directory
,
$file
);
});
$this
->
result
=
$files
;
return
$this
;
}
/**
* Outputs the result
*/
public
function
show
()
{
header
(
"Content-Type: application/json"
);
echo
json_encode
(
$this
->
result
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 17, 15:59 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3166006
Default Alt Text
FilesListingController.php (977 B)
Attached To
Mode
rTOOLS Nasqueron Tools
Attached
Detach File
Event Timeline
Log In to Comment