Overview

Classes

  • Api1
  • Array1
  • ArrayObject1
  • Auth1
  • AuthModel1
  • Chat1
  • Class1
  • Color1
  • Console1
  • Controller1
  • Converter1
  • Cookie1
  • Date1
  • DateManager1
  • Db1
  • DbPref1
  • EasyBook
  • EasyCountry
  • EasyGenerator
  • EasyProduct
  • EasyProject
  • EasySchool
  • EasyStatus
  • exApiController1
  • exBlade1
  • exClass
  • exData1
  • exMail1
  • exRoute1
  • exTranslate1
  • exUrl1
  • FileManager1
  • FilePref1
  • Form1
  • Function1
  • Header1
  • Html1
  • HtmlAsset1
  • HtmlForm1
  • HtmlStyle1
  • HtmlWidget1
  • Math1
  • Model1
  • Model1FileLocator
  • Number1
  • Object1
  • Page1
  • Picture1
  • Popup1
  • QUESTION_TYPE
  • RecursiveArrayObject1
  • RegEx1
  • ResultObject1
  • ResultStatus1
  • ServerRequest1
  • Session1
  • SessionPreferenceSave1
  • String1
  • TaskManager1
  • Url1
  • Validation1
  • Value1

Interfaces

  • Controller1RouteInterface
  • Model1ActionInterface
  • Model1PageInterface

Functions

  • __
  • api_and_form_default_route
  • app
  • app_api_list
  • app_class_list
  • app_class_paths
  • app_class_with_interface
  • app_controller_list
  • app_dashboard_list
  • app_db_model_list
  • app_db_table_list
  • app_model_list
  • app_page_list
  • asset
  • csrf_token
  • current_layout_asset
  • current_plugin_asset
  • current_resources_asset_path
  • d
  • dd
  • file_base
  • file_session
  • file_session_get
  • file_session_remove
  • file_session_save
  • form_call_api
  • form_call_controller
  • form_token
  • get_all_view_in_directory
  • get_valid_view_path
  • is_token_valid
  • is_ajax_request
  • layout_asset
  • mailer
  • mailer_send_mail_to_list
  • make_default_route
  • makeRoute
  • normalizeSharedPath
  • now
  • now_date
  • now_time
  • old
  • paginate
  • path_app
  • path_asset
  • path_asset_url
  • path_clear_cache
  • path_main
  • path_main_url
  • path_shared
  • path_shared_app
  • path_shared_asset
  • path_shared_asset_url
  • path_shared_resources
  • path_to_viewpath
  • plugin_asset
  • pre
  • redirect
  • redirect_back
  • redirect_failed
  • redirect_to_view
  • register_path_for_layout_asset
  • request
  • resources_path
  • resources_path_asset
  • resources_path_cache
  • resources_path_plugin
  • resources_path_view
  • resources_path_view_cache
  • resources_path_view_layout
  • route
  • routes
  • shared_asset
  • token
  • translate_language
  • translated_language
  • url
  • view
  • view_exists
  • view_make
  • viewpath_to_path
  • Overview
  • Class

Class FileManager1

File System Management Class Class FileManager1

Located at easycore/Ehex.php
Methods summary
public static array
# getDirectoryFiles( $path, boolean $supplyFullPath = true, callable $callBack = null )

Get All Data in Directory and pass to callback

Get All Data in Directory and pass to callback

Parameters

$path
$supplyFullPath
$callBack

Returns

array
public static array|string
# getDirectoriesFolders( string $path_orPaths = '.', string $prepend = '', string $append = '' )

Get Directory Folders

Get Directory Folders

Parameters

$path_orPaths
$prepend
$append

Returns

array|string
public static array
# getDirectoriesFiles( string $pathList = '.', array $filterExtension = array(), array $ignoreExtension = array(), integer $fileCount = -1, boolean $recursive = false )

Get all File in derectory

Get all File in derectory

Parameters

$pathList
$filterExtension
$ignoreExtension
$fileCount
$recursive

Returns

array
An array, item is a file
public static array
# getDirectoryFilesByExtension( $path = '', $ext = 'json' )

Get an array containing the path of all files in this repository

Get an array containing the path of all files in this repository

Returns

array
An array, item is a file
public static string
# getExtension( string $filename = '' )

Parameters

$filename

Returns

string
public static mixed|string
# getMimeType( string $extension = '' )

Mime Type

Mime Type

Parameters

$extension

Returns

mixed|string
public static string
# getFileAndType( $filePath, array $returnKeyMap = null )

File Icon

File Icon

Parameters

$filePath
$returnKeyMap

Returns

string
public static mixed|string
# getName( string $filePath = '' )

Get File Name

Get File Name

Parameters

$filePath

Returns

mixed|string
public static array
# getImageExtension( boolean $commonPictureImage = false )

File Extension

File Extension

Parameters

$commonPictureImage

Returns

array
public static array
# getDocumentExtension( boolean $common = false )

File Extension

File Extension

Parameters

$common

Returns

array
public static boolean
# isImageFile( $filename, boolean $commonPictureImage = false )

is File Image

is File Image

Parameters

$filename
$commonPictureImage

Returns

boolean
public static null|string
# getFileName( $path )

Parameters

$path

Returns

null|string
public static boolean|string
# getOnlyFileName( $path )

Parameters

$path

Returns

boolean|string
public static boolean|string
# getOnlyFilePath( $path )

Parameters

$path

Returns

boolean|string
public static boolean
# delete( $fileName )

Parameters

$fileName

Returns

boolean
public static
# deleteAll( $directory, $deleteDirectory = false )

Delete all files in directory recursively

Delete all files in directory recursively

public static
# normalizeFilePathSeparator( $file, $separator = '/' )
public static string
# relativePath( $fromHalfPath, $toFullPath, string $separator = DIRECTORY_SEPARATOR )

Return relative path between two sources

Return relative path between two sources

Parameters

$fromHalfPath
$toFullPath
$separator

Returns

string

$relative = getRelativePath('/var/www/example.com','/var/www/example.com/media/test.jpg'); Function will return /media/test.jpg.

public static boolean
# upload( $source_url, $destination, boolean $shouldCompressIfCompressible = true )

Parameters

$source_url
$destination
$shouldCompressIfCompressible

Returns

boolean
public static boolean
# generateDirectories( string $basePath = '\\', array $relativePathList = ['web'=>['js','css']] )

Generate directory structure

Generate directory structure

Parameters

$basePath
, path where all directories will be created in
$relativePathList
, recursive array in structure of directories

Returns

boolean
public static
# createDirectory( $path = '\\' )
public static boolean
# write( string $path, string $contents )

Writes data to the filesystem.

Writes data to the filesystem.

Parameters

$path
The absolute file path to write to
$contents
The contents of the file to write

Returns

boolean
Returns true if write was successful, false if not.
public static
# read( $path )

read file

read file

public static
# loadComposerPackage( $dir )
public static boolean
# validateFileName( string $name, boolean $convertToSafeFilenameIfFailed = false )

Validates the name of the file to ensure it can be stored in the filesystem.

Validates the name of the file to ensure it can be stored in the filesystem.

Parameters

$name
The name to validate against
$convertToSafeFilenameIfFailed
$safe_filename Allows filename to be converted if fails validation

Returns

boolean
Returns true if valid. Throws an exception if not.
public static
# autoClassRecursiveLoad( $initPathList = 'app' )
API documentation generated by ApiGen