Package
abstract class Package implements LocalizablePackageInterface (View source)
Constants
E_PACKAGE_NOT_FOUND |
|
E_PACKAGE_INSTALLED |
|
E_PACKAGE_VERSION |
|
E_PACKAGE_DOWNLOAD |
|
E_PACKAGE_SAVE |
|
E_PACKAGE_UNZIP |
|
E_PACKAGE_INSTALL |
|
E_PACKAGE_MIGRATE_BACKUP |
|
E_PACKAGE_INVALID_APP_VERSION |
|
E_PACKAGE_THEME_ACTIVE |
|
Properties
protected | $DIR_PACKAGES_CORE | ||
protected | $DIR_PACKAGES | ||
protected | $REL_DIR_PACKAGES_CORE | ||
protected | $REL_DIR_PACKAGES | ||
protected Package | $entity | ||
protected Application | $app | ||
protected Liaison | $config | ||
protected Liaison | $fileConfig | ||
protected bool deprecated | $pkgEnableLegacyNamespace | ||
protected array | $pkgAutoloaderRegistries | Array of location -> namespace autoloader entries for the package. Will automatically be added to the class loader. (e.g. array('src/PortlandLabs' => \PortlandLabs')). |
|
protected | $appVersionRequired | ||
protected | $pkgAllowsFullContentSwap | ||
protected | $pkgContentProvidesFileThumbnails | ||
protected DatabaseStructureManager | $databaseStructureManager |
Methods
No description
No description
No description
No description
Should this pacakge enable legacy namespaces.
Get the standard database config liaison.
Get the standard filesystem config liaison.
Returns custom autoloader prefixes registered by the class loader.
No description
Returns the translated name of the package.
Returns the translated package description.
Returns the installed package version.
Returns the version of concrete5 required by the package.
Returns true if the package has an install options screen.
No description
No description
Returns true if the package has a post install screen.
No description
No description
Returns the path to the package's folder, relative to the install path.
Returns the path starting from c5 installation folder to the package folder.
No description
Returns a path to where the packages files are located.
Installs the package info row and installs the database. Packages installing additional content should override this method, call the parent method, and use the resulting package object for further installs.
No description
Gets the contents of the package's CHANGELOG file. If no changelog is available an empty string is returned.
This is the pre-test routine that packages run through before they are installed. Any errors that come here are to be returned in the form of an array so we can show the user. If it's all good we return true.
No description
No description
Moves the current package's directory to the trash directory renamed 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.
No description
Updates a package's name, description, version and ID using the current class properties.
Upgrades a package's database and refreshes all blocks.
Updates a package's database using entities and a db.xml.
Get the namespace of the package by the package handle.
Create a entity manager used for the package installation, update and unistall process.
Destroys all proxies related to a package.
Override this method in your package controller to add strings to the translator, so that you can translate dynamically generated strings.
Details
Package
getPackageEntity()
No description
setPackageEntity(Package $entity)
No description
getApplication()
No description
__construct(Application $app)
No description
getContentSwapper()
No description
installContentFile($file)
No description
bool
shouldEnableLegacyNamespace()
Should this pacakge 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 standard database config liaison.
Liaison
getDatabaseConfig()
Get the standard database config liaison.
Liaison
getFileConfig()
Get the standard filesystem config liaison.
array
getPackageAutoloaderRegistries()
Returns custom autoloader prefixes registered by the class loader.
getPackageHandle()
No description
string
getPackageName()
Returns the translated name of the package.
string
getPackageDescription()
Returns the translated package description.
string
getPackageVersion()
Returns the installed package version.
string
getApplicationVersionRequired()
Returns the version of concrete5 required by the package.
bool
showInstallOptionsScreen()
Returns true if the package has an install options screen.
hasInstallNotes()
No description
hasUninstallNotes()
No description
bool
hasInstallPostScreen()
Returns true if the package has a post install screen.
allowsFullContentSwap()
No description
getPackagePath()
No description
string
getRelativePath()
Returns the path to the package's folder, relative to the install path.
string
getRelativePathFromInstallFolder()
Returns the path starting from c5 installation folder to the package folder.
getTranslationFile($locale)
No description
string
contentProvidesFileThumbnails()
Returns a path to where the packages files are located.
Package
install()
Installs the package info row and installs the database. Packages installing additional content should override this method, call the parent method, and use the resulting package object for further installs.
uninstall()
No description
string
getChangelogContents()
Gets the contents of the package's CHANGELOG file. If no changelog is available an empty string is returned.
static
getInstalledList()
deprecated
deprecated
No description
static
getInstalledHandles()
deprecated
deprecated
No description
static
getByHandle($pkgHandle)
deprecated
deprecated
No description
static
getLocalUpgradeablePackages()
deprecated
deprecated
No description
static
getRemotelyUpgradeablePackages()
deprecated
deprecated
No description
static
getAvailablePackages($filterInstalled = true)
deprecated
deprecated
No description
static
getByID($pkgID)
deprecated
deprecated
No description
static
getClass($pkgHandle)
deprecated
deprecated
No description
array|bool
testForInstall(bool $testForAlreadyInstalled = true)
This is the pre-test routine that packages run through before they are installed. Any errors that come here are to be returned in the form of an array so we can show the user. If it's all good we return true.
protected
getErrorText($result)
No description
bool|int[]
testForUninstall()
No description
backup()
Moves the current package's directory to the trash directory renamed with the package handle and a date code.
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's database from an XML file.
upgradeCoreData()
Updates a package's name, description, version and ID 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 $withLeadingBacksalsh = false)
Get the namespace of the package by the package handle.
EntityManager
getPackageEntityManager()
Create a entity manager used for the package installation, update and unistall process.
protected
destroyProxyClasses(EntityManagerInterface $em)
Destroys all proxies related to a package.
getEntityManager()
deprecated
deprecated
No description
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.