install/install_utils.php
Functions
add_digits(
$quantity, $string, $min
=
0, $max
=
9
)
:
void
Name | Type | Description |
---|---|---|
$quantity | ||
$string | ||
$min | ||
$max |
commitLanguagePack(
bool $uninstall
=
false
)
:
array
copies the temporary unzip'd files to their final destination removes unzip'd files from system if $uninstall=true
Name | Type | Description |
---|---|---|
$uninstall | bool | uninstall true if uninstalling a language pack |
Type | Description |
---|---|
array | sugar_config |
commitModules(
$unlink
=
false, $type
=
'module'
)
:
void
Name | Type | Description |
---|---|---|
$unlink | ||
$type |
commitPatch(
$unlink
=
false, $type
=
'patch'
)
:
void
Name | Type | Description |
---|---|---|
$unlink | ||
$type |
copyFromArray(
\intput_array $input_array, \needles $needles, \output_array $output_array
)
:
void
given an array it will check to determine if the key exists in the array, if so it will addd to the return array
Name | Type | Description |
---|---|---|
$input_array | \intput_array | haystack to check |
$needles | \needles | list of needles to search for |
$output_array | \output_array | the array to add the keys to |
create_date(
$year
=
null, $mnth
=
null, $day
=
null
)
:
void
Name | Type | Description |
---|---|---|
$year | ||
$mnth | ||
$day |
create_time(
$hr
=
null, $min
=
null, $sec
=
null
)
:
void
Name | Type | Description |
---|---|---|
$hr | ||
$min | ||
$sec |
drop_table_install(
$focus
)
:
void
Drop old tables if table exists and told to drop it
Name | Type | Description |
---|---|---|
$focus |
enableSugarFeeds(
)
:
void
Fully enable SugarFeeds, enabling the user feed and all available modules that have SugarFeed data.
extractFile(
$zip_file, $file_in_zip, $base_tmp_upgrade_dir
)
:
void
Name | Type | Description |
---|---|---|
$zip_file | ||
$file_in_zip | ||
$base_tmp_upgrade_dir |
extractManifest(
$zip_file, $base_tmp_upgrade_dir
)
:
void
Name | Type | Description |
---|---|---|
$zip_file | ||
$base_tmp_upgrade_dir |
getInstalledLanguages(
)
:
array
finds all installed languages and returns an array with the names
Type | Description |
---|---|
array | langs array of installed languages |
getLangPacks(
$display_commit
=
true, $types
=
array('langpack'), $notice_text
=
''
)
:
string
searches upgrade dir for lang pack files.
Name | Type | Description |
---|---|---|
$display_commit | ||
$types | ||
$notice_text |
Type | Description |
---|---|
string | HTML of available lang packs |
getLicenseDisplay(
$type, $manifest, $zipFile, $next_step, $license_file, $clean_file
)
:
void
Name | Type | Description |
---|---|---|
$type | ||
$manifest | ||
$zipFile | ||
$next_step | ||
$license_file | ||
$clean_file |
getPackButton(
string $type, string $manifest, string $zipFile, int $next_step, $uninstallable
=
'Yes', $showButtons
=
true
)
:
string
creates the remove/delete form for langpack page
Name | Type | Description |
---|---|---|
$type | string | type commit/remove |
$manifest | string | manifest path to manifest file |
$zipFile | string | zipFile path to uploaded zip file |
$next_step | int | nextstep current step |
$uninstallable | ||
$showButtons |
Type | Description |
---|---|
string | ret <form> for this package |
handleDbCharsetCollation(
)
:
void
ensures that the charset and collation for a given database is set MYSQL ONLY
handleLog4Php(
)
:
void
handles creation of Log4PHP properties file This function has been deprecated. Use SugarLogger.
handleSugarConfig(
)
:
array
takes session vars and creates config.php
Type | Description |
---|---|
array | bottle collection of error messages |
installerHook(
string $function_name, $options
=
array()
)
:
mixed
Calls a custom function (if it exists) based on the first parameter, and returns result of function call, or 'undefined' if the function doesn't exist
Name | Type | Description |
---|---|---|
$function_name | string | function name to call in custom install hooks |
$options |
Type | Description |
---|---|
mixed | function call result, or 'undefined' |
langPackFinalMove(
object $file
)
:
bool
handles language pack uploads - code based off of upload_file->final_move() puts it into the cache/upload dir to be handed off to langPackUnpack();
Name | Type | Description |
---|---|---|
$file | object | file UploadFile object |
Type | Description |
---|---|
bool | true if successful |
langPackUnpack(
$unpack_type, $full_file
)
:
void
Name | Type | Description |
---|---|---|
$unpack_type | ||
$full_file |
parseAcceptLanguage(
)
:
string
returns lowercase lang encoding
Type | Description |
---|---|
string | encoding or blank on false |
post_install_modules(
)
:
void
This method will look for a file modules_post_install.php in the root directory and based on the contents of this file, it will silently install any modules as specified in this array.
removeLanguagePack(
)
:
void
removes the installed language pack, but the zip is still in the cache dir
unlinkTempFiles(
$manifest
=
'', $zipFile
=
''
)
:
void
Name | Type | Description |
---|---|---|
$manifest | ||
$zipFile |
update_license_settings(
$users, $expire_date, $key, $num_lic_oc
)
:
void
Name | Type | Description |
---|---|---|
$users | ||
$expire_date | ||
$key | ||
$num_lic_oc |