BEdita API doc | 3-corylus
  • Class
  • Tree
  • Deprecated
  • Download

Classes

  • Addon
  • AddressbookController
  • AddressbookShell
  • AdminController
  • Alias
  • Annotation
  • ApiAuthComponent
  • ApiBaseController
  • ApiFormatterComponent
  • ApiUploadComponent
  • ApiValidatorComponent
  • AppController
  • AppError
  • AppHelper
  • Application
  • AppModel
  • Area
  • AreasController
  • Audio
  • AuthenticationsController
  • BannedIp
  • BEAppModel
  • BEAppObjectModel
  • BeAuthComponent
  • BeAuthFacebookComponent
  • BeAuthGoogleComponent
  • BeAuthTwitterComponent
  • BeCallbackManager
  • BeConfigure
  • BeCustomPropertyComponent
  • BeditaAnnotationModel
  • BeditaBaseShell
  • BeditaCollectionModel
  • BeditaContentModel
  • BeditaExportFilter
  • BeditaImportFilter
  • BeditaObjectModel
  • BeditaProductModel
  • BeditaShell
  • BeditaSimpleObjectModel
  • BeditaSimpleStreamModel
  • BeditaStreamModel
  • BeEmbedFlashHelper
  • BeEmbedHtml5Helper
  • BeEmbedMediaHelper
  • BeErrorCode
  • BeExceptionHandler
  • BEFile
  • BeFileHandlerComponent
  • BeFormHelper
  • BeFrontHelper
  • BeHashComponent
  • BeHtmlHelper
  • BeLangTextComponent
  • BeLib
  • BeMailComponent
  • BEObject
  • BeObjectCache
  • BePaginatorToolbarHelper
  • BeSchema
  • BeSecurityComponent
  • BeSystem
  • BeSystemComponent
  • BeThumb
  • BeTimeHelper
  • BeToolbarHelper
  • BeTreeComponent
  • BeTreeHelper
  • BeUploadToObjComponent
  • BeurlHelper
  • BeVimeoComponent
  • BeYoutubeComponent
  • BuildFilterBehavior
  • CacheableBehavior
  • CacheShell
  • CallbackBehavior
  • CaptchaComponent
  • Caption
  • CaptionsBehavior
  • Card
  • CardsImportFilter
  • Category
  • CleanupDataTask
  • CleanupTask
  • Comment
  • CommentsController
  • CompactResultBehavior
  • Content
  • CreateIndexFieldsBehavior
  • DataShell
  • DataTransfer
  • DateItem
  • DbadminShell
  • DeleteDependentObjectBehavior
  • DeleteObjectBehavior
  • DeployShell
  • Document
  • DocumentsController
  • DumpModel
  • EditorialContentsShell
  • EditorNote
  • Event
  • EventLog
  • EventsController
  • FilesController
  • ForeignDependenceSaveBehavior
  • FrontendController
  • FrontendShell
  • GalleriesController
  • Gallery
  • GeoTag
  • GettextShell
  • Git
  • GravatarHelper
  • Group
  • HashJob
  • History
  • HomeController
  • Image
  • ImageInfoHelper
  • JsonExportFilter
  • JsonImportFilter
  • JsonView
  • LangText
  • Link
  • MailGroup
  • MailGroupCard
  • MailJob
  • MailLog
  • MailMessage
  • MailShell
  • MailTemplate
  • Mask
  • MediaShell
  • MigrateDumpModel
  • MigrateShell
  • Migration
  • MigrationBase
  • MigrationDateItemsShell
  • Module
  • ModulesController
  • ModuleShell
  • MultimediaController
  • NewsController
  • NewsletterController
  • NewsletterShell
  • NotifyBehavior
  • ObjectEditor
  • ObjectProperty
  • ObjectRelation
  • ObjectType
  • ObjectUser
  • PagesController
  • Permission
  • PermissionModule
  • PermsHelper
  • Product
  • Property
  • PropertyOption
  • PublicationShell
  • RedisShell
  • RelationCheck
  • RelationRepair
  • RelationShell
  • RelationStats
  • RemoveDummyNameBehavior
  • ResponseHandlerComponent
  • RestClientModel
  • Revision
  • RevisionObjectBehavior
  • SearchText
  • SearchTextSaveBehavior
  • Section
  • SectionDummy
  • SessionFilterComponent
  • SessionFilterHelper
  • ShortNews
  • SmartyView
  • SoapClientModel
  • SplitterSql
  • StatisticsController
  • Stream
  • StreamLog
  • StreamsController
  • Svn
  • TagsController
  • ThemeSmartyView
  • ThumbnailHelper
  • ThumbShell
  • TransactionComponent
  • TransactionFS
  • TranslationsController
  • Tree
  • TrHelper
  • User
  • UserProperty
  • UsersController
  • Utility
  • Version
  • Video
  • VimeoHelper
  • WebmarksController
  • XmlExportFilter
  • XmlImportFilter
  • XmlJsonConverter
  • XmlView
  • YoutubeHelper

Interfaces

  • ApiAuthInterface
  • MediaProviderInterface
  • UploadableInterface

Exceptions

  • BeditaAjaxException
  • BEditaAllowURLException
  • BeditaBadRequestException
  • BeditaConflictException
  • BEditaDeleteStreamObjException
  • BeditaException
  • BEditaFileExistException
  • BeditaForbiddenException
  • BeditaFrontAccessException
  • BeditaHashException
  • BEditaInfoException
  • BeditaInternalErrorException
  • BEditaIOException
  • BeditaLengthRequiredException
  • BeditaMailException
  • BEditaMediaProviderException
  • BeditaMethodNotAllowedException
  • BEditaMIMEException
  • BeditaNotFoundException
  • BeditaNotImplementedException
  • BeditaPublicationException
  • BeditaRuntimeException
  • BEditaSaveStreamObjException
  • BeditaServiceUnavailableException
  • BeditaUnauthorizedException
  • BEditaUploadPHPException
  • BEditaURLException

Class BeSystem

BeSystem class handle BEdita system utility methods

Version: $Revision$
Modifiedby: $LastChangedBy$
Lastmodified:

$LastChangedDate$

$Id$


Located at libs/be_system.php

Methods summary

public boolean
# checkAppDirPresence( string $dirPath )

Check whether directory $dirPath exists

Check whether directory $dirPath exists

Parameters

$dirPath

Returns

boolean
public boolean
# checkAppFilePresence( string $filePath )

Check whether file $filePath exists

Check whether file $filePath exists

Parameters

$filePath

Returns

boolean
public string
# checkAppDirPerms( string $dirPath, integer $mask = 511 )

Check permissions for directory

Check permissions for directory

Parameters

$dirPath
$mask

Returns

string
public boolean
# createFileFromSample( string $filePath )

Create file $filePath from $filePath.sample

Create file $filePath from $filePath.sample

Parameters

$filePath

Returns

boolean
public
# checkWritable( string $filename )

Check whether file $filename is writable

Check whether file $filename is writable

Parameters

$filename
public array,
# emptyLogs( string $filename = null, string $basePath = LOGS )

delete log files

delete log files

Parameters

$filename
$filename, filename to delete i.e. error.log
$basePath
$basePath, path to file (default is logs path)

Returns

array,

it contains 'failed' => array of errors, empty if no errors occured 'success' => array of file deleted

public array,
# cleanupCache( string $basePath = TMP, boolean $frontendsToo = true, boolean $cleanAll = false )

cleanup cached files

cleanup cached files

Parameters

$basePath
$basePath, base path on which build cake cache dir and smarty cache dir
$frontendsToo
$frontendsToo, true (default) to delete also all frontends cached files
$cleanAll
$cleanAll, false (default) clean all folders in tmp/cache not just 'models', 'persistent' and 'views'

Returns

array,

it contains 'failed' => array of errors, empty if no errors occured 'success' => array deleted files

public array,
# cleanUpDir( string $basePath, boolean $recursive = false, boolean $removeDirs = false )

clean directory deleting files and eventully subdirs

clean directory deleting files and eventully subdirs

Parameters

$basePath
$basePath, the starting directory path
$recursive
$recursive, true to deleting files recursively on subdirs
$removeDirs
$removeDirs, true to remove all subdirs too

Returns

array,

it contains 'failed' => array of errors, empty if no errors occured 'success' => array of file deleted

public mixed
# writeConfigFile( type $filepath, array $dataToWrite, boolean $insertNewVar = false )

edit cakephp config file

edit cakephp config file

Parameters

$filepath
$dataToWrite
(see BeSystem::writePHPfile)
$insertNewVar
$insertNewVar, if 'true' write new var (if not already in config file)

Returns

mixed
true on success
public mixed
# writePHPfile( string $filepath, array $dataToWrite, boolean $insertNewVar = true )

edit an existing php file writing data from $dataToWrite array

edit an existing php file writing data from $dataToWrite array

Parameters

$filepath
$dataToWrite

example of $dataToWrite 1) "config" => array( "beditaUrl" => "http://localhost/workspace/bedita", 'smtpOptions'=> array( 'port' => '25', 'timeout' => '30', 'host' => 'your.smtp.server', 'username' => 'your_smtp_username', 'password' => 'your_smtp_password' ), ... )

    will be generate var as
    $config['beditaUrl'] = 'http://localhost/workspace/bedita';
    ...

2)
    "myvar" => "this is my var"

    will be generate var as
    $myvar = 'this is my var';
$insertNewVar
true to permitt writing new var (not already present in original file)

Returns

mixed
true on success
public boolean
# checkFileSyntax( string $fileName )

Check for syntax error in file

Check for syntax error in file

To check syntax it uses 'php -l' command (cli)

Parameters

$fileName
the complete file name

Returns

boolean
true on check success
public boolean
# checkCodeSyntax( array|string $sourceCode, boolean $addPHPtag = false )

Return true if no syntax errors are present in $sourceCode.

Return true if no syntax errors are present in $sourceCode.

To check syntax it uses BeSystem::checkFileSyntax() Since 'php -l' works against files a temporary file is created in (bedita-app/tmp) and removed only if the check is correct. If BeSystem::checkFileSyntax() or file creation fails the method returns false

Parameters

$sourceCode
the source code to test
$addPHPtag
true to add '<?php' at the begin of $sourceCode

Returns

boolean

See

BeSystem::checkFileSyntax()
private
# parsePHPFile( array & $fileLines, array $params )

parse file as array (returned from file() php function) and replace/insert var defined in $params

parse file as array (returned from file() php function) and replace/insert var defined in $params

Parameters

$fileLines
returned from file() php function
$params

can contain "varName" => name of php variable (without $) that has to be searched in $fileLines [required] "keyName" => key name of $varName array. Empty if $varName isn't an associative array "varValue" => value of $varName[$keyName] or $varName "patternVar" => custom regexp pattern to search var. If empty is built automatically "insertNewVar" => boolean, it says if add or less variable not already in $fileLines [default is true]

private string
# generateVarCodeLine( array $params )

generate a php var code line according to $params

generate a php var code line according to $params

Parameters

$params

"varName" => name of php var without $ "keyName" => key name of varName array (can be empty) "varValue" => value of $varName or $varName[$keyName]

Returns

string
public integer
# systemUserId( )

Get system user ID.

Get system user ID.

Returns

integer

See

BeSystem::SYSTEM_USER_ID

Constants summary

integer SYSTEM_USER_ID

System user ID, created on setup.

System user ID, created on setup.

# 1
BEdita API doc | 3-corylus API documentation generated by ApiGen