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

Class: Producer

Source Location: /classes/producer_class.inc

Class Producer

Property Summary
bool   $build_mixed   do we build mixed sites ?
bool   $build_pure   do we do pure language sites ?
bool   $clear_path   do we clear the language path or not ?
array   $error   an array containing the errors
mixed   $files   an array containing the files as items and the directories as keys
object|array   $input   an object or array used to pass stuff
string   $mixed_ext   extention for mixed language content
string   $pure_ext   extention for pure language content
mixed   $query   an array used to build sql queries
mixed   $tr   the translation object
array   $_rules   the config array

[ Top ]
Method Summary
Producer   Producer()   Class constructor.
void   assign_input()   assigns template variables according the input & the $p_rule
void   assign_strings()   sets the strings for this language
$string   build_query()   builds a select query according to input variables.
void   check_consistency()   checks consistency in the configuration
void   check_lang_include()   checks if a given file is language specific
bool   get_build_mixed()   returns $build_mixed
bool   get_build_pure()   returns $build_pure
bool   get_clear_path()   returns $clear_path
void   get_data()   loads data out of the database
array   get_error()   returns $error
array   get_files()   returns $files
void   get_language_id()   returns the language_id
string   get_lang_style()   returns the $lang_style
string   get_mixed_ext()   returns $mixed_ext
string   get_pure_ext()   returns $pure_ext
array   get_query()   returns $query
void   parse_all_includes()   runs run_rule() for every include
void   register_file()   registers a file
void   run()   runs a rule and checks if the rule has to go through a method first.
boolean   run_delete()   runs a certain rule, but only to delete the files it would otherwise create.
boolean   run_rule()   Runs the given producer-rule.
void   set_build_mixed()   sets $build_mixed
void   set_build_pure()   sets $build_pure
void   set_clean_langext_output()   sets the output file to $path/$filename.$lang.ext but drop $lang if it's for mixed content
void   set_clean_output()   sets the output file to $path/$filename (good for single events, articles, comments, ...).
void   set_clear_path()   sets $clear_path
void   set_configuration_values()   sets some variables defined in sf-active.cfg just make sure they're part of $GLOBALS['build'] array TODO: we should assign this dynamically for flexibility reasons.
void   set_default_output()   the default output method, gets called from set_output(): path/$lang/$file
void   set_error()   sets $error
void   set_files()   force-set an array of files to be mirrored
array   set_i18n()   sets the i18n_walk array
void   set_input()   sets $input either an array or object containing values that will be assigned and made available to the template.
void   set_langext_output()   sets the output file to $path/$filename.$lang.ext and keep $lang if it's for mixed content
void   set_language_id()   sets the current language_id
void   set_lang_style()   sets the language_style (mixed or not)
void   set_mixed_ext()   sets $mixed_ext
void   set_output()   sets the output dir to $path/$lang/$page
void   set_page()   sets the page given a page & the path from the rule
void   set_pure_ext()   sets $pure_ext
void   set_query()   sets $query
void   set_rules()   sets _rules according to an input array
void   set_tr()   sets the language object by reference
array   split_file_ext()   returns an array with both the filename and the extension
void   _create_dir_recursive()   creates a directory recursively

[ Top ]
Properties
bool   $build_mixed = true [line 40]

do we build mixed sites ?


[ Top ]
bool   $build_pure = true [line 35]

do we do pure language sites ?


[ Top ]
bool   $clear_path = false [line 30]

do we clear the language path or not ?


[ Top ]
array   $error [line 60]

an array containing the errors


[ Top ]
mixed   $files = array() [line 80]

an array containing the files as items and the directories as keys


[ Top ]
object|array   $input [line 65]

an object or array used to pass stuff


[ Top ]
string   $mixed_ext = 'mix' [line 50]

extention for mixed language content


[ Top ]
string   $pure_ext = '' [line 45]

extention for pure language content


[ Top ]
mixed   $query = array() [line 75]

an array used to build sql queries


[ Top ]
mixed   $tr [line 70]

the translation object


[ Top ]
array   $_rules [line 55]

the config array


[ Top ]
Methods
Constructor Producer  [line 88]

  Producer Producer( [string $config = NULL], [object $input = NULL]  )

Class constructor.

Parameters:
string   $config:  alternate producer.cfg filepath
object   $input:  an object you want to use as input.


[ Top ]
assign_input  [line 320]

  void assign_input( object &$tpl, array &$p_rule  )

assigns template variables according the input & the $p_rule

Parameters:
object   $tpl: 
array   $p_rule: 


[ Top ]
assign_strings  [line 299]

  void assign_strings( string $lang, string $page, array $p_rule  )

sets the strings for this language

Parameters:
string   $page: 
string   $lang: 
array   $p_rule: 


[ Top ]
build_query  [line 563]

  $string build_query( array $query_array  )

builds a select query according to input variables.

Parameters:
array   $query_array: 


[ Top ]
check_consistency  [line 141]

  void check_consistency( )

checks consistency in the configuration

This method will check consistency in the configuration. when things are configured in a way that shouldn't happen, we'll try to correct it and add an error.

example: when $this->clear_path=true, you can't both build pure and mixed content ... we'll fix to mix only



[ Top ]
check_lang_include  [line 525]

  void check_lang_include( file $file  )

checks if a given file is language specific

Parameters:
file   $file: 


[ Top ]
get_build_mixed  [line 643]

  bool get_build_mixed( )

returns $build_mixed



[ Top ]
get_build_pure  [line 627]

  bool get_build_pure( )

returns $build_pure



[ Top ]
get_clear_path  [line 659]

  bool get_clear_path( )

returns $clear_path



[ Top ]
get_data  [line 549]

  void get_data( )

loads data out of the database



[ Top ]
get_error  [line 675]

  array get_error( )

returns $error



[ Top ]
get_files  [line 740]

  array get_files( )

returns $files



[ Top ]
get_language_id  [line 711]

  void get_language_id( )

returns the language_id



[ Top ]
get_lang_style  [line 732]

  string get_lang_style( )

returns the $lang_style



[ Top ]
get_mixed_ext  [line 595]

  string get_mixed_ext( )

returns $mixed_ext



[ Top ]
get_pure_ext  [line 611]

  string get_pure_ext( )

returns $pure_ext



[ Top ]
get_query  [line 691]

  array get_query( )

returns $query



[ Top ]
parse_all_includes  [line 504]

  void parse_all_includes( )

runs run_rule() for every include



[ Top ]
register_file  [line 757]

  void register_file( string $path, string $filename  )

registers a file

Parameters:
string   $path: 
string   $filename: 


[ Top ]
run  [line 200]

  void run( string $rule, [string $page = ''], [mixed $i18n = NULL], string|NULL $i18n   )

runs a rule and checks if the rule has to go through a method first.

Parameters:
string   $rule: 
string   $page: 
string|NULL   $i18n :  TODO: get rid of this. it's ugly


[ Top ]
run_delete  [line 276]

  boolean run_delete( string $rule, [string $page = ''], [string $i18n = NULL], [int $force_mix = 0]  )

runs a certain rule, but only to delete the files it would otherwise create.

Parameters:
string   $rule:  the rule to run
string   $page:  run a certain page
string   $i18n:  if set, pages are only deleted for the given language
int   $force_mix:  will force mix if set

API Tags:
Return:  true upon success, false upon error


[ Top ]
run_rule  [line 226]

  boolean run_rule( string $rule, [mixed $page = ''], [string $i18n = NULL], [int $force_mix = 0]  )

Runs the given producer-rule.

Parameters:
string   $rule:  the rule to run
string   $i18n:  if set, pages are only produced for the given language
int   $force_mix:  will force mixed if set

API Tags:
Return:  true if successfull, false on error


[ Top ]
set_build_mixed  [line 635]

  void set_build_mixed( bool $build_mixed  )

sets $build_mixed

Parameters:
bool   $build_mixed: 


[ Top ]
set_build_pure  [line 619]

  void set_build_pure( bool $build_pure  )

sets $build_pure

Parameters:
bool   $build_pure: 


[ Top ]
set_clean_langext_output  [line 476]

  void set_clean_langext_output( string $page, array &$p_rule  )

sets the output file to $path/$filename.$lang.ext but drop $lang if it's for mixed content

Parameters:
string   $page: 
array   $p_rule: 


[ Top ]
set_clean_output  [line 466]

  void set_clean_output( string $page, array &$p_rule  )

sets the output file to $path/$filename (good for single events, articles, comments, ...).

Parameters:
string   $page: 
array   $p_rule: 


[ Top ]
set_clear_path  [line 651]

  void set_clear_path( bool $clear_path  )

sets $clear_path

Parameters:
bool   $clear_path: 


[ Top ]
set_configuration_values  [line 122]

  void set_configuration_values( )

sets some variables defined in sf-active.cfg just make sure they're part of $GLOBALS['build'] array TODO: we should assign this dynamically for flexibility reasons.



[ Top ]
set_default_output  [line 443]

  void set_default_output( string $page, array &$p_rule  )

the default output method, gets called from set_output(): path/$lang/$file

Parameters:
string   $page: 
array   $p_rule: 


[ Top ]
set_error  [line 667]

  void set_error( string $error_string  )

sets $error

Parameters:
string   $error_string: 


[ Top ]
set_files  [line 748]

  void set_files( array $new_files  )

force-set an array of files to be mirrored

Parameters:
array   $new_files: 


[ Top ]
set_i18n  [line 366]

  array set_i18n( string $i18n, [int $force_mix = 0]  )

sets the i18n_walk array

Parameters:
string   $i18n: 
int   $force_mix: 


[ Top ]
set_input  [line 188]

  void set_input( object &$new_input  )

sets $input either an array or object containing values that will be assigned and made available to the template.

Parameters:
object   $new_input: 


[ Top ]
set_langext_output  [line 456]

  void set_langext_output( string $page, array &$p_rule  )

sets the output file to $path/$filename.$lang.ext and keep $lang if it's for mixed content

Parameters:
string   $page: 
array   $p_rule: 


[ Top ]
set_language_id  [line 699]

  void set_language_id( [string $lang = '']  )

sets the current language_id

Parameters:
string   $lang: 


[ Top ]
set_lang_style  [line 719]

  void set_lang_style( [string $style = '']  )

sets the language_style (mixed or not)

Parameters:
string   $style: 


[ Top ]
set_mixed_ext  [line 587]

  void set_mixed_ext( string $mixed_ext  )

sets $mixed_ext

Parameters:
string   $mixed_ext: 


[ Top ]
set_output  [line 418]

  void set_output( string $page, array &$p_rule  )

sets the output dir to $path/$lang/$page

Parameters:
string   $page: 
array   $p_rule: 


[ Top ]
set_page  [line 405]

  void set_page( string $page, mixed &$p_rule, array $rule  )

sets the page given a page & the path from the rule

Parameters:
string   $page: 
array   $rule: 


[ Top ]
set_pure_ext  [line 603]

  void set_pure_ext( string $pure_ext  )

sets $pure_ext

Parameters:
string   $pure_ext: 


[ Top ]
set_query  [line 683]

  void set_query( array $query_array  )

sets $query

Parameters:
array   $query_array: 


[ Top ]
set_rules  [line 166]

  void set_rules( array $rules  )

sets _rules according to an input array

Parameters:
array   $rules: 


[ Top ]
set_tr  [line 178]

  void set_tr( object &$tr  )

sets the language object by reference

Parameters:
object   $tr: 


[ Top ]
split_file_ext  [line 494]

  array split_file_ext( $page $page  )

returns an array with both the filename and the extension

Parameters:
$page   $page: 

API Tags:
Static:  


[ Top ]
_create_dir_recursive  [line 535]

  void _create_dir_recursive( string $dir  )

creates a directory recursively

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


[ Top ]

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