pclib  3.0.0
Lightweight PHP framework
Functions
Func.php File Reference

PClib constants, global functions and variables. More...

Functions

 dump ()
 Dump variable(s) for debugging and stop application. More...
 
 ddump ()
 Dump variable(s) for debugging to the debug log. More...
 
 jdump ()
 Dump variable(s) for debugging to the javascript console. More...
 
 pri ($id)
 Return string "ID='$id'". More...
 
 paramStr ($str, $params, $keepEmpty=false)
 Replace {param} placeholders in string with values from array $param. More...
 
 mimetype ($path)
 Return mime-type of the file $path. More...
 
 filedata ($path, $force_download=false, $filename=null)
 Send file $path to output through php (so real path to file is hidden). More...
 
 safe_session_start ($httpsOnly=false)
 Configure session cookie for safe usage and call session_start().
 

Detailed Description

PClib constants, global functions and variables.

Author
-dk- lenoc.nosp@m.hwar.nosp@m.e@gma.nosp@m.il.c.nosp@m.om http://pclib.brambor.net/

Function Documentation

◆ ddump()

ddump ( )

Dump variable(s) for debugging to the debug log.

Usage: ddump($a,$b,...);

◆ dump()

dump ( )

Dump variable(s) for debugging and stop application.

Usage: dump($a,$b,...);

◆ filedata()

filedata (   $path,
  $force_download = false,
  $filename = null 
)

Send file $path to output through php (so real path to file is hidden).

You can force browser download dialog or show file name as $filename.

◆ jdump()

jdump ( )

Dump variable(s) for debugging to the javascript console.

Usage: jdump($a,$b,...);

◆ mimetype()

mimetype (   $path)

Return mime-type of the file $path.

It uses linux command 'file', so it works only on *nix with exec() allowed. On windows you can set array of extension => mime-type pairs into pclib.mimetypes config variable.

◆ paramStr()

paramStr (   $str,
  $params,
  $keepEmpty = false 
)

Replace {param} placeholders in string with values from array $param.

Deprecated:
Use Str::format() instead.

◆ pri()

pri (   $id)

Return string "ID='$id'".

Helper for db queries on primary key.

Deprecated:
Use [ID => $id] instead.