Public Member Functions | Static Public Member Functions

BeLib Class Reference

BEdita libs class. More...

List of all members.

Public Member Functions

 isBeditaObjectType ($name, $paths=null)
 check if a class name is a BEdita object type
 isFileNameUsed ($filename, $type, $excludePaths=array())
 check if a file name is already used in Configure::$type.
 friendlyUrlString ($value, $keep="")
 Modify a string to get friendly url version.
 stripData ($data, array $options=array())
 Strip scripts, images, whitespace or all together on $data using Sanitize::stripScripts, Sanitize::stripImages, Sanitize::stripWhitespace, Sanitize::stripAll methods see Sanitize class of cakephp for more info.
 arrayValues (array $array, $addStringKeys=false)
 return values of multidimensional array
 arrayKeys (array $ar, $stringKeys=true)
 return keys of multidimensional array
 sqlDateFormat ($value, $dateType="little-endian")
 Transform any numeric date in SQL date/datetime string format Date types accepted: "little-endian"/"middle-endian"/"big-endian".
 variableFromNickname ($nickname)
 return conventional variable/method name starting from nickname replacing '-' with '_' and camelizing (not first char)
 getFrontendFolders ()
 generate an array of frontend folders
 getAddonFolders ()
 generate an array of addon folders
 getPluginModuleFolders ()
 generate an array of plugin module folders
 remoteUpdateAddons ($path)
 update Addons after project update

Static Public Member Functions

static & getInstance ()
static & getObject ($name, $paths=null)
 return an instance of a class (by default search in libs dir) If class is not instantiated do it and put in CakePHP registry
static getTypeFromMIME ($mime)
 Return array with model name and eventually specific type (see $config[validate_resource][mime][Application]) from mime type.

Detailed Description

BEdita libs class.

Instantiate and put in the registry other classes

Definition at line 35 of file be_lib.php.


Member Function Documentation

BeLib::arrayKeys ( array $  ar,
stringKeys = true 
)

return keys of multidimensional array

Parameters:
array $ar
boolean $stringKeys if it's true add string keys to the returned array
Returns:
array

Definition at line 265 of file be_lib.php.

Referenced by arrayValues().

BeLib::arrayValues ( array $  array,
addStringKeys = false 
)

return values of multidimensional array

Parameters:
array $array
boolean $addStringKeys if it's true add string keys to the returned array
Returns:
array

Definition at line 237 of file be_lib.php.

References arrayKeys().

BeLib::friendlyUrlString ( value,
keep = "" 
)

Modify a string to get friendly url version.

With a regexp you can choose which characters to preserve.

Parameters:
string $value
string $keep, regexp fragment with characters to keep, e.g. "\." will preserve points, "\.\:" points and semicolons
Returns:
string

Definition at line 141 of file be_lib.php.

BeLib::getAddonFolders (  ) 

generate an array of addon folders

Returns:
array

Definition at line 408 of file be_lib.php.

BeLib::getFrontendFolders (  ) 

generate an array of frontend folders

Returns:
array

Definition at line 391 of file be_lib.php.

static& BeLib::getObject ( name,
paths = null 
) [static]

return an instance of a class (by default search in libs dir) If class is not instantiated do it and put in CakePHP registry

Parameters:
string $name class name (file has to be underscorized MyClass => my_class.php)
string or array $paths paths where search class file (search in libs folder by default)
Returns:
class instance

Definition at line 59 of file be_lib.php.

Referenced by AppController::__construct(), BEObject::afterSave(), ObjectRelation::availableRelations(), AppController::beforeRender(), BEObject::beforeValidate(), Utility::cleanupCache(), Stream::clearMediaCache(), Addon::disable(), Utility::emptyLogs(), Addon::enable(), DataTransfer::export(), ImageInfoHelper::get(), Addon::getEnabledFolderByType(), Addon::getFolderByType(), BeditaBaseShell::initConfig(), ObjectRelation::inverseOf(), isBeditaObjectType(), Permission::isPermissionSet(), UsersController::isUserEditable(), ObjectRelation::isValid(), Module::plugModule(), PagesController::showObjects(), AdminController::toggleModule(), Module::unplugModule(), and DataTransfer::validate().

BeLib::getPluginModuleFolders (  ) 

generate an array of plugin module folders

Returns:
array

Definition at line 425 of file be_lib.php.

static BeLib::getTypeFromMIME ( mime  )  [static]

Return array with model name and eventually specific type (see $config[validate_resource][mime][Application]) from mime type.

Parameters:
string $mime mime type
Returns:
mixed array|boolean

Definition at line 206 of file be_lib.php.

BeLib::isBeditaObjectType ( name,
paths = null 
)

check if a class name is a BEdita object type

Parameters:
string $name the class name
mixed $paths array of paths or string path where searching the class leave empty to use ClassRegistry
Returns:
boolean

Definition at line 89 of file be_lib.php.

References getObject().

BeLib::isFileNameUsed ( filename,
type,
excludePaths = array() 
)

check if a file name is already used in Configure::$type.

"Paths"

Parameters:
string $filename
string $type (models, controllers, ...) see App::path
array of path to exclude from search (paths have to end with DS trailing slash)
Returns:
boolean

Definition at line 113 of file be_lib.php.

BeLib::remoteUpdateAddons ( path  ) 

update Addons after project update

Parameters:
string $path
Returns:
array

Definition at line 443 of file be_lib.php.

BeLib::sqlDateFormat ( value,
dateType = "little-endian" 
)

Transform any numeric date in SQL date/datetime string format Date types accepted: "little-endian"/"middle-endian"/"big-endian".

if little endian, expected format id dd/mm/yyyy format, or dd.mm.yyyy, or dd-mm-yyyy if middle endian, expected format is mm/dd/yyyy format, or mm.dd.yyyy (USA standard) if big endian ==> yyyy-mm-dd Examples:

Little endian "22/04/98", "22/04/1998", "22.4.1998", "22-4-98", "22 4 98", "1998", "98", "22.04", "22/4", "22 4"

Middle endian "4/22/98", "02/22/1998", "4.22.1998", "4-22-98", "4/22", "04.22"

If format is not valid or string is not parsable, an exception maybe thrown

Parameters:
string $val, string in generic numeric form
string $dateType, "little-endian"/"middle-endian"/"big-endian"

Definition at line 299 of file be_lib.php.

Referenced by BEAppModel::getDefaultDateFormat().

BeLib::stripData ( data,
array $  options = array() 
)

Strip scripts, images, whitespace or all together on $data using Sanitize::stripScripts, Sanitize::stripImages, Sanitize::stripWhitespace, Sanitize::stripAll methods see Sanitize class of cakephp for more info.

Parameters:
mixed $data string or array
array $options, possible values are: "what" => "scripts" (default), "images", "whitespace", "all", "recursive" => true (default) strip recursively on $data
Returns:
mixed

Definition at line 177 of file be_lib.php.

BeLib::variableFromNickname ( nickname  ) 

return conventional variable/method name starting from nickname replacing '-' with '_' and camelizing (not first char)

example: this-is-my-nickname become thisIsMyNickName

Parameters:
string $nickname
Returns:
string

Definition at line 380 of file be_lib.php.


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus