BrokenPackage
class BrokenPackage extends Package (View source)
Constants
E_PACKAGE_NOT_FOUND |
Error code: Invalid Package. |
E_PACKAGE_INSTALLED |
Error code: You've already installed that package. |
E_PACKAGE_VERSION |
Error code: This package requires Concrete version %s or greater. |
E_PACKAGE_DOWNLOAD |
Error code: An error occurred while downloading the package. |
E_PACKAGE_SAVE |
Error code: Concrete was not able to save the package after download. |
E_PACKAGE_UNZIP |
Error code: An error occurred while trying to unzip the package. |
E_PACKAGE_INSTALL |
Error code: An error occurred while trying to install the package. |
E_PACKAGE_MIGRATE_BACKUP |
Error code: Unable to backup old package directory to %s. |
E_PACKAGE_INVALID_APP_VERSION |
Error code: This package isn't currently available for this version of Concrete. |
E_PACKAGE_THEME_ACTIVE |
Error code: This package contains the active site theme, please change the theme before uninstalling. |
E_PACKAGE_PHP_VERSION |
Error code: This package requires PHP version %1$s or greater (the current PHP version is %2$s). |
Properties
protected string | $DIR_PACKAGES_CORE | Absolute path to the /concrete/packages directory. |
from Package |
protected string | $DIR_PACKAGES | Absolute path to the /packages directory. |
from Package |
protected string | $REL_DIR_PACKAGES_CORE | Path to the /concrete/packages directory relative to the web root. |
from Package |
protected string | $REL_DIR_PACKAGES | Path to the /concrete/packages directory relative to the web root. |
from Package |
protected Package|null | $entity | Associated package entity. |
from Package |
protected Application | $app | The Application instance. |
from Package |
protected Liaison|null | $config | The database configuration liaison. |
from Package |
protected Liaison|null | $fileConfig | The file configuration liaison. |
from Package |
protected bool deprecated | $pkgEnableLegacyNamespace | from Package | |
protected array | $pkgAutoloaderRegistries | The custom autoloader prefixes to be automatically added to the class loader. |
from Package |
protected string | $appVersionRequired | The minimum Concrete version compatible with the package. |
from Package |
protected string | $phpVersionRequired | The minimum PHP version compatible with the package. |
from Package |
protected bool | $pkgAllowsFullContentSwap | Override this value and set it to true if your package clears all existing website content when it's being installed. |
from Package |
protected array | $pkgContentSwapFiles | Override this value to add additional content swap templates. |
from Package |
protected bool | $pkgContentProvidesFileThumbnails | Override this value and set it to true if your package provides the file thumbnails. |
from Package |
protected string|null | $backedUpFname | The full path of the package directory moved to the trash folder. |
from Package |
protected array | $packageDependencies | An array describing the package dependencies. |
from Package |
private string | $errorDetails |
Methods
Initialize the instance.
Get the custom autoloader prefixes to be automatically added to the class loader.
Get the translated name of the package.
Get the translated package description.
Get the minimum Concrete version compatible with the package.
Get the minimum PHP version compatible with the package.
Should the install options page be shown? The install options page may be for install notes and/or full contents swap confirmation.
Does this package clear all existing website content when it's being installed?
Get the path to the package relative to the Concrete installation folder.
Does this package provide the file thumbnails? If false, the file thumbnails are generated during the install process.
Uninstall the package:
- delete the installed items associated to the package
- destroy the package proxy classes of entities
- remove the package info row.
Perform tests before this package is installed.
Move the current package directory to the trash directory, and rename it with the package handle and a date code.
If a package was just backed up by this instance of the package object and the packages/package handle directory doesn't exist, this will restore the package from the trash.
Installs the packages database through doctrine entities and db.xml database definitions.
Installs a package database from an XML file.
Updates the package entity name, description and version using the current class properties.
Get the namespace of the package by the package handle.
Create an entity manager used for the package install, upgrade and unistall process.
Override this method in your package controller to add strings to the translator, so that you can translate dynamically generated strings.
Get the error text corresponsing to an error code.
Destroys all proxies related to a package.
Get the minimum PHP version compatible with the package.
No description
Details
__construct($pkgHandle, Application $application, string $errorDetails = '')
Initialize the instance.
Package|null
getPackageEntity()
Get the associated package entity (if available).
setPackageEntity(Package $entity)
Set the associated package entity.
array
getContentSwapFiles()
No description
Package
setContentSwapFiles(array $pkgContentSwapFiles)
No description
Application
getApplication()
Get the Application instance.
ContentSwapperInterface
getContentSwapper()
Get the content swapper.
installContentFile(string $file)
Import a concrete5-cif XML file.
bool
shouldEnableLegacyNamespace()
Should this package enable legacy namespaces?
This returns true IF:
- $this->pkgAutoloaderMapCoreExtensions is false or unset
- The required package version > 7.9.9 meaning version 8 or newer
- $this->pkgEnableLegacyNamespace is true
Liaison
getConfig()
Get the default configuration liaison.
Liaison
getDatabaseConfig()
Get the database configuration liaison.
Liaison
getFileConfig()
Get the filesystem configuration liaison.
array
getPackageAutoloaderRegistries()
Get the custom autoloader prefixes to be automatically added to the class loader.
Array keys are the locations (relative to the package directory). Array values are the paths (not relative to the package namespace).
string
getPackageHandle()
Get the package handle.
string
getPackageName()
Get the translated name of the package.
string
getPackageDescription()
Get the translated package description.
string
getPackageVersion()
Get the installed package version.
string
getApplicationVersionRequired()
Get the minimum Concrete version compatible with the package.
string
getPHPVersionRequired()
Get the minimum PHP version compatible with the package.
bool
showInstallOptionsScreen()
Should the install options page be shown? The install options page may be for install notes and/or full contents swap confirmation.
bool
hasInstallNotes()
Does this package have install notes?
bool
hasUninstallNotes()
Does this package have uninstall notes?
bool
hasInstallPostScreen()
Does this package have a post-install page?
bool
allowsFullContentSwap()
Does this package clear all existing website content when it's being installed?
string
getPackagePath()
Get the absolute path to the package.
string
getRelativePath()
Get the path to the package relative to the web root.
string
getRelativePathFromInstallFolder()
Get the path to the package relative to the Concrete installation folder.
getTranslationFile($locale)
No description
bool
contentProvidesFileThumbnails()
Does this package provide the file thumbnails? If false, the file thumbnails are generated during the install process.
Package
install()
Install the package info row and the database (doctrine entities and db.xml).
Packages installing additional content should override this method, call the parent method (parent::install()
).
uninstall()
Uninstall the package:
- delete the installed items associated to the package
- destroy the package proxy classes of entities
- remove the package info row.
string
getChangelogContents()
Get the contents of the package's CHANGELOG file.
static Package[]
getInstalledList()
deprecated
deprecated
No description
static string[]
getInstalledHandles()
deprecated
deprecated
No description
static Package|null
getByHandle(string $pkgHandle)
deprecated
deprecated
No description
static Package[]
getLocalUpgradeablePackages()
deprecated
deprecated
No description
static Package[]
getRemotelyUpgradeablePackages()
deprecated
deprecated
No description
static Package[]
getAvailablePackages(bool $filterInstalled = true)
deprecated
deprecated
No description
static Package|null
getByID(int $pkgID)
deprecated
deprecated
No description
static Package
getClass(string $pkgHandle)
deprecated
deprecated
No description
ErrorList|true
testForInstall(bool $testForAlreadyInstalled = true)
Perform tests before this package is installed.
ErrorList|true
testForUpgrade()
Perform tests before this package is upgraded.
ErrorList|true
testForUninstall()
Perform tests before this package is uninstalled.
ErrorList|Package
backup()
Move the current package directory to the trash directory, and rename it with the package handle and a date code.
bool
restore()
If a package was just backed up by this instance of the package object and the packages/package handle directory doesn't exist, this will restore the package from the trash.
getPackageEntityPaths()
deprecated
deprecated
No description
installDatabase()
Installs the packages database through doctrine entities and db.xml database definitions.
installEntitiesDatabase()
No description
static bool|stdClass
installDB(string $xmlFile)
Installs a package database from an XML file.
upgradeCoreData()
Updates the package entity name, description and version using the current class properties.
upgrade()
Upgrades a package's database and refreshes all blocks.
upgradeDatabase()
Updates a package's database using entities and a db.xml.
string
getNamespace(bool $withLeadingBackslash = false)
Get the namespace of the package by the package handle.
EntityManager|null
getPackageEntityManager()
Create an entity manager used for the package install, upgrade and unistall process.
EntityManagerInterface
getEntityManager()
deprecated
deprecated
No description
int|null
getPackageID()
deprecated
deprecated
No description
getTranslatableStrings(Translations $translations)
Override this method in your package controller to add strings to the translator, so that you can translate dynamically generated strings.
array
getPackageDependencies()
Return the package dependencies.
protected string
getErrorText(array|int $errorCode)
Get the error text corresponsing to an error code.
protected
destroyProxyClasses(EntityManagerInterface $em)
Destroys all proxies related to a package.
protected int|null
getPHPVersionIDRequired()
Get the minimum PHP version compatible with the package.
getInstallErrorMessage()
No description