dev.obliquid.com: general
[ class tree: general ] [ index: general ] [ all elements ]

Class: util

Source Location: Program_Root/classes/general/util.php

Class Overview


a collection of static utilities


Methods


Inherited Variables

Inherited Methods


Class Details

[line 29]
a collection of static utilities





[ Top ]


Class Methods


method du [line 181]

String du( mixed $dir)

du size of a directory, unix only. requires popen command.





[ Top ]

method formatEuro [line 108]

text formatEuro( integer $inbuffer, [text $l = ""])

formats an euro money amount



Tags:

return:  the number as a formatted string


Parameters:

integer   $inbuffer   the euro amount to pretty print
text   $l   optional locale used to format the amount, if no locale is specified, use the current one

[ Top ]

method format_lit [line 139]

String format_lit( inbuffer $inbuffer)

formats a lire money amount



Tags:

return:  the number as a formatted string


Parameters:

inbuffer   $inbuffer   int - the lire amount to pretty print

[ Top ]

method getDirectory [line 290]

array getDirectory( text $dirPath)

Get files of a directory in an array.

Return an array of arrays. The file name is in position 0, other positions are free for future improvements (filesize...).




Tags:

return:  file list


Parameters:

text   $dirPath   the directory to list

[ Top ]

method getImage [line 81]

String getImage( mixed $db, mixed $table, mixed $col_name, mixed $id, [mixed $header = false])

outputs a blob from the db to the http stream. the table has to have

(id, $col_name, $col_name_mime)






[ Top ]

method human_size [line 193]

String human_size( mixed $bytes)

Formats a size in bytes in a human readable way

Example: human_size(343373737) gives 327.47 Mb






[ Top ]

method imageResize [line 226]

info imageResize( in_file $in_file, out_file $out_file, width $width, [height $height = 0], [resample $resample = true])

method to adjust the image file for the pictures

Modified version of code found at www.php.net from spamhole at gmx dot at Modified by Nick Vrtis and by Stefano Locati




Tags:

return:  array from GETIMAGESIZE. Or false if GD not installed or conversion was not successful. Add's imginfo[4] which has the correct suffix to the filename It also renames the original input file to have the suffix.


Parameters:

in_file   $in_file   the name of the input file
out_file   $out_file   the name of the input file
width   $width   new width -- if it's 0 it will be resized proportionally on height
height   $height   new height -- if it's 0 it will be resized proportionally on width
resample   $resample   boolean true resamples, false resizes -- optional, default true

[ Top ]

method isKey [line 37]

boolean isKey( array $myarray, text $key)

returns true if $key is a key of the array $array



Tags:

return:  true if the key was found


Parameters:

array   $myarray   the array to be searched
text   $key   the key to be found

[ Top ]

method makeLinks [line 206]

void makeLinks( mixed $text)

Makes links in text clickable html

http://www.php.net/preg_replace






[ Top ]

method newId [line 68]

int newId( object $db, text $table, [text $key = "ID"])

finds a new id for the specified table (pear db)

this method is deprecated, use Metabase getSequenceNextValue() instead






Parameters:

object   $db   a reference to pear db
text   $table   the table to be used
text   $key   name of the primary key

[ Top ]

method saveBlob [line 49]

void saveBlob( mixed $db, mixed $table_name, mixed $col_name, mixed $cond, mixed $file_name, [mixed $mime = "image/gif"])

saves a blob in the db (mysql)





[ Top ]

method valid_email [line 308]

boolean valid_email( text $email)

Checks is the provided email address is formally valid



Tags:

return:  true if the email is valid, false otherwise


Parameters:

text   $email   email address to be checked

[ Top ]

method valid_filename [line 164]

boolean valid_filename( mixed $filename)

checks if a filename is valid

rules for being a valid filename/foldername: should be >= 1 char and <= 64 char allowed chars are a-z 0-9 _ -




Tags:

return:  true if it is, false if it's not


[ Top ]


Documentation generated on Tue, 29 Mar 2005 09:04:46 -0800 by phpDocumentor 1.2.0rc2