APIBoost A.P.I. documentation for PHPBoost CMS
  • Packages
    • Ajax
    • Builder
    • Content
    • Core
    • Default
    • Doctrine
    • Helper
    • IO
    • MVC
    • PHPBoost
    • Util
  • Interfaces
  • Classes
  • CacheData
  • CaptchaOptions
  • CommentsExtensionPoint
  • ConfigData
  • ContentFormattingExtensionPoint
  • Controller
  • CssFilesExtensionPoint
  • DAO
  • DataStore
  • DBConnection
  • DBMSFactory
  • DBMSUtils
  • ExtendedFieldExtensionPoint
  • ExtensionPoint
  • ExternalAuthentication
  • FeedProvider
  • FileReader
  • FileWriter
  • FormattingParser
  • FormButton
  • FormConstraint
  • FormElement
  • FormField
  • FormFieldConstraint
  • FormFieldEnumOption
  • FormFieldset
  • GraphicalEnvironment
  • HomePage
  • HomePageExtensionPoint
  • HTMLElement
  • HTMLTableFilter
  • InjectQueryResult
  • MailService
  • MemberExtendedFieldType
  • MenusExtensionPoint
  • ModuleSetup
  • ModuleTreeLinksExtensionPoint
  • PropertiesMapInterface
  • QueryResult
  • Response
  • ScheduledJobExtensionPoint
  • SearchableExtensionPoint
  • SelectQueryResult
  • SQLFragmentBuilder
  • SQLQuerier
  • SQLQueryTranslator
  • Template
  • TemplateData
  • TemplateLoader
  • TemplateParser
  • TemplateRenderer
  • TemplateSyntaxElement
  • UrlMapper
  • UrlMappingsExtensionPoint
  • View
  • AbstractAdminItemController
  • AbstractCategoriesFormController
  • AbstractCategoriesManagementController
  • AbstractCommentsBuildForm
  • AbstractCommentsController
  • AbstractConfigData
  • AbstractContentFormattingExtensionPoint
  • AbstractController
  • AbstractDeleteCategoryController
  • AbstractDisplayGraphicalEnvironment
  • AbstractFormButton
  • AbstractFormField
  • AbstractFormFieldChoice
  • AbstractFormFieldConstraint
  • AbstractFormFieldEnumOption
  • AbstractFormFieldset
  • AbstractGraphicalEnvironment
  • AbstractHTMLElement
  • AbstractHTMLTableFilter
  • AbstractItemController
  • AbstractMemberExtendedField
  • AbstractParser
  • AbstractPHPMailerMailService
  • AbstractPlatform
  • AbstractQueryResult
  • AbstractResponse
  • AbstractScheduledJobExtensionPoint
  • AbstractSearchableExtensionPoint
  • AbstractSelectQueryResult
  • AbstractSQLQuerier
  • AbstractTemplate
  • AbstractTemplateParser
  • AbstractTemplateSyntaxElement
  • AbstractUrlMapper
  • ActionAuthorization
  • AddCommentBuildForm
  • AdminController
  • AdminDisplayFrameGraphicalEnvironment
  • AdminDisplayFrameResponse
  • AdminDisplayGraphicalEnvironment
  • AdminDisplayResponse
  • AdministratorAlert
  • AdministratorAlertCache
  • AdministratorAlertService
  • AdminMenuDisplayResponse
  • AdminModuleController
  • AdminModuleLink
  • AdminNodisplayGraphicalEnvironment
  • AdminNodisplayResponse
  • AjaxCommentsDisplayController
  • AjaxCommentsNotationController
  • AjaxImagePreviewController
  • AjaxKeywordsAutoCompleteController
  • AjaxRequest
  • AjaxSearchUserAutoCompleteController
  • AjaxUrlValidationController
  • AjaxUserAutoCompleteController
  • APCDataStore
  • AppContext
  • Application
  • ArrayContentTemplateSyntaxElement
  • Arrays
  • ArrayTemplateSyntaxElement
  • ArrayType
  • ATOM
  • AuthenticationMethod
  • AuthenticationService
  • Authorizations
  • AuthorizationsSettings
  • AutoConnectData
  • BBCodeHighlighter
  • Bench
  • BigIntType
  • BooleanType
  • BreadCrumb
  • BrHTMLElement
  • BufferedFileReader
  • BufferedFileWriter
  • BusinessObject
  • CacheDataNotFoundException
  • CachedMenu
  • CachedStringTemplateLoader
  • CacheManager
  • CacheService
  • Captcha
  • CaptchaProvidersService
  • CaptchaService
  • CategoriesAuthorizationsService
  • CategoriesCache
  • CategoriesItemsParameters
  • CategoriesManager
  • CategoriesService
  • CategoriesUrlBuilder
  • Category
  • CategoryNotFoundException
  • ClassLoader
  • ColumnsDisabled
  • CommentsAuthorizations
  • CommentsCache
  • CommentsConfig
  • CommentsDAO
  • CommentsManager
  • CommentsProvidersService
  • CommentsService
  • CommentsTopic
  • CommentsTopicDAO
  • CommentsTopicEvents
  • CommentsTopics
  • CommentsUrlBuilder
  • ConditionTemplateSyntaxElement
  • ConfigManager
  • ConfigNotFoundException
  • ConstantTemplateSyntaxElement
  • ContentEditor
  • ContentFormattingConfig
  • ContentFormattingParser
  • ContentFormattingProvidersService
  • ContentFormattingService
  • ContentFormattingUnparser
  • ContentManagementConfig
  • ContentMenu
  • ContentSecondParser
  • ContentSharingActionsMenuLink
  • ContentSharingActionsMenuLinksExtensionPoint
  • ContentSharingActionsMenuService
  • Contribution
  • ContributionService
  • CookieBarConfig
  • Countries
  • CSSCacheConfig
  • CSSCacheManager
  • CSSFileOptimizer
  • CurrentUser
  • CustomizationConfig
  • CustomizeInterface
  • DataStoreException
  • DataStoreFactory
  • Date
  • DateTimeType
  • DateType
  • DBConnectionException
  • DBFactory
  • DBQuerier
  • Debug
  • DecimalType
  • DefaultAdminDisplayResponse
  • DefaultAjaxDeleteItemController
  • DefaultCategoriesCache
  • DefaultCategoriesFeedProvider
  • DefaultCategoriesFormController
  • DefaultCategoriesManagementController
  • DefaultCommentsTopic
  • DefaultConfigurationController
  • DefaultDeleteCategoryController
  • DefaultDeleteItemController
  • DefaultDisplayItemController
  • DefaultHomePage
  • DefaultHomePageDisplay
  • DefaultItemsManagementController
  • DefaultMailService
  • DefaultModuleConfig
  • DefaultModuleSetup
  • DefaultRichCategoriesCache
  • DefaultRichModuleConfig
  • DefaultScheduledJobsModule
  • DefaultSearchable
  • DefaultSeveralItemsController
  • DefaultSitemapCategoriesModule
  • DefaultSitemapModule
  • DefaultTemplateData
  • DefaultTemplateRenderer
  • DefaultTreeLinks
  • DeleteLinkHTMLElement
  • Dispatcher
  • DispatcherException
  • DispatcherUrlMapping
  • DispatchManager
  • DivHTMLElement
  • DoctrineException
  • EditCommentBuildForm
  • EditLinkHTMLElement
  • Environment
  • ErrorHandler
  • Event
  • ExceptionHandler
  • ExceptionUtils
  • ExpressionContentTemplateSyntaxElement
  • ExpressionTemplateSyntaxElement
  • ExtendedField
  • ExtendedFields
  • ExtendedFieldsCache
  • ExtendedFieldsDatabaseService
  • ExtendedFieldsService
  • ExtensionPointNotFoundException
  • ExtensionPointProvider
  • ExtensionPointProviderService
  • ExternalAuthenticationsExtensionPoint
  • Feed
  • FeedData
  • FeedItem
  • FeedItemEnclosure
  • FeedMenu
  • FeedsCat
  • FeedsCategoriesModule
  • FeedsList
  • File
  • FileSystemDataStore
  • FileSystemElement
  • FileSystemHelper
  • FileTemplate
  • FileTemplateLoader
  • FileTemplateLoadingException
  • FileTemplateRenderingException
  • FileType
  • FileUploadConfig
  • FileUploadService
  • Filter
  • FloatType
  • Folder
  • FormatingHelper
  • FormBuilderDisabledFieldException
  • FormBuilderException
  • FormButtonAjax
  • FormButtonAjaxCssImg
  • FormButtonButton
  • FormButtonButtonCssImg
  • FormButtonDefaultSubmit
  • FormButtonLink
  • FormButtonLinkCssImg
  • FormButtonReset
  • FormButtonSubmit
  • FormButtonSubmitCssImg
  • FormButtonSubmitImg
  • FormConstraintFieldsDifferenceInferior
  • FormConstraintFieldsDifferenceSuperior
  • FormConstraintFieldsEquality
  • FormConstraintFieldsInequality
  • FormConstraintFieldsNotIncluded
  • FormFieldActionLink
  • FormFieldActionLinkElement
  • FormFieldActionLinkList
  • FormFieldAjaxCompleter
  • FormFieldAjaxSearchUserAutoComplete
  • FormFieldAjaxUserAutoComplete
  • FormFieldAuthorizationsSetter
  • FormFieldBooleanInformation
  • FormFieldCaptcha
  • FormFieldCategoriesSelect
  • FormFieldCheckbox
  • FormFieldColorPicker
  • FormFieldConstraintAntiFlood
  • FormFieldConstraintDate
  • FormFieldConstraintDisplayNameExists
  • FormFieldConstraintFileExtension
  • FormFieldConstraintFileMaxSize
  • FormFieldConstraintForbiddenMailDomains
  • FormFieldConstraintIntegerMax
  • FormFieldConstraintIntegerMin
  • FormFieldConstraintIntegerRange
  • FormFieldConstraintLengthMax
  • FormFieldConstraintLengthMin
  • FormFieldConstraintLengthRange
  • FormFieldConstraintMailAddress
  • FormFieldConstraintMailExist
  • FormFieldConstraintMaxLinks
  • FormFieldConstraintNotEmpty
  • FormFieldConstraintPasswordStrength
  • FormFieldConstraintPHPBoostAuthLoginExists
  • FormFieldConstraintPictureFile
  • FormFieldConstraintRegex
  • FormFieldConstraintTel
  • FormFieldConstraintUrl
  • FormFieldConstraintUrlExists
  • FormFieldConstraintUserExist
  • FormFieldCSRFToken
  • FormFieldDate
  • FormFieldDateTime
  • FormFieldDecimalNumberEditor
  • FormFieldEditors
  • FormFieldFilePicker
  • FormFieldFree
  • FormFieldGroups
  • FormFieldHidden
  • FormFieldHTML
  • FormFieldLabel
  • FormFieldLangsSelect
  • FormFieldMailEditor
  • FormFieldMemberCaution
  • FormFieldMemberSanction
  • FormFieldMenuFieldset
  • FormFieldMultiLineTextEditor
  • FormFieldMultipleAutocompleter
  • FormFieldMultipleCheckbox
  • FormFieldMultipleCheckboxOption
  • FormFieldMultipleSelectChoice
  • FormFieldMultipleValuedCheckboxOption
  • FormFieldMultitabsLink
  • FormFieldMultitabsLinkElement
  • FormFieldMultitabsLinkList
  • FormFieldNumberEditor
  • FormFieldPasswordEditor
  • FormFieldPossibleValues
  • FormFieldRadioChoice
  • FormFieldRadioChoiceOption
  • FormFieldRangeEditor
  • FormFieldRanksSelect
  • FormFieldRichTextEditor
  • FormFieldSearch
  • FormFieldSelectChoiceGroupOption
  • FormFieldSelectChoiceOption
  • FormFieldSelectSources
  • FormFieldsetAccordionControls
  • FormFieldsetHidden
  • FormFieldsetHorizontal
  • FormFieldsetHTML
  • FormFieldsetHTMLHeading
  • FormFieldsetMultitabsHTML
  • FormFieldsetSubmit
  • FormFieldsetVertical
  • FormFieldShortMultiLineTextEditor
  • FormFieldSimpleSelectChoice
  • FormFieldSpacer
  • FormFieldSubTitle
  • FormFieldTelEditor
  • FormFieldTextEditor
  • FormFieldThemesSelect
  • FormFieldThumbnail
  • FormFieldTimezone
  • FormFieldUploadFile
  • FormFieldUploadPictureFile
  • FormFieldUrlEditor
  • FunctionCallTemplateSyntaxElement
  • FunctionTemplateSyntaxElement
  • GeneralConfig
  • GraphicalEnvironmentConfig
  • GroupsCache
  • GroupsService
  • HtaccessFileCache
  • HTMLForm
  • HTMLTable
  • HTMLTableAjaxUserAutoCompleteFilter
  • HTMLTableAjaxUserAutoCompleteSQLFilter
  • HTMLTableBeginsWithTextSQLFilter
  • HTMLTableCheckboxFilter
  • HTMLTableColumn
  • HTMLTableDateComparatorSQLFilter
  • HTMLTableDateGreaterThanOrEqualsToSQLFilter
  • HTMLTableDateLessThanOrEqualsToSQLFilter
  • HTMLTableDateTimeGreaterThanOrEqualsToSQLFilter
  • HTMLTableDateTimeLessThanOrEqualsToSQLFilter
  • HTMLTableEndsWithTextSQLFilter
  • HTMLTableEqualsFromListFilter
  • HTMLTableEqualsFromListSQLFilter
  • HTMLTableEqualsToSQLFilter
  • HTMLTableEscapedLikeTextSQLFilter
  • HTMLTableGreaterThanOrEqualsToSQLFilter
  • HTMLTableGreaterThanSQLFilter
  • HTMLTableLessThanOrEqualsToSQLFilter
  • HTMLTableLessThanSQLFilter
  • HTMLTableLikeFromListSQLFilter
  • HTMLTableLikeTextSQLFilter
  • HTMLTableModel
  • HTMLTableNumberComparatorSQLFilter
  • HTMLTableParameters
  • HTMLTableRow
  • HTMLTableRowCell
  • HTMLTableSortingRule
  • HTMLTableTextFilter
  • HTMLTableUnapprovedSQLFilter
  • HTTPCookie
  • HTTPFatalExceptionPrinter
  • HTTPRequestCustom
  • HTTPResponseCustom
  • I18NMessages
  • IdcardService
  • IllegalArgumentException
  • Image
  • ImageResizer
  • ImgHTMLElement
  • IncludeTemplateSyntaxElement
  • IntegerType
  • IntegratedErrorHandler
  • InvalidTemplateFunctionCallException
  • IOException
  • Item
  • ItemsAuthorizationsService
  • ItemsManager
  • ItemsModuleExtensionPointProvider
  • ItemsService
  • ItemsUrlBuilder
  • JoinMappingModel
  • JSONResponse
  • KeyGenerator
  • Keyword
  • KeywordsCache
  • KeywordsManager
  • KeywordsService
  • Lang
  • LangConfiguration
  • LangConfigurationManager
  • LangLoader
  • LangNotFoundException
  • LangsConfig
  • LangsManager
  • LangVarTemplateSyntaxElement
  • LastUseDateConfig
  • LinkHTMLElement
  • LinksMenu
  • LinksMenuElement
  • LinksMenuLink
  • LoopTemplateSyntaxElement
  • LoopVarTemplateSyntaxElement
  • Mail
  • MailServiceConfig
  • MailToPHPMailerConverter
  • MailUtil
  • MaintenanceConfig
  • MalformedUrlMapperRegexException
  • MappingModel
  • MappingModelField
  • MemberDateExtendedField
  • MemberDisabledActionAuthorization
  • MemberExtendedField
  • MemberExtendedFieldErrorsMessageException
  • MemberExtendedFieldsService
  • MemberHalfLongTextExtendedField
  • MemberHiddenExtendedField
  • MemberLongTextExtendedField
  • MemberMultipleChoiceExtendedField
  • MemberMultipleSelectExtendedField
  • MemberSanctionManager
  • MemberShortTextExtendedField
  • MemberSimpleChoiceExtendedField
  • MemberSimpleSelectExtendedField
  • MemberUserAvatarExtendedField
  • MemberUserBornExtendedField
  • MemberUserPMToMailExtendedField
  • MemberUserSexExtendedField
  • Menu
  • MenusCache
  • MenuService
  • MenusProvidersService
  • MenuStringFilter
  • MessageHelper
  • MiniCalendar
  • Module
  • ModuleConfiguration
  • ModuleConfigurationManager
  • ModuleController
  • ModuleCssFiles
  • ModuleDispatchManager
  • ModuleExtensionPointProvider
  • ModuleLink
  • ModuleMenus
  • ModuleMiniMenu
  • ModulePagination
  • ModulesConfig
  • ModulesCssFilesService
  • ModulesManager
  • ModulesUrlBuilder
  • ModuleTreeLinks
  • ModuleTreeLinksService
  • MySQLDBConnection
  • MySQLDBConnectionException
  • MySQLDBFactory
  • MySQLDBMSUtils
  • MySQLInjectQueryResult
  • MySqlPlatform
  • MySQLQuerier
  • MySQLQuerierException
  • MySQLQueryTranslator
  • MySQLSelectQueryResult
  • MySQLUnexistingDatabaseException
  • NginxFileCache
  • NoSuchControllerException
  • NotASingleRowFoundException
  • Notation
  • NotationService
  • Notification
  • NotYetImplementedException
  • NoUrlMatchException
  • NumberHelper
  • ObjectNotFoundException
  • ObjectType
  • Pagination
  • ParametersTemplateSyntaxElement
  • ParameterTypeMismatchException
  • Path
  • PDODBConnection
  • PDODBConnectionException
  • PDOInjectQueryResult
  • PDOMySQLDBFactory
  • PDOQuerier
  • PDOQuerierException
  • PDOSelectQueryResult
  • PersistenceContext
  • PHPBoostAuthenticationMethod
  • PHPBoostErrors
  • PHPBoostFoldersPermissions
  • PHPBoostIndexController
  • PHPBoostNotInstalledException
  • PHPTemplateSyntaxElement
  • PlainCodeHighlighter
  • PostgreSqlPlatform
  • PrivateMsg
  • PropertyNotFoundException
  • RAMDataStore
  • RawExceptionHandler
  • RegexHelper
  • RemainingStringVarException
  • Repository
  • RichCategory
  • RichItem
  • RichRootCategory
  • Robots
  • RolesAuthorizations
  • RootCategory
  • RowNotFoundException
  • RSS
  • SearchCategoryChildrensOptions
  • SearchResult
  • SecurityConfig
  • SelectQueryResultMapper
  • SEOMetaData
  • ServerConfiguration
  • ServerEnvironmentConfig
  • Session
  • SessionData
  • SessionNotFoundException
  • SessionsConfig
  • SimpleVarTemplateSyntaxElement
  • SiteDisplayFrameGraphicalEnvironment
  • SiteDisplayFrameResponse
  • SiteDisplayGraphicalEnvironment
  • SiteDisplayResponse
  • SitemapCategoriesModule
  • SiteNodisplayGraphicalEnvironment
  • SiteNodisplayResponse
  • SmallIntType
  • SmileysCache
  • SMTPConfiguration
  • SMTPMailService
  • SpanHTMLElement
  • SQLDAO
  • SQLFragment
  • SQLHTMLTableModel
  • SqlitePlatform
  • SQLQuerierException
  • SQLQueryVars
  • StatsCache
  • StringInputStream
  • StringOutputStream
  • StringTemplate
  • StringTemplateLoader
  • StringType
  • StringVars
  • TemplateFunctions
  • TemplateHighlighter
  • TemplateLoadingException
  • TemplateRenderingException
  • TemplateSyntaxParser
  • TemplateSyntaxParserContext
  • TextHelper
  • TextTemplateSyntaxElement
  • TextType
  • Theme
  • ThemeConfiguration
  • ThemeConfigurationManager
  • ThemesConfig
  • ThemesManager
  • TimeType
  • Timezone
  • Type
  • UnexistingDatabaseException
  • UnexistingExtensionPointProviderException
  • UnexistingHTTPParameterException
  • UnreadContributionsCache
  • UnsupportedOperationException
  • Updates
  • Upload
  • UploadedFile
  • UploadedFileTooLargeException
  • Uploads
  • Url
  • UrlControllerMapper
  • UrlMapping
  • UrlMappings
  • UrlRedirectMapper
  • UrlSerializedParameter
  • UrlSerializedParameterEncoder
  • UrlSerializedParameterParser
  • User
  • UserAccountsConfig
  • UserService
  • ValidationResult
  • VariableExpressionTemplateSyntaxElement
  • VariableTemplateSyntaxElement
  • VisitorDisabledActionAuthorization
  • WizardActionLinkList
  • WizardFormFieldsetSubmit
  • WizardHTMLForm
  • WritingPadConfig
Methods
  • __construct()
  • exists()
  • get_path()
  • get_path_from_root()
  • get_name()
  • is_writable()
  • change_chmod()
  • delete()
  • __destruct()
  • get_name_without_extension()
  • get_extension()
  • read()
  • read_lines()
  • write()
  • append()
  • erase()
  • close()
  • lock()
  • unlock()
  • flush()
  • get_last_modification_date()
  • get_last_access_date()
  • get_file_size()
  • get_formated_size()
  • open()
  • get_file_checksum()
  • No protected methods found
  • is_open()
  • write_data()
  • check_file_descriptor()
Properties
  • No public properties found
  • $path
  • $BUFFER_SIZE
  • $contents
  • $mode
  • $file_descriptor
Constants
  • READ
  • WRITE
  • APPEND
  1. APIBoost
  2. \IO\Filesystem
  3. File

Class File

Summary

  • File
  • Package hierarchy IO\Filesystem
  • Class hierarchy \FileSystemElement \File
  • package

    IO

  • subpackage

    Filesystem

  • copyright

    © 2005-2020 PHPBoost

  • license

    https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0

  • author

    Nicolas Duhamel akhenathon2@gmail.com

  • version

    PHPBoost 6.0 - last update: 2019 04 03

  • since

    PHPBoost 2.0 - 2008 07 06

  • contributor

    Loic ROUCHON horn@phpboost.com

  • contributor

    Benoit SAUTEL ben.popeye@phpboost.com

  • contributor

    Julien BRISWALTER j1.seth@phpboost.com

  • contributor

    Arnaud GENET elenwii@phpboost.com

This class represents a text file which can be read and written.

Methods

__construct()

__construct(string $path) 

Builds a File object.

Parameters
string $path

Path of the file you want to work with.

  • Inherited from \File
Tags
None found

exists()

exists() : boolean

Allows you to know if the file system element exists.

Returns
boolean —

True if the file exists, else, false.

  • Inherited from \FileSystemElement
Tags
None found

get_path()

get_path() : string

Returns the element full path.

Returns
string —

The element full path.

  • Inherited from \FileSystemElement
Tags
None found

get_path_from_root()

get_path_from_root() : string

Returns the element path from the phpboost root.

Returns
string —

The element from the phpboost root.

  • Inherited from \FileSystemElement
Tags
None found

get_name()

get_name() : string

Returns the element name.

Returns
string —

The element name.

  • Inherited from \FileSystemElement
Tags
None found

is_writable()

is_writable(boolean $force_chmod = false) : true

Returns true if the file or the folder is writable.

Parameters
boolean $force_chmod

If true, then, chmod will be forced to 777 if not writable.

Returns
true —

if the file or the folder is writable.

  • Inherited from \FileSystemElement
Tags
None found

change_chmod()

change_chmod(integer $chmod) : true

Changes the chmod of the element.

Parameters
integer $chmod

The new chmod of the file. Put a 0 at the begening of the number to indicate to the PHP parser that it's an octal value.

Returns
true —

if the chmod has been successfully changed.

  • Inherited from \FileSystemElement
Tags
None found

delete()

delete() 

Deletes the file.

Throws
\IOException

if the file cannot been deleted

  • Inherited from \File
Tags
None found

__destruct()

__destruct() 

  • Inherited from \File
Tags
None found

get_name_without_extension()

get_name_without_extension() : string

Returns the element name without extension.

Returns
string —

The element name without extension.

  • Inherited from \File
Tags
None found

get_extension()

get_extension() : string

Returns the extension of the element.

Returns
string —

Element extension.

  • Inherited from \File
Tags
None found

read()

read(integer $start, integer $len = -1) : string

Returns the content of the file.

Parameters
integer $start

Byte from which you want to start. 0 if you want to read the file from its begening, 1 to start with the second etc.

integer $len

Number of bytes you want to read.

Returns
string —

The read content.

  • Inherited from \File
Tags
None found

read_lines()

read_lines() : array<mixed,string>

Returns the content of the file grouped by lines.

Returns
array<mixed,string> —

The list of the lines of the file.

  • Inherited from \File
Tags
None found

write()

write(string $data) 

Writes some text in the file. Erases the file previous content

Parameters
string $data

The text you want to write in the file.

Throws
\IOException

If it's not possible to write the file

  • Inherited from \File
Tags
None found

append()

append(string $data) 

Appends some text at the end of the file.

Parameters
string $data

The text you want to write in the file.

Throws
\IOException

If it's not possible to write the file

  • Inherited from \File
Tags
None found

erase()

erase() 

empty the file

  • Inherited from \File
Tags
None found

close()

close() 

Closes a file and frees the allocated memory relative to the file.

  • Inherited from \File
Tags
None found

lock()

lock(boolean $blocking = true) 

Parameters
boolean $blocking

if true, block the script, if false, non blocking operation Locks the file (it won't be readable by another thread which could try to access it).

Throws
\IOException

if the file cannot been locked

  • Inherited from \File
Tags
None found

unlock()

unlock() 

Unlocks a file. The file must have been locked before you call this method.

Throws
\IOException

if the file cannot been unlocked

  • Inherited from \File
Tags
None found

flush()

flush() 

Forces the system to write all the buffered output.

  • Inherited from \File
Tags
None found

get_last_modification_date()

get_last_modification_date() : integer

Returns the date of the last modification of the file.

Returns
integer —

The UNIX timestamp corresponding to the last modification date.

  • Inherited from \File
Tags
None found

get_last_access_date()

get_last_access_date() : integer

Returns the last access date of the file.

Returns
integer —

The UNIX timestamp corresponding to the last access date of the file.

  • Inherited from \File
Tags
None found

get_file_size()

get_file_size() : integer

Returns the size of the file.

Returns
integer —

The size of the file in bytes.

  • Inherited from \File
Tags
None found

get_formated_size()

get_formated_size(string $file_size) : string

Get file readable size.

Parameters
string $file_size

The size of the file in bytes.

Returns
string —

The size of the file in Kb or Mb or Gb.

static
  • Inherited from \File
Tags
None found

open()

open( $mode) 

Opens the file. You cannot read or write a closed file, use this method to open it.

Parameters
$mode
Throws
\IOException

If the file can neither been read nor created.

  • Inherited from \File
Tags
None found

get_file_checksum()

get_file_checksum(string $filename) : string

Get file checksum in sha256.

Parameters
string $filename

Path of the file you want to work with.

Returns
string —

The hash of the file in sha256.

static
  • Inherited from \File
Tags
None found

is_open()

is_open() : boolean

Allows you to know if the file is already open.

Returns
boolean —

true if the file is open, false if it's closed.

  • Inherited from \File
Tags
None found

write_data()

write_data( $data) 

Parameters
$data
  • Inherited from \File
Tags
None found

check_file_descriptor()

check_file_descriptor( $message) 

Parameters
$message
  • Inherited from \File
Tags
None found

Properties

$path

$path : string

string — Path of the file system element
  • Inherited from
    \FileSystemElement
Tags
None found

$BUFFER_SIZE

$BUFFER_SIZE : 

Tags
None found

$contents

$contents : string

string — Content of the file
Tags
None found

$mode

$mode : integer

integer — Open mode
Tags
None found

$file_descriptor

$file_descriptor : \File

\File — descriptor of the open file.
Tags
None found

Constants

READ

READ = 1

Tags
None found

WRITE

WRITE = 2

Tags
None found

APPEND

APPEND = 3

Tags
None found
Documentation is powered by phpDocumentor and generated on Thu, 25 Jun 2020 11:10:18 +0200.