Core  3.2
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

 FDL
 

Functions

 N_ ($s)
 
if(!function_exists('pgettext')) ___ ($message, $context="")
 
 n___ ($message, $message_plural, $num, $context="")
 
 print_r2 ($z, $ret=false)
 
 AddLogMsg ($msg, $cut=80)
 
 deprecatedFunction ($msg= '')
 
 addWarningMsg ($msg)
 
 mb_ucfirst ($s)
 
 mb_trim ($string)
 
 setMaxExecutionTimeTo ($limit)
 
 getMailAddr ($userid, $full=false)
 
 getTmpDir ($def= '/tmp')
 
 getParam ($name, $def="")
 must be in core or global type More...
 
 getCoreParam ($name, $def="")
 must be in core or global type More...
 
 getSessionValue ($name, $def="")
 
 getCurrentUser ()
 
 getLayoutFile ($app, $layfile)
 
 microtime_diff ($a, $b)
 
 getDebugStack ($slice=1)
 
 logDebugStack ($slice=1, $msg="")
 
 getDbid ($dbaccess)
 
 getDbAccess ()
 
 getDbAccessCore ()
 
 getDbAccessFreedom ()
 
 getDbEnv ()
 
 getFreedomContext ()
 
 getServiceCore ()
 
 getDbAccessValue ($varName)
 
 getServiceFreedom ()
 
 getDbName ($dbaccess)
 
 getServiceName ($dbaccess)
 
 simpleQuery ($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
 
 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)
 
 WhatInitialisation ($session=null)
 
 setSystemLogin ($login)
 
 mkpasswd ($length=8, $charspace="")
 
 getLcdate ()
 
 getLocaleConfig ($core_lang= '')
 
 getLocales ()
 
 setLanguage ($lang)
 

Function Documentation

if (!function_exists('pgettext')) ___ (   $message,
  $context = "" 
)

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

AddLogMsg (   $msg,
  $cut = 80 
)

send a message to system log

Parameters
string$msgmessage to log
int$cutsize limit

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

addWarningMsg (   $msg)

send a warning msg to the user interface

Parameters
string$msg

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

bgexec (   $tcmd,
$result,
$err 
)

exec list of unix command in background

Parameters
array$tcmdunix command strings
$result
$err

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

+ Here is the call graph for this function:

deprecatedFunction (   $msg = '')

send a message to system log

Parameters
string$msg

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

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

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

+ Here is the call graph for this function:

getAuthProvider (   $freedomctx = "")
Parameters
string$freedomctx
Deprecated:
Returns
string

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

+ Here is the call graph for this function:

getAuthProviderList (   $freedomctx = "")
Parameters
string$freedomctx
Deprecated:
Returns
array

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

+ Here is the call graph for this function:

getAuthType (   $freedomctx = "")
Parameters
string$freedomctx
Deprecated:
Returns
string

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

+ Here is the call graph for this function:

getAuthTypeParams (   $freedomctx = "")
Deprecated:
Parameters
string$freedomctx
Returns
array|mixed
Exceptions
\Dcp\Exception

Definition at line 575 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 209 of file Lib.Common.php.

+ Here is the call graph for this function:

getCurrentUser ( )

return current log in user

Returns
Account

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

getDbAccess ( )

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

+ Here is the call graph for this function:

getDbAccessCore ( )

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

+ Here is the call graph for this function:

getDbAccessFreedom ( )

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

+ Here is the call graph for this function:

getDbAccessValue (   $varName)

return variable from dbaccess.php

Parameters
string$varName
Returns
string|null
Exceptions
Dcp\Exception

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

getDbEnv ( )
Deprecated:
context notion are be deleted
Returns
string

PhpDeprecationInspection

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

+ Here is the call graph for this function:

getDbid (   $dbaccess)

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

+ Here is the call graph for this function:

getDbName (   $dbaccess)

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

+ Here is the call graph for this function:

getDebugStack (   $slice = 1)

return call stack

Parameters
int$slicelast call to not return
Returns
array

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

getFreedomContext ( )
Deprecated:
context notion are be deleted
Returns
string

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

getJsVersion ( )

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

getLayoutFile (   $app,
  $layfile 
)

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

getLcdate ( )

return lcdate use in database : 'iso' Note: old 'dmy' format is not used since 3.2.8

Returns
string 'iso'

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

getLocaleConfig (   $core_lang = '')
Parameters
string$core_lang
Returns
bool|array

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

+ Here is the call graph for this function:

getLocales ( )

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

getMailAddr (   $userid,
  $full = false 
)

get mail addr of a user

Parameters
int$useridsystem user identifier
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 133 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 193 of file Lib.Common.php.

+ Here is the call graph for this function:

getServiceCore ( )

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

getServiceFreedom ( )

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

+ Here is the call graph for this function:

getServiceName (   $dbaccess)

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

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

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

getTmpDir (   $def = '/tmp')

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

+ Here is the call graph for this function:

getUserId ( )

get the system user id

Returns
int

Definition at line 608 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 identifier 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 594 of file Lib.Common.php.

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
mixed$string,oran array from a file() function.
Returns
boolean

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

+ Here is the call graph for this function:

logDebugStack (   $slice = 1,
  $msg = "" 
)
Parameters
int$slice
Returns
void

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

+ Here is the call graph for this function:

mb_trim (   $string)

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

mb_ucfirst (   $s)

like ucfirst for utf-8

Parameters
$s
Returns
string

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

microtime_diff (   $a,
  $b 
)

Definition at line 302 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 802 of file Lib.Common.php.

N_ (   $s)

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

n___ (   $message,
  $message_plural,
  $num,
  $context = "" 
)

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

print_r2 (   $z,
  $ret = false 
)

Definition at line 65 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 759 of file Lib.Common.php.

setLanguage (   $lang)

use new locale language

Parameters
string$langlike fr_FR, en_US
Exceptions
\Dcp\Core\Exception

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

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

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

Parameters
string$toa valid mail address or list separated by comma -supported by client-
string$acontent
string$subject
string$cc
string$bcc
string$from
array$anchorattr
string$forcelink

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

setMaxExecutionTimeTo (   $limit)

increase limit if current limit is lesser than

Parameters
int$limitnew limit in seconds

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

setSystemLogin (   $login)

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

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

send simple query to database

Parameters
string$dbaccessaccess database coordonates
string$querysql query
string | bool | array&$resultquery result
bool$singlecolumnset to true if only one field is return
bool$singleresultset to true is only one row is expected (return the first row). If is combined with singlecolumn return the value not an array, if no results and $singlecolumn is true then $results is false
bool$useStrictset to true to force exception or false to force no exception, if null use global parameter
Exceptions
Dcp\Db\Exception
Returns
string error message. Empty message if no errors (when strict mode is not enable)

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

+ Here is the call graph for this function:

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

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

wbartext (   $text)

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

+ Here is the call graph for this function:

WhatInitialisation (   $session = null)

Initialise WHAT : set global $action whithout an authorized user

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

+ Here is the call graph for this function:

← centre documentaire © anakeen