Tangra_Module_Installer __construct(
array
$params
)
|
|
Constructor
Parameter $params is a structured array that must have at least key 'target-dir'. Other parameters have to be fed as key-value pairs.
Example $params['smarty-dir'] = '/some/path';
Parameters:
void add_section_to_conf_file(
string
$file, string
$section_content, [boolean
$strict = false]
)
|
|
Adds new section to conf file
Parameters:
|
string |
$file: |
Path to config file relative to site target dir |
|
string |
$section_content: |
Content of the section |
|
boolean |
$strict: |
If true will throw exception if section already exists. |
API Tags:
Information Tags:
void add_to_files_list_dir(
string
$item
)
|
|
Adds dir to files list
Parameters:
|
string |
$item: |
Full path to the dir |
API Tags:
void add_to_files_list_file(
string
$item
)
|
|
Adds file to files list
Parameters:
|
string |
$item: |
Full path to the file |
API Tags:
void add_to_files_list_symlink(
string
$item
)
|
|
Adds symlink to files list
Parameters:
|
string |
$item: |
Full path to the symlink |
API Tags:
void change_file_properties(
)
|
|
Changes file permisssions and groups
API Tags:
void check_params(
array
$params
)
|
|
Checks if all required parameters are present
Parameters:
API Tags:
Information Tags:
void compile_tpl_file(
Tangra_Simple_Tple
$tple, string
$file, unknown_type
$destination_file, [unknown_type
$special_file = false]
)
|
|
Compiles template file and writes the rezult in destination file. Adds full destination path to files list.
Parameters:
|
Tangra_Simple_Tple |
$tple: |
Template engine object with preassigned values that will be substituted |
|
string |
$file: |
Temlate file |
|
unknown_type |
$destination_file: |
Destination file |
|
unknown_type |
$special_file: |
Flags file that will not be overwrited if just 'overwrite' flag is set. Such files are for example configuration files that you don't want to get overwrited when preinstalling module. If you want to overwrite special files use 'overwrite-all' flag. |
API Tags:
Information Tags:
Copies module.ctrl file to modules conf dir
API Tags:
| Internal: | |
| Access: | private |
Information Tags:
void copy_static_content_bulk(
string
$source_dir, string
$destination_dir, [boolean
$is_root = true]
)
|
|
Recursive copy of given directory
Parameters:
|
string |
$source_dir: |
Source dir |
|
string |
$destination_dir: |
destination dir |
|
boolean |
$is_root: |
If false tries to create $destionation_dir if not already exist. If true will copy just the content of $source_dir. |
API Tags:
Information Tags:
void copy_static_file(
string
$source_file, string
$target_file, [boolean
$special_file = false]
)
|
|
Copies file.
Parameters:
|
string |
$source_file: |
Path to source file relative to module source dir |
|
string |
$target_file: |
Path to target file relative to site target path |
|
boolean |
$special_file: |
Flags file that will not be overwrited if just 'overwrite' flag is set. Such files are for example configuration files that you don't want to get overwrited when preinstalling module. If you want to overwrite special files use 'overwrite-all' flag. |
API Tags:
Information Tags:
void create_dir(
string
$dir
)
|
|
Creates directory and adds it to files list.
If directory already exists is just added to files list.
Parameters:
|
string |
$dir: |
Directory to be created |
API Tags:
Information Tags:
void create_module_conf_dir(
)
|
|
Creates modules conf dir (hidden/conf/modules)
API Tags:
| Abstract: | |
| Access: | protected |
void create_module_dir(
string
$modules_conf_dir
)
|
|
Creates module's config dir, i.e. where module.ctrl file will be installed
Parameters:
|
string |
$modules_conf_dir: |
|
API Tags:
void create_sym_link(
string
$source_file, string
$link_name, [string
$alternative_source_for_copy = '']
)
|
|
Creates symlink and adds it to files list
Parameters:
|
string |
$source_file: |
Source file that symlink will point to |
|
string |
$link_name: |
Link name |
|
string |
$alternative_source_for_copy: |
If symlinks are not available (like in Windows), just copy this file instead of creating symlink |
API Tags:
Information Tags:
array find_start_and_end_of_conf_section(
array
$arr
)
|
|
Find start and end indexes of module's section
Parameters:
API Tags:
| Return: | Structured array 'start' => start index, 'end' => end index |
| Internal: | |
| Access: | private |
Returns installed files list
API Tags:
unknown get_file_group(
)
|
|
Returns usergroup to which intalled files will be chown-ed
API Tags:
integer get_file_permissions(
)
|
|
Returns permission that will be used to chmod installed files to
API Tags:
unknown get_module_dir(
)
|
|
Returns module source dir
API Tags:
string get_module_name(
)
|
|
Returns module name
API Tags:
Returns overwrite flag
API Tags:
boolean get_overwrite_all(
)
|
|
Returns overwrite all flag
API Tags: