Tangra_Module_Installer __construct(
array
$params
)
|
|
Constructor
Parameter $params is a structured array that must have at least key 'target-path'. Other parameters have to be fed as key-value pairs.
Example $params['smarty-dir'] = '/some/path';
Parameters:
string abstract_path(
string
$item
)
|
|
Converts full path to abstract path, this way files.list is portable between depoyments
This method accepts $item like /var/www/sites/test/hidden/inc/classes/some_class.class.php and converts it to %HIDDEN%inc/classes/some_class.class.php
Parameters:
|
string |
$item: |
Full path of a item |
API Tags:
| Return: | abstracted path |
| Access: | private |
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 backup_files_list(
string
$from_version
)
|
|
Makes a copy of current files.list in order to be used later when generating new one (after upgrade)
Parameters:
API Tags:
boolean can_upgrade(
string
$from_version
)
|
|
This function is called to check if installer can upgrade from given version.
Parameters:
API Tags:
void check_params(
array
$params
)
|
|
Checks if all required parameters are present
Parameters:
API Tags:
Information Tags:
void compile_bulk(
Tangra_Simple_Tple
$tple, string
$source_dir, string
$destination_dir, [boolean
$is_root = true]
)
|
|
Compiles bulk of files contained in $source_dir into $destination_dir
Parameters:
|
Tangra_Simple_Tple |
$tple: |
Tangra_Simple_Tple instance. You have to set all exports before calling this method |
|
string |
$source_dir: |
Relative to $tple->get_tpl_path(). Example: 'htdocs' |
|
string |
$destination_dir: |
Relative to $this->get_target_dir(). Example: 'htdocs/admin' |
|
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:
void compile_tpl_file(
Tangra_Simple_Tple
$tple, string
$file, string
$destination_file, [boolean
$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 |
|
string |
$destination_file: |
Destination file |
|
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:
| Throws: | TE_TMM_Item_Already_Exist |
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:
| Throws: | TE_TMM_Exception,TE_TMM_Item_Already_Exist |
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. Relative to target_path |
API Tags:
Information Tags:
void create_dir_full_path(
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 specified with full path |
API 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:
| Throws: | TE_TMM_Exception,TE_TMM_Item_Already_Exist |
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 |
integer get_dir_permissions(
)
|
|
Returns permission that will be used to chmod installed dirs to
API Tags:
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:
unknown get_target_dir(
)
|
|
Gets root directory of the site where module will be installed
API Tags:
void get_upgrade_method(
string
$from_version
)
|
|
Returns name of the method that will perform upgrade from version $from_version
Name of the metod is lookup in $this->upgrade_matrix
Parameters:
API Tags:
Actual installation. This method have to be overwrited by inherited clases.
API Tags:
boolean is_parameter_present(
array
$params, string
$parameter
)
|
|
Checks if parameter is present
Parameters:
|
array |
$params: |
|
|
string |
$parameter: |
Parameter to be checked |
API Tags:
Activities that have to be performed after actual installation have to be placed here.
If you overwrite this method don't forget to call parent::post_install()
API Tags:
void post_upgrade(
string
$from_version
)
|
|
Activities that have to be performed after actual upgrade have to be placed here.
If you overwrite this method don't forget to call parent::post_upgrade()
Parameters:
API Tags:
Activities that have to be performed before actual installation have to be placed here.
API Tags:
void pre_upgrade(
string
$from_version
)
|
|
Activities that have to be performed before actual upgrade have to be placed here.
If you overwrite this method don't forget to call parent::pre_upgrade()
Parameters:
API Tags:
void remove_section_from_conf_file(
string
$file, [boolean
$strict = true]
)
|
|
Removes module section from conf file
Parameters:
|
string |
$file: |
Path to conh file relative to site target dir |
|
boolean |
$strict: |
If true will throw exception if section does not exists. |
API Tags:
Information Tags:
void set_dir_permissions(
integer
$dir_permissions
)
|
|
Sets permission that will be used to chmod installed dirs to
Please note that you have to pass parameter $dir_permissions without leading zero (for octal value).
Parameters:
|
integer |
$dir_permissions: |
|
API Tags:
void set_files(
array
$files
)
|
|
Sets installed files list.
Parameters:
API Tags:
Information Tags:
void set_file_group(
string
$file_group
)
|
|
Sets usergroup to which intalled files will be chown-ed
Parameters:
API Tags:
void set_file_permissions(
integer
$file_permissions
)
|
|
Sets permission that will be used to chmod installed files to
Please note that you have to pass parameter $file_permissions without leading zero (for octal value).
Parameters:
|
integer |
$file_permissions: |
|
API Tags:
void set_item_permissions(
string
$item
)
|
|
Sets file/dirs permissions and group (if values available)
Parameters:
|
string |
$item: |
Path to file / dir |
API Tags:
void set_module_dir(
string
$module_dir
)
|
|
Sets module source dir
Parameters:
API Tags:
void set_module_name(
string
$name
)
|
|
Sets module name
Parameters:
API Tags:
Information Tags:
void set_overwrite(
boolean
$owr
)
|
|
Sets overwrite flag
Parameters:
API Tags:
void set_overwrite_all(
boolean
$owr
)
|
|
Sets overwrite all flag
Parameters:
API Tags:
void set_target_dir(
string
$target_dir
)
|
|
Sets root directory of the site where module will be installed
Parameters:
API Tags:
Information Tags:
| Throws: | TE_TMM_Target_Dir_Not_Writable, TE_TMM_Target_Dir_Not_Exists, TE_TMM_Target_Dir_Not_Exists |
void set_upgrade_method(
string
$version, string
$method_name
)
|
|
Adds new class method that will handle upgrade from particular version
Parameters:
|
string |
$version: |
|
|
string |
$method_name: |
|
API Tags:
void uninstall(
$params
)
|
|
Deinstallation of the module
Incomplete method. TCC has functionality to remove modules.
Parameters:
API Tags:
void upgrade(
string
$from_version
)
|
|
Performs upgrade of module
Parameters:
API Tags:
Writes installed files list to files.list
API Tags:
void _add_section_to_conf_file(
string
$full_path, string
$section_content
)
|
|
Actual adding of section to conf file
Parameters:
|
string |
$full_path: |
Full path to conf file |
|
string |
$section_content: |
Content of the section |
API Tags:
| Internal: | |
| Access: | private |
void _compile_bulk(
Tangra_Simple_Tple
$tple, string
$source_dir, string
$destination_dir, [boolean
$is_root = true]
)
|
|
Actual compilation of bulk files. See compile_bulk();
This method is not ment to be called directly by the user. Use compile_bulk() instead.
Parameters:
|
Tangra_Simple_Tple |
$tple: |
Tangra_Simple_Tple instance. You have to set all exports before calling this method |
|
string |
$source_dir: |
Relative to $tple->get_tpl_path(). Example: 'htdocs' |
|
string |
$destination_dir: |
Relative to $this->get_target_dir(). Example: 'htdocs/admin' |
|
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:
| Throws: | TE_TMM_Item_Already_Exist,TE_TMM_Exception |
void _compile_tpl_file(
Tangra_Simple_Tple
$tple, string
$file, string
$destination_file
)
|
|
Actual compilation of template file
Parameters:
API Tags:
Information Tags:
void _copy_static_content_bulk(
string
$source_dir, string
$destination_dir, [boolean
$is_root = true]
)
|
|
Recursive copy of given directory (actual copy)
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:
| Throws: | TE_TMM_Item_Already_Exist |
boolean _copy_static_file(
string
$source_file, string
$target_file
)
|
|
Actual copy of file
Parameters:
|
string |
$source_file: |
|
|
string |
$target_file: |
|
API Tags:
| Internal: | |
| Access: | private |
Information Tags:
unknown _create_sym_link(
unknown_type
$source_file, unknown_type
$link_name
)
|
|
Enter description here...
Parameters:
|
unknown_type |
$source_file: |
|
|
unknown_type |
$link_name: |
|
API Tags:
Information Tags: