PHP 클래스 FOF30\Utils\InstallScript

파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cliScriptFiles array A list of scripts to be copied to the "cli" directory of the site
$cliSourcePath string The path inside your package where cli scripts are stored
$componentName string The component's name
$componentTitle string The title of the component (printed on installation and uninstallation messages)
$isPaid boolean Is this the paid version of the extension? This only determines which files / extensions will be removed.
$maximumJoomlaVersion string The maximum Joomla! version this extension can be installed on
$minimumJoomlaVersion string The minimum Joomla! version required to install this extension
$minimumPHPVersion string The minimum PHP version required to install this extension
$postInstallationMessages array This array contains the message definitions for the Post-installation Messages component added in Joomla! 3.2 and later versions. Each element is also a hashed array. For the keys used in these message definitions please
$removeFilesAllVersions array Obsolete files and folders to remove from both paid and free releases. This is used when you refactor code and some files inevitably become obsolete and need to be removed.
$removeFilesFree array Obsolete files and folders to remove from the free version only. This is used when you move a feature from the free version of your extension to its paid version. If you don't have such a distinction you can ignore this.
$schemaXmlPath string The path where the schema XML files are stored. Its contents depend on the schemaXmlPathRelative variable above true => schemaXmlPath contains a path relative to the component's back-end directory false => schemaXmlPath contains an absolute filesystem path
$schemaXmlPathRelative boolean Is the schemaXmlPath class variable a relative path? If set to true the schemaXmlPath variable contains a path relative to the component's back-end directory. If set to false the schemaXmlPath variable contains an absolute filesystem path.
$uninstallation_queue array The list of obsolete extra modules and plugins to uninstall on component upgrade / installation.

공개 메소드들

메소드 설명
postflight ( string $type, JInstallerAdapterComponent $parent ) Runs after install, update or discover_update. In other words, it executes after Joomla! has finished installing or updating your component. This is the last chance you've got to perform any additional installations, clean-up, database updates and similar housekeeping functions.
preflight ( string $type, JInstallerAdapterComponent $parent ) : boolean Joomla! pre-flight event. This runs before Joomla! installs or updates the component. This is our last chance to tell Joomla! if it should abort the installation.
uninstall ( JInstallerAdapterComponent $parent ) Runs on uninstallation

보호된 메소드들

메소드 설명
_applyPostInstallationMessages ( ) : void Applies the post-installation messages for Joomla! 3.2 or later
addDependency ( string $package, string $dependency ) Adds a package dependency to #__akeeba_common
addPostInstallationMessage ( array $options ) : void Adds or updates a post-installation message (PIM) definition for Joomla! 3.2 or later. You can use this in your post-installation script using this code:
bugfixCantBuildAdminMenus ( ) Joomla! 1.6+ bugfix for "Can not build admin menus"
bugfixDBFunctionReturnedNoError ( ) Bugfix for "DB function returned no error"
copyCliFiles ( JInstallerAdapterComponent $parent ) Copies the CLI scripts into Joomla!'s cli directory
getDependencies ( string $package ) : array Get the dependencies for a package from the #__akeeba_common table
hasDependency ( string $package, string $dependency ) : boolean Do I have a dependency for a package in #__akeeba_common
removeDependency ( string $package, string $dependency ) Removes a package dependency from #__akeeba_common
removeFilesAndFolders ( array $removeList ) Removes obsolete files and folders
renderPostInstallation ( JInstallerAdapterComponent $parent ) Override this method to display a custom component installation message if you so wish
renderPostUninstallation ( JInstallerAdapterComponent $parent ) Override this method to display a custom component uninstallation message if you so wish
setDependencies ( string $package, array $dependencies ) Sets the dependencies for a package into the #__akeeba_common table
uninstallObsoleteSubextensions ( JInstallerAdapterComponent $parent ) : stdClass Uninstalls obsolete subextensions (modules, plugins) bundled with the main extension
uninstallPostInstallationMessages ( )

비공개 메소드들

메소드 설명
_createAdminMenus ( JInstallerAdapterComponent $parent ) : boolean
_reallyPublishAdminMenuItems ( JInstallerAdapterComponent $parent ) : boolean Make sure the Component menu items are really published!
_rebuildMenu ( ) Tells Joomla! to rebuild its menu structure to make triple-sure that the Components menu items really do exist in the correct place and can really be rendered.

메소드 상세

_applyPostInstallationMessages() 보호된 메소드

Applies the post-installation messages for Joomla! 3.2 or later
protected _applyPostInstallationMessages ( ) : void
리턴 void

addDependency() 보호된 메소드

Adds a package dependency to #__akeeba_common
protected addDependency ( string $package, string $dependency )
$package string The package
$dependency string The dependency to add

addPostInstallationMessage() 보호된 메소드

The $options array contains the following mandatory keys: extension_id The numeric ID of the extension this message is for (see the #__extensions table) type One of message, link or action. Their meaning is: message Informative message. The user can dismiss it. link The action button links to a URL. The URL is defined in the action parameter. action A PHP action takes place when the action button is clicked. You need to specify the action_file (RAD path to the PHP file) and action (PHP function name) keys. See below for more information. title_key The JText language key for the title of this PIM Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_TITLE description_key The JText language key for the main body (description) of this PIM Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_DESCRIPTION action_key The JText language key for the action button. Ignored and not required when type=message Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_ACTION language_extension The extension name which holds the language keys used above. For example, com_foobar, mod_something, plg_system_whatever, tpl_mytemplate language_client_id Should we load the front-end (0) or back-end (1) language keys? version_introduced Which was the version of your extension where this message appeared for the first time? Example: 3.2.1 enabled Must be 1 for this message to be enabled. If you omit it, it defaults to 1. condition_file The RAD path to a PHP file containing a PHP function which determines whether this message should be shown to the user. @see Template::parsePath() for RAD path format. Joomla! will include this file before calling the condition_method. Example: admin://components/com_foobar/helpers/postinstall.php condition_method The name of a PHP function which will be used to determine whether to show this message to the user. This must be a simple PHP user function (not a class method, static method etc) which returns true to show the message and false to hide it. This function is defined in the condition_file. Example: com_foobar_postinstall_messageone_condition When type=message no additional keys are required. When type=link the following additional keys are required: action The URL which will open when the user clicks on the PIM's action button Example: index.php?option=com_foobar&view=tools&task=installSampleData Then type=action the following additional keys are required: action_file The RAD path to a PHP file containing a PHP function which performs the action of this PIM.
또한 보기: Template::parsePath() for RAD path format. Joomla! will include this file before calling the function defined in the action key below. Example: admin://components/com_foobar/helpers/postinstall.php action The name of a PHP function which will be used to run the action of this PIM. This must be a simple PHP user function (not a class method, static method etc) which returns no result. Example: com_foobar_postinstall_messageone_action
protected addPostInstallationMessage ( array $options ) : void
$options array See description
리턴 void

bugfixCantBuildAdminMenus() 보호된 메소드

Joomla! 1.6+ bugfix for "Can not build admin menus"

bugfixDBFunctionReturnedNoError() 보호된 메소드

Bugfix for "DB function returned no error"

copyCliFiles() 보호된 메소드

Copies the CLI scripts into Joomla!'s cli directory
protected copyCliFiles ( JInstallerAdapterComponent $parent )
$parent JInstallerAdapterComponent

getDependencies() 보호된 메소드

Get the dependencies for a package from the #__akeeba_common table
protected getDependencies ( string $package ) : array
$package string The package
리턴 array The dependencies

hasDependency() 보호된 메소드

Do I have a dependency for a package in #__akeeba_common
protected hasDependency ( string $package, string $dependency ) : boolean
$package string The package
$dependency string The dependency to check for
리턴 boolean

postflight() 공개 메소드

Runs after install, update or discover_update. In other words, it executes after Joomla! has finished installing or updating your component. This is the last chance you've got to perform any additional installations, clean-up, database updates and similar housekeeping functions.
public postflight ( string $type, JInstallerAdapterComponent $parent )
$type string install, update or discover_update
$parent JInstallerAdapterComponent Parent object

preflight() 공개 메소드

Joomla! pre-flight event. This runs before Joomla! installs or updates the component. This is our last chance to tell Joomla! if it should abort the installation.
public preflight ( string $type, JInstallerAdapterComponent $parent ) : boolean
$type string Installation type (install, update, discover_install)
$parent JInstallerAdapterComponent Parent object
리턴 boolean True to let the installation proceed, false to halt the installation

removeDependency() 보호된 메소드

Removes a package dependency from #__akeeba_common
protected removeDependency ( string $package, string $dependency )
$package string The package
$dependency string The dependency to remove

removeFilesAndFolders() 보호된 메소드

Removes obsolete files and folders
protected removeFilesAndFolders ( array $removeList )
$removeList array The files and directories to remove

renderPostInstallation() 보호된 메소드

Override this method to display a custom component installation message if you so wish
protected renderPostInstallation ( JInstallerAdapterComponent $parent )
$parent JInstallerAdapterComponent Parent class calling us

renderPostUninstallation() 보호된 메소드

Override this method to display a custom component uninstallation message if you so wish
protected renderPostUninstallation ( JInstallerAdapterComponent $parent )
$parent JInstallerAdapterComponent Parent class calling us

setDependencies() 보호된 메소드

Sets the dependencies for a package into the #__akeeba_common table
protected setDependencies ( string $package, array $dependencies )
$package string The package
$dependencies array The dependencies list

uninstall() 공개 메소드

Runs on uninstallation
public uninstall ( JInstallerAdapterComponent $parent )
$parent JInstallerAdapterComponent The parent object

uninstallObsoleteSubextensions() 보호된 메소드

Uninstalls obsolete subextensions (modules, plugins) bundled with the main extension
protected uninstallObsoleteSubextensions ( JInstallerAdapterComponent $parent ) : stdClass
$parent JInstallerAdapterComponent The parent object
리턴 stdClass The subextension uninstallation status

uninstallPostInstallationMessages() 보호된 메소드

프로퍼티 상세

$cliScriptFiles 보호되어 있는 프로퍼티

A list of scripts to be copied to the "cli" directory of the site
protected array $cliScriptFiles
리턴 array

$cliSourcePath 보호되어 있는 프로퍼티

The path inside your package where cli scripts are stored
protected string $cliSourcePath
리턴 string

$componentName 보호되어 있는 프로퍼티

The component's name
protected string $componentName
리턴 string

$componentTitle 보호되어 있는 프로퍼티

The title of the component (printed on installation and uninstallation messages)
protected string $componentTitle
리턴 string

$isPaid 보호되어 있는 프로퍼티

Is this the paid version of the extension? This only determines which files / extensions will be removed.
protected bool $isPaid
리턴 boolean

$maximumJoomlaVersion 보호되어 있는 프로퍼티

The maximum Joomla! version this extension can be installed on
protected string $maximumJoomlaVersion
리턴 string

$minimumJoomlaVersion 보호되어 있는 프로퍼티

The minimum Joomla! version required to install this extension
protected string $minimumJoomlaVersion
리턴 string

$minimumPHPVersion 보호되어 있는 프로퍼티

The minimum PHP version required to install this extension
protected string $minimumPHPVersion
리턴 string

$postInstallationMessages 보호되어 있는 프로퍼티

This array contains the message definitions for the Post-installation Messages component added in Joomla! 3.2 and later versions. Each element is also a hashed array. For the keys used in these message definitions please
또한 보기: InstallScript::addPostInstallationMessage
protected array $postInstallationMessages
리턴 array

$removeFilesAllVersions 보호되어 있는 프로퍼티

Obsolete files and folders to remove from both paid and free releases. This is used when you refactor code and some files inevitably become obsolete and need to be removed.
protected array $removeFilesAllVersions
리턴 array

$removeFilesFree 보호되어 있는 프로퍼티

Obsolete files and folders to remove from the free version only. This is used when you move a feature from the free version of your extension to its paid version. If you don't have such a distinction you can ignore this.
protected array $removeFilesFree
리턴 array

$schemaXmlPath 보호되어 있는 프로퍼티

The path where the schema XML files are stored. Its contents depend on the schemaXmlPathRelative variable above true => schemaXmlPath contains a path relative to the component's back-end directory false => schemaXmlPath contains an absolute filesystem path
protected string $schemaXmlPath
리턴 string

$schemaXmlPathRelative 보호되어 있는 프로퍼티

Is the schemaXmlPath class variable a relative path? If set to true the schemaXmlPath variable contains a path relative to the component's back-end directory. If set to false the schemaXmlPath variable contains an absolute filesystem path.
protected bool $schemaXmlPathRelative
리턴 boolean

$uninstallation_queue 보호되어 있는 프로퍼티

The list of obsolete extra modules and plugins to uninstall on component upgrade / installation.
protected array $uninstallation_queue
리턴 array