phpDocumentor sf-active
base_classes
[ class tree: sf-active ] [ index: sf-active ] [ all elements ]

Class: Cache

Source Location: /classes/cache_class.inc

Class Cache

Direct descendents
Child Class Description
Calendar This class is used for rendering the small monthly calendars at the top of the weekly view of events
Event The Event class is used to define an event in the calendar
Minical creates a list of events to be presented on the frontpage.
Webcast webcast class represents all pieces of media published to the site through the open publishing mechanism.
WebcastMedia WebcastMedia class represents a multimedia file and it's properties in the system.
WebcastText WebcastText class represents the text parts of an article in the system.
language class for language related code.
LocalPage similar to the Page class, but is used for local pages (process pages, ...).
Newswire generates the newswire.
Page The Page class is used to build and compile pages.
Spam class to deal with spam.
User class to maintain users who have access to the administration system.
feature_photo Class Feature Photo
Media The media class sets properties for uploaded files.
Newsroom newsroom class
Article the article class represents an article in the system. it contains all code to handle articles.
Category represents a category in the system
Feature The feature class represents an article in the center column of a category.
Config A simple class to manipulate a single config file for a set of php scripts

[ Top ]
Property Summary
array   $allowed_html_tags   acceptable html tags (for kses)
array   $allowed_text_tags   acceptable text tags (for kses)
string   $cachestatus   An HTML-ready display of cache notices
string   $errorstatus   An HTML-ready display of error notices
array   $upload_target_url   Temporary array for upload targets

[ Top ]
Method Summary
void   cache_file()   writes a file to disk given it's content and the path.
void   cache_ram_file()   caches a ram file to disk given a upload target, a year and a month.
void   cache_var()   Writes an array or other variable to disk, in a php-readable format
void   check_file_path()   this method will check if your filepath is ok (so no .. and stuff like that).
string   clean()   adds slashes to a string if get_magic_quotes_runtime isn't set
void   cleanup_email()   cleans up an email_address
void   cleanup_filename()   cleans up the name of file
void   cleanup_html_value()   cleans up a value that is published as html
void   cleanup_number()   cleans up a number
void   cleanup_pathname()   cleans up the name of a path.
void   cleanup_post()   Removes dangerous HTML from data submitted via POST
void   cleanup_text_value()   cleans up a value that is allowed to contain limited html (an article submitted as text/plain)
void   cleanup_value()   cleans up a value that should not contain any html at all (the normal procedure)
void   clear_error_status()   Clears any existing error status
void   clear_update_status()   Clears any existing update status
void   create_dir_recursive()   creates a directory recursively
void   create_upload_dirs()   this will create the directories we move the article and uploaded files to if they don't exist yet
string   display_error_status()   displays the error status.
string   do_form()   calls the form we want to use in the publish process given it's name and various options.
void   dump()   dumps a variable encapsulated in html
array   get_allowed_html_tags()   returns $allowed_html_tags
array   get_allowed_text_tags()   returns {$link $allowed_text_tags}
string   get_antispam_mail()   returns an emailaddress with antispam blocks in.
void   get_cached_var()   Retrieve a cached variable from disk
string   get_error_status()   returns the $errorstatus
array   get_months()   returns an array of months from 01 to 12
string   get_update_status()   returns the $cachestatus
array   get_years()   returns an array of years for your calendar
bool   is_error()   Returns true if there is an existing error
array   list_directories()   List the directories in the specified path
array   list_files()   Lists the files in the specified directory path
string   make_checkbox_form()   renders a checkbox form given it's name, an array with options and an option-array to preselect
string   make_multiple_form()   renders a multiple given it's name, an array with options and an option-array to preselect
string   make_select_form()   renders a select form given it's name, an array with options and an option to preselect
void   make_video_thumbnail()   make a "video thumbnail" of a video uploads
void   mirror_html()   mirrors your html files.
void   mirror_media()   mirrors your media files
void   process_file_metadata()   gets metadata from media file headers and stores them
void   process_uploads()   process any uploads from a POST
mixed   rel2abs()   Replaces any relative links with absolute links
void   rel2absfield()   Like rel2abs, replaces relative links with absolute links
string   render_entities()   strips tags and replaces <,> & ' out of a given html string by their htmlentities
string   render_protest_date()   This creates the protest-style dates, like J18 given an input date-string.
string   render_var()   Renders an array or other variable into php code
string   render_yearmonth_link()   returns a file path given a year and month
void   replace_rte_tags()   startx: replaces ugly tags from rte editor
void   set_allowed_html_tags()   sets $allowed_html_tags
void   set_allowed_text_tags()   sets $allowed_text_tags
int   set_date_from_smarty()   sets a unix timestamp from a smarty date array
string   set_mysql_date_from_smarty()   sets a mysql datetime from a smarty date/time array
void   sf_error_log()   logs an error. (don't know how it's used atm)
void   update_error_status()   Allows easy access to adding an update string
void   update_status()   Allows easy access to adding an update string
bool   validate_event_post()   does error checking for $_POST data for a posted event.
bool   validate_post()   does error checking on $_POST data for an article or comment.
void   validate_uploads()   error checking for files submitted via POST

[ Top ]
Properties
array   $allowed_html_tags [line 51]

acceptable html tags (for kses)


[ Top ]
array   $allowed_text_tags [line 46]

acceptable text tags (for kses)


[ Top ]
string   $cachestatus [line 31]

An HTML-ready display of cache notices


[ Top ]
string   $errorstatus [line 36]

An HTML-ready display of error notices


[ Top ]
array   $upload_target_url [line 41]

Temporary array for upload targets


[ Top ]
Methods
cache_file  [line 225]

  void cache_file( string $html, string $filename  )

writes a file to disk given it's content and the path.

Parameters:
string   $html:  content of the file
string   $filename:  path to the file.


[ Top ]
cache_ram_file  [line 852]

  void cache_ram_file( string $upload_target, string $year, string $month  )

caches a ram file to disk given a upload target, a year and a month.

Parameters:
string   $upload_target:  path to a realaudio/video file
string   $year:  a given year in yyyy format
string   $month:  a given year in mm format


[ Top ]
cache_var  [line 264]

  void cache_var( mixed $var, string $var_name, string $filename, [string $prefix = '_LITERAL_'], bool $force_var  )

Writes an array or other variable to disk, in a php-readable format

if the variable is an array with an element that is a string beginning with the value '_LITERAL_' or optional alternative unique prefix, then it will fix the output so that the variable remains unparsed

Parameters:
mixed   $var: 
string   $var_name: 
string   $filename: 
string   $prefix: 
bool   $force_var: 


[ Top ]
check_file_path  [line 993]

  void check_file_path( $string $filename  )

this method will check if your filepath is ok (so no .. and stuff like that).

Parameters:
$string   $filename: 


[ Top ]
clean  [line 106]

  string clean( string $dirty_string  )

adds slashes to a string if get_magic_quotes_runtime isn't set

Parameters:
string   $dirty_string: 


[ Top ]
cleanup_email  [line 1235]

  void cleanup_email( mixed $email  )

cleans up an email_address



[ Top ]
cleanup_filename  [line 1253]

  void cleanup_filename( mixed $filename  )

cleans up the name of file



[ Top ]
cleanup_html_value  [line 1228]

  void cleanup_html_value( mixed $user_input  )

cleans up a value that is published as html



[ Top ]
cleanup_number  [line 1244]

  void cleanup_number( mixed $number  )

cleans up a number



[ Top ]
cleanup_pathname  [line 1260]

  void cleanup_pathname( mixed $pathname  )

cleans up the name of a path.



[ Top ]
cleanup_post  [line 375]

  void cleanup_post( )

Removes dangerous HTML from data submitted via POST



Redefined in descendants as:

[ Top ]
cleanup_text_value  [line 1221]

  void cleanup_text_value( mixed $user_input  )

cleans up a value that is allowed to contain limited html (an article submitted as text/plain)



[ Top ]
cleanup_value  [line 1214]

  void cleanup_value( mixed $user_input  )

cleans up a value that should not contain any html at all (the normal procedure)



[ Top ]
clear_error_status  [line 149]

  void clear_error_status( )

Clears any existing error status



[ Top ]
clear_update_status  [line 70]

  void clear_update_status( )

Clears any existing update status



[ Top ]
create_dir_recursive  [line 1099]

  void create_dir_recursive( string $dir  )

creates a directory recursively

Parameters:
string   $dir:  the path of the directory to create


[ Top ]
create_upload_dirs  [line 974]

  void create_upload_dirs( )

this will create the directories we move the article and uploaded files to if they don't exist yet



[ Top ]
display_error_status  [line 193]

  string display_error_status( )

displays the error status.



[ Top ]
do_form  [line 877]

  string do_form( string $form_name, array $options, [array $match_array = array()], mixed $match  )

calls the form we want to use in the publish process given it's name and various options.

Parameters:
string   $form_name:  string containing the name the form will have in the html.
array   $options:  array containing the options we have to render for a given form.
array   $match_array:  array containing all the matches (needed for checkbox and multiple forms).
mixed   $match:  a string or an integer we can use to set selected="selected" in select forms.


[ Top ]
dump  [line 182]

  void dump( mixed $var  )

dumps a variable encapsulated in html

Parameters:
mixed   $var: 


[ Top ]
get_allowed_html_tags  [line 1192]

  array get_allowed_html_tags( )

returns $allowed_html_tags



[ Top ]
get_allowed_text_tags  [line 1207]

  array get_allowed_text_tags( )

returns {$link $allowed_text_tags}



[ Top ]
get_antispam_mail  [line 1014]

  string get_antispam_mail( string $email  )

returns an emailaddress with antispam blocks in.

Parameters:
string   $email: 


Redefined in descendants as:

[ Top ]
get_cached_var  [line 242]

  void get_cached_var( string $varname, [string $filename = null]  )

Retrieve a cached variable from disk

Optional parameter $filename specifies the file path Defaults to looking for "{$varname}.inc" in SF_CACHE_PATH

Parameters:
string   $varname:  varname
string   $filename:  filename


[ Top ]
get_error_status  [line 160]

  string get_error_status( )

returns the $errorstatus



[ Top ]
get_months  [line 1125]

  array get_months( )

returns an array of months from 01 to 12



[ Top ]
get_update_status  [line 81]

  string get_update_status( )

returns the $cachestatus



[ Top ]
get_years  [line 1114]

  array get_years( )

returns an array of years for your calendar



Redefined in descendants as:

[ Top ]
is_error  [line 208]

  bool is_error( )

Returns true if there is an existing error



[ Top ]
list_directories  [line 322]

  array list_directories( string $path  )

List the directories in the specified path

Parameters:
string   $path: 


[ Top ]
list_files  [line 305]

  array list_files( string $path, [string $filter = NULL]  )

Lists the files in the specified directory path

Matching the specified filter (simple string position match)

Parameters:
string   $path: 
string   $filter: 


[ Top ]
make_checkbox_form  [line 951]

  string make_checkbox_form( mixed $checkbox_name, array $options, mixed $checked, string $select_name, array $match  )

renders a checkbox form given it's name, an array with options and an option-array to preselect

Parameters:
string   $select_name:  the name of the select form.
array   $options:  an array contain all the &lt;option ...&gt; we'll need
array   $match:  an array containing the options we want to preselect.


[ Top ]
make_multiple_form  [line 925]

  string make_multiple_form( string $select_name, array $options, array $match  )

renders a multiple given it's name, an array with options and an option-array to preselect

Parameters:
string   $select_name:  the name of the select form.
array   $options:  an array contain all the &lt;option ...&gt; we'll need
array   $match:  an array containing the options we want to preselect.


[ Top ]
make_select_form  [line 902]

  string make_select_form( string $select_name, array $options, mixed $match  )

renders a select form given it's name, an array with options and an option to preselect

Parameters:
string   $select_name:  the name of the select form.
array   $options:  an array contain all the &lt;option ...&gt; we'll need
mixed   $match:  a string/integer we want to match again to preselect that option.


[ Top ]
make_video_thumbnail  [line 1030]

  void make_video_thumbnail( string $filename, string $mimetype  )

make a "video thumbnail" of a video uploads

NOTES: depends on ffmpeg only works on avi, mpeg and some mov

Parameters:
string   $filename: 
string   $mimetype: 

Information Tags:
Author:  matt toups <mtoups@indymedia.org>

[ Top ]
mirror_html  [line 1138]

  void mirror_html( )

mirrors your html files.

placed the method here since every Page based class extends from cache



[ Top ]
mirror_media  [line 1152]

  void mirror_media( )

mirrors your media files

placed method here since the media-file validation methods are here so it should be easy to get the array stored in cache_class somehow



[ Top ]
process_file_metadata  [line 646]

  void process_file_metadata( string $filename, string $mimetype  )

gets metadata from media file headers and stores them

NOTES: right now, just works on audio files (ogg vorbis, mp3) also, depends upon PEAR's File_Ogg package (use "pear install File_Ogg" ... may also have to do "pear config-set preferred_state beta" )

TODO: sane rounding for the ogg metadata numbers get mp3 working actually store the metadata (in db table) pdf support (pdfinfo)

Parameters:
string   $filename: 
string   $mimetype: 

Information Tags:
Author:  matt toups <mtoups@indymedia.org>

[ Top ]
process_uploads  [line 685]

  void process_uploads( )

process any uploads from a POST



[ Top ]
rel2abs  [line 123]

  mixed rel2abs( mixed $htmlstr  )

Replaces any relative links with absolute links

works on both hrefs and most img tags

Parameters:
mixed   $htmlstr: 


[ Top ]
rel2absfield  [line 139]

  void rel2absfield( string $fieldstr  )

Like rel2abs, replaces relative links with absolute links

works on a field containing the URL rather than expecting HTML code

Parameters:
string   $fieldstr: 


[ Top ]
render_entities  [line 366]

  string render_entities( string $html  )

strips tags and replaces <,> & ' out of a given html string by their htmlentities

Parameters:
string   $html:  html that needs to be cleaned a little.


[ Top ]
render_protest_date  [line 355]

  string render_protest_date( string $created  )

This creates the protest-style dates, like J18 given an input date-string.

Parameters:
string   $created:  string containing the date


[ Top ]
render_var  [line 284]

  string render_var( mixed $var, string $var_name, [string $prefix = '_LITERAL_'], bool $force_var  )

Renders an array or other variable into php code

if the variable is an array with an element that is a string beginning with the value '_LITERAL_' or optional alternative unique prefix, then it will fix the output so that the variable remains unparsed

by default we'll cache vars as under the $this->tkeys array so they are directly assigned to smarty. if the optional $force_var is set to 1, we'll cache the var under it's own name.

Parameters:
mixed   $var: 
string   $var_name: 
string   $prefix: 
bool   $force_var: 


[ Top ]
render_yearmonth_link  [line 341]

  string render_yearmonth_link( string $new_year, string $new_month  )

returns a file path given a year and month

Parameters:
string   $new_year:  string containing the year in yyyy format
string   $new_month:  string containing the month in mm format.


[ Top ]
replace_rte_tags  [line 1269]

  void replace_rte_tags( mixed $user_input  )

startx: replaces ugly tags from rte editor



[ Top ]
set_allowed_html_tags  [line 1163]

  void set_allowed_html_tags( )

sets $allowed_html_tags



[ Top ]
set_allowed_text_tags  [line 1199]

  void set_allowed_text_tags( )

sets $allowed_text_tags



[ Top ]
set_date_from_smarty  [line 1072]

  int set_date_from_smarty( array $date_array  )

sets a unix timestamp from a smarty date array

Parameters:
array   $date_array: 

API Tags:
Static:  


[ Top ]
set_mysql_date_from_smarty  [line 1087]

  string set_mysql_date_from_smarty( array $date_array  )

sets a mysql datetime from a smarty date/time array

Parameters:
array   $date_array:  date_array

API Tags:
Static:  


[ Top ]
sf_error_log  [line 169]

  void sf_error_log( string $error  )

logs an error. (don't know how it's used atm)

Parameters:
string   $error: 


[ Top ]
update_error_status  [line 90]

  void update_error_status( string $update_string  )

Allows easy access to adding an update string

Parameters:
string   $update_string:  string containing the error.


[ Top ]
update_status  [line 57]

  void update_status( string $update_string  )

Allows easy access to adding an update string

Parameters:
string   $update_string:  string containing the cachestatus


[ Top ]
validate_event_post  [line 437]

  bool validate_event_post( )

does error checking for $_POST data for a posted event.



[ Top ]
validate_post  [line 392]

  bool validate_post( )

does error checking on $_POST data for an article or comment.



[ Top ]
validate_uploads  [line 462]

  void validate_uploads( )

error checking for files submitted via POST

while here we orignally only did error checking for uploaded files, we now also will call the Image::validate_image() from here.



[ Top ]

Documentation generated on Tue, 24 Jun 2008 01:02:45 -0700 by phpDocumentor 1.3.0RC3