Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Lib.Common.php File Reference

Go to the source code of this file.

Namespaces

namespace  FDL
 

Functions

 N_ ($s)
 
 print_r2 ($z, $ret=false)
 
 AddLogMsg ($msg, $cut=80)
 
 deprecatedFunction ($msg= '')
 
 AddWarningMsg ($msg)
 
 getMailAddr ($userid, $full=false)
 
 getTmpDir ($def= '/tmp')
 
 getParam ($name, $def="")
 must be in core or global type
 
 getCoreParam ($name, $def="")
 must be in core or global type
 
 getSessionValue ($name, $def="")
 
 getLayoutFile ($app, $layfile)
 
 mb_ucfirst ($s)
 
 microtime_diff ($a, $b)
 
 getDebugStack ($slice=1)
 
 getDbid ($dbaccess)
 
 getDbAccess ()
 
 getDbAccessCore ()
 
 getDbAccessFreedom ()
 
 getDbEnv ()
 
 getFreedomContext ()
 
 getServiceCore ()
 
 getServiceFreedom ()
 
 getDbName ($dbaccess)
 
 getServiceName ($dbaccess)
 
 simpleQuery ($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false)
 
 getAuthType ($freedomctx="")
 
 getAuthProvider ($freedomctx="")
 
 getAuthProviderList ($freedomctx="")
 
 getAuthTypeParams ($freedomctx="")
 
 getAuthParam ($freedomctx="", $provider="")
 
 getWshCmd ($nice=false, $userid=0, $sudo=false)
 
 getUserId ()
 
 bgexec ($tcmd, &$result, &$err)
 
 wbartext ($text)
 
 wbar ($reste, $total, $text="", $fbar=false)
 
 getJsVersion ()
 
 setMailtoAnchor ($to, $acontent="", $subject="", $cc="", $bcc="", $from="", $anchorattr=array(), $forcelink="")
 
 isUTF8 ($string)
 
 seems_utf8 ($Str)
 
 usefreedomuser ()
 
 WhatInitialisation ()
 
 setSystemLogin ($login)
 
 mkpasswd ($length=8, $charspace="")
 
 getLcdate ()
 
 getLocaleConfig ($core_lang= '')
 
 setLanguage ($lang)
 

Function Documentation

AddLogMsg (   $msg,
  $cut = 80 
)

send a message to system log

Parameters
string$msgmessage to log
int$cutsize limit

Definition at line 37 of file Lib.Common.php.

AddWarningMsg (   $msg)

Definition at line 51 of file Lib.Common.php.

bgexec (   $tcmd,
$result,
$err 
)

exec list of unix command in background

Parameters
array$tcmdunix command strings

Definition at line 523 of file Lib.Common.php.

+ Here is the call graph for this function:

deprecatedFunction (   $msg = '')

send a message to system log

Parameters
string$functioName

Definition at line 46 of file Lib.Common.php.

getAuthParam (   $freedomctx = "",
  $provider = "" 
)

Definition at line 462 of file Lib.Common.php.

+ Here is the call graph for this function:

getAuthProvider (   $freedomctx = "")

Definition at line 408 of file Lib.Common.php.

+ Here is the call graph for this function:

getAuthProviderList (   $freedomctx = "")

Definition at line 429 of file Lib.Common.php.

+ Here is the call graph for this function:

getAuthType (   $freedomctx = "")

Definition at line 383 of file Lib.Common.php.

+ Here is the call graph for this function:

getAuthTypeParams (   $freedomctx = "")

Definition at line 436 of file Lib.Common.php.

+ Here is the call graph for this function:

getCoreParam (   $name,
  $def = "" 
)

must be in core or global type

return value of a parameter

Parameters
string$nameparam name
string$defdefault value if value is empty
Returns
string

Definition at line 114 of file Lib.Common.php.

+ Here is the call graph for this function:

getDbAccess ( )

Definition at line 245 of file Lib.Common.php.

+ Here is the call graph for this function:

getDbAccessCore ( )

Definition at line 250 of file Lib.Common.php.

+ Here is the call graph for this function:

getDbAccessFreedom ( )

Definition at line 255 of file Lib.Common.php.

+ Here is the call graph for this function:

getDbEnv ( )

Definition at line 260 of file Lib.Common.php.

+ Here is the call graph for this function:

getDbid (   $dbaccess)

Definition at line 229 of file Lib.Common.php.

+ Here is the call graph for this function:

getDbName (   $dbaccess)

Definition at line 325 of file Lib.Common.php.

+ Here is the call graph for this function:

getDebugStack (   $slice = 1)

Definition at line 218 of file Lib.Common.php.

getFreedomContext ( )

Definition at line 266 of file Lib.Common.php.

getJsVersion ( )

Definition at line 565 of file Lib.Common.php.

getLayoutFile (   $app,
  $layfile 
)

Definition at line 145 of file Lib.Common.php.

getLcdate ( )

return lcdate use in database : iso or dmy

Returns
string

Definition at line 790 of file Lib.Common.php.

+ Here is the call graph for this function:

getLocaleConfig (   $core_lang = '')
Parameters
string$core_lang

Definition at line 798 of file Lib.Common.php.

+ Here is the call graph for this function:

getMailAddr (   $userid,
  $full = false 
)

get mail addr of a user

Parameters
int$useridsystem user identificator
bool$fullif true email is like : "John Doe" John..nosp@m.doe@.nosp@m.black.nosp@m.hole.nosp@m..net else only system email address : john..nosp@m.doe@.nosp@m.black.nosp@m.hole.nosp@m..net
Returns
string mail address, false if user not exists

Definition at line 62 of file Lib.Common.php.

getParam (   $name,
  $def = "" 
)

must be in core or global type

return value of parameters

Parameters
string$nameparam name
string$defdefault value if value is empty
Returns
string

Definition at line 98 of file Lib.Common.php.

+ Here is the call graph for this function:

getServiceCore ( )

Definition at line 275 of file Lib.Common.php.

+ Here is the call graph for this function:

getServiceFreedom ( )

Definition at line 300 of file Lib.Common.php.

+ Here is the call graph for this function:

getServiceName (   $dbaccess)

Definition at line 331 of file Lib.Common.php.

getSessionValue (   $name,
  $def = "" 
)
Parameters
string$namethe variable
string$defdefault value if variable is not defined
Returns
unknown_type

Definition at line 138 of file Lib.Common.php.

getTmpDir (   $def = '/tmp')

Definition at line 77 of file Lib.Common.php.

+ Here is the call graph for this function:

getUserId ( )

get the system user id

Returns
int

Definition at line 512 of file Lib.Common.php.

getWshCmd (   $nice = false,
  $userid = 0,
  $sudo = false 
)

return shell commande for wsh depending of database (in case of several instances)

Parameters
bool$niceset to true if want nice mode
int$useridthe user identificator to send command (if 0 send like admin without specific user parameter)
bool$sudoset to true if want to be send with sudo (need /etc/sudoers correctly configured)
Returns
string the command

Definition at line 497 of file Lib.Common.php.

+ Here is the call graph for this function:

isUTF8 (   $string)

Returns true if the string or array of string is encoded in UTF8.

Example of use. If you want to know if a file is saved in UTF8 format : $array = file('one file.txt'); $isUTF8 = isUTF8($array); if (!$isUTF8) –> we need to apply utf8_encode() to be in UTF8 else –> we are in UTF8 :)

Parameters
mixedA string, or an array from a file() function.
Returns
boolean

Definition at line 679 of file Lib.Common.php.

+ Here is the call graph for this function:

mb_ucfirst (   $s)

like ucfirst for utf-8

Parameters
$s
Returns
string

Definition at line 193 of file Lib.Common.php.

microtime_diff (   $a,
  $b 
)

Definition at line 200 of file Lib.Common.php.

mkpasswd (   $length = 8,
  $charspace = "" 
)

Returns a random password of specified length composed with chars from the given charspace string or pattern

Definition at line 753 of file Lib.Common.php.

N_ (   $s)

Definition at line 20 of file Lib.Common.php.

print_r2 (   $z,
  $ret = false 
)

Definition at line 25 of file Lib.Common.php.

seems_utf8 (   $Str)

Returns true if the string is encoded in UTF8.

Parameters
mixed$Strstring
Returns
boolean

Definition at line 690 of file Lib.Common.php.

setLanguage (   $lang)
Parameters
string$lang

Definition at line 819 of file Lib.Common.php.

setMailtoAnchor (   $to,
  $acontent = "",
  $subject = "",
  $cc = "",
  $bcc = "",
  $from = "",
  $anchorattr = array(),
  $forcelink = "" 
)

produce an anchor mailto '<a ...>'

Parameters
stringto a valid mail address or list separated by comma -supported by client-
stringanchor content <a...>anchor content
stringsubject
stringcc
stringbcc
arraytreated as html anchor attribute : key is attribute name and value.. value
stringforce link to be produced according the value
Returns
string like user admin dbname anakeen

Definition at line 589 of file Lib.Common.php.

setSystemLogin (   $login)

Definition at line 737 of file Lib.Common.php.

simpleQuery (   $dbaccess,
  $query,
$result = array(),
  $singlecolumn = false,
  $singleresult = false 
)

send simple query to database

Parameters
string$dbaccessaccessdatabase coordonates
string$querysql query
string/array&$result query result
boolean$singlecolumnset to true if only onz field is return
boolean$singleresultset to true is only one row is expected (return the first row). If is combined with singlecolumn return the value not an array
Returns
string error message. Empty message if no errors.

Definition at line 346 of file Lib.Common.php.

+ Here is the call graph for this function:

usefreedomuser ( )

return true if it is possible to manage USER by FREEDOM

Definition at line 708 of file Lib.Common.php.

wbar (   $reste,
  $total,
  $text = "",
  $fbar = false 
)

Definition at line 544 of file Lib.Common.php.

+ Here is the call graph for this function:

wbartext (   $text)

Definition at line 539 of file Lib.Common.php.

+ Here is the call graph for this function:

WhatInitialisation ( )

Initialise WHAT : set global $action whithout an authorized user

Definition at line 720 of file Lib.Common.php.

+ Here is the call graph for this function:

← centre documentaire © anakeen - published under CC License - Dynacase