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. |
void assign_input(
object
&$tpl, array
&$p_rule
)
|
|
assigns template variables according the input & the $p_rule
Parameters:
|
object |
$tpl: |
|
|
array |
$p_rule: |
|
void assign_strings(
string
$lang, string
$page, array
$p_rule
)
|
|
sets the strings for this language
Parameters:
|
string |
$page: |
|
|
string |
$lang: |
|
|
array |
$p_rule: |
|
$string build_query(
array
$query_array
)
|
|
builds a select query according to input variables.
Parameters:
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
void check_lang_include(
file
$file
)
|
|
checks if a given file is language specific
Parameters:
loads data out of the database
void parse_all_includes(
)
|
|
runs run_rule() for every include
void register_file(
string
$path, string
$filename
)
|
|
registers a file
Parameters:
|
string |
$path: |
|
|
string |
$filename: |
|
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 |
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 |
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 |
void set_build_mixed(
bool
$build_mixed
)
|
|
sets $build_mixed
Parameters:
void set_build_pure(
bool
$build_pure
)
|
|
sets $build_pure
Parameters:
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: |
|
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: |
|
void set_clear_path(
bool
$clear_path
)
|
|
sets $clear_path
Parameters:
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(
string
$page, array
&$p_rule
)
|
|
the default output method, gets called from set_output(): path/$lang/$file
Parameters:
|
string |
$page: |
|
|
array |
$p_rule: |
|
void set_error(
string
$error_string
)
|
|
sets $error
Parameters:
void set_files(
array
$new_files
)
|
|
force-set an array of files to be mirrored
Parameters:
array set_i18n(
string
$i18n, [int
$force_mix = 0]
)
|
|
sets the i18n_walk array
Parameters:
|
string |
$i18n: |
|
|
int |
$force_mix: |
|
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:
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: |
|
void set_language_id(
[string
$lang = '']
)
|
|
sets the current language_id
Parameters:
void set_lang_style(
[string
$style = '']
)
|
|
sets the language_style (mixed or not)
Parameters:
void set_mixed_ext(
string
$mixed_ext
)
|
|
sets $mixed_ext
Parameters:
void set_output(
string
$page, array
&$p_rule
)
|
|
sets the output dir to $path/$lang/$page
Parameters:
|
string |
$page: |
|
|
array |
$p_rule: |
|
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: |
|
void set_pure_ext(
string
$pure_ext
)
|
|
sets $pure_ext
Parameters:
void set_query(
array
$query_array
)
|
|
sets $query
Parameters:
void set_rules(
array
$rules
)
|
|
sets _rules according to an input array
Parameters:
void set_tr(
object
&$tr
)
|
|
sets the language object by reference
Parameters:
array split_file_ext(
$page
$page
)
|
|
returns an array with both the filename and the extension
Parameters:
API Tags:
void _create_dir_recursive(
string
$dir
)
|
|
creates a directory recursively
Parameters:
|
string |
$dir: |
the path of the directory to create |