class BrokenPackage extends Package (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 from  Package
protected $DIR_PACKAGES from  Package
protected $REL_DIR_PACKAGES_CORE from  Package
protected $REL_DIR_PACKAGES from  Package
protected Package $entity from  Package
protected Application $app from  Package
protected Liaison $config from  Package
protected Liaison $fileConfig from  Package
protected bool deprecated $pkgEnableLegacyNamespace from  Package
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')).

from  Package
protected $appVersionRequired from  Package
protected $pkgAllowsFullContentSwap from  Package
protected $pkgContentProvidesFileThumbnails from  Package
protected DatabaseStructureManager $databaseStructureManager from  Package

Methods

getPackageEntity()

No description

from  Package
setPackageEntity(Package $entity)

No description

from  Package
getApplication()

No description

from  Package
__construct($pkgHandle, Application $application)

No description

getContentSwapper()

No description

from  Package
installContentFile($file)

No description

from  Package
bool
shouldEnableLegacyNamespace()

Should this pacakge enable legacy namespaces.

from  Package
getConfig()

Get the standard database config liaison.

from  Package
getDatabaseConfig()

Get the standard database config liaison.

from  Package
getFileConfig()

Get the standard filesystem config liaison.

from  Package
array
getPackageAutoloaderRegistries()

Returns custom autoloader prefixes registered by the class loader.

from  Package
getPackageHandle()

No description

from  Package
string
getPackageName()

Returns the translated name of the package.

from  Package
string
getPackageDescription()

Returns the translated package description.

from  Package
string
getPackageVersion()

Returns the installed package version.

from  Package
string
getApplicationVersionRequired()

Returns the version of concrete5 required by the package.

from  Package
bool
showInstallOptionsScreen()

Returns true if the package has an install options screen.

from  Package
hasInstallNotes()

No description

from  Package
hasUninstallNotes()

No description

from  Package
bool
hasInstallPostScreen()

Returns true if the package has a post install screen.

from  Package
allowsFullContentSwap()

No description

from  Package
getPackagePath()

No description

from  Package
string
getRelativePath()

Returns the path to the package's folder, relative to the install path.

from  Package
string
getRelativePathFromInstallFolder()

Returns the path starting from c5 installation folder to the package folder.

from  Package
getTranslationFile($locale)

No description

from  Package
string
contentProvidesFileThumbnails()

Returns a path to where the packages files are located.

from  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

from  Package
string
getChangelogContents()

Gets the contents of the package's CHANGELOG file. If no changelog is available an empty string is returned.

from  Package
static 
getInstalledList() deprecated

No description

from  Package
static 
getInstalledHandles() deprecated

No description

from  Package
static 
getByHandle($pkgHandle) deprecated

No description

from  Package
static 
getLocalUpgradeablePackages() deprecated

No description

from  Package
static 
getRemotelyUpgradeablePackages() deprecated

No description

from  Package
static 
getAvailablePackages($filterInstalled = true) deprecated

No description

from  Package
static 
getByID($pkgID) deprecated

No description

from  Package
static 
getClass($pkgHandle) deprecated

No description

from  Package
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.

from  Package
getErrorText($result)

No description

from  Package
bool|int[]
testForUninstall()

No description

from  Package
backup()

Moves the current package's directory to the trash directory renamed with the package handle and a date code.

from  Package
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.

from  Package
getPackageEntityPaths() deprecated

No description

from  Package
installDatabase()

Installs the packages database through doctrine entities and db.xml database definitions.

from  Package
installEntitiesDatabase()

No description

from  Package
static bool|stdClass
installDB(string $xmlFile)

Installs a package's database from an XML file.

from  Package
upgradeCoreData()

Updates a package's name, description, version and ID using the current class properties.

from  Package
upgrade()

Upgrades a package's database and refreshes all blocks.

from  Package
upgradeDatabase()

Updates a package's database using entities and a db.xml.

from  Package
string
getNamespace(bool $withLeadingBacksalsh = false)

Get the namespace of the package by the package handle.

from  Package
EntityManager
getPackageEntityManager()

Create a entity manager used for the package installation, update and unistall process.

from  Package
destroyProxyClasses(EntityManagerInterface $em)

Destroys all proxies related to a package.

from  Package
getEntityManager() deprecated

No description

from  Package
getPackageID() deprecated

No description

from  Package
getTranslatableStrings(Translations $translations)

Override this method in your package controller to add strings to the translator, so that you can translate dynamically generated strings.

from  Package
getInstallErrorMessage()

No description

Details

Package getPackageEntity()

No description

Return Value

Package

setPackageEntity(Package $entity)

No description

Parameters

Package $entity

getApplication()

No description

__construct($pkgHandle, Application $application)

No description

Parameters

$pkgHandle
Application $application

getContentSwapper()

No description

installContentFile($file)

No description

Parameters

$file

bool shouldEnableLegacyNamespace()

Should this pacakge enable legacy namespaces.

This returns true IF:

  1. $this->pkgAutoloaderMapCoreExtensions is false or unset
  2. The required package version > 7.9.9 meaning version 8 or newer
  3. $this->pkgEnableLegacyNamespace is true

Return Value

bool

Liaison getConfig()

Get the standard database config liaison.

Return Value

Liaison

Liaison getDatabaseConfig()

Get the standard database config liaison.

Return Value

Liaison

Liaison getFileConfig()

Get the standard filesystem config liaison.

Return Value

Liaison

array getPackageAutoloaderRegistries()

Returns custom autoloader prefixes registered by the class loader.

Return Value

array

Keys represent the namespace, not relative to the package's namespace. Values are the path, and are relative to the package directory

getPackageHandle()

No description

string getPackageName()

Returns the translated name of the package.

Return Value

string

string getPackageDescription()

Returns the translated package description.

Return Value

string

string getPackageVersion()

Returns the installed package version.

Return Value

string

string getApplicationVersionRequired()

Returns the version of concrete5 required by the package.

Return Value

string

bool showInstallOptionsScreen()

Returns true if the package has an install options screen.

Return Value

bool

hasInstallNotes()

No description

hasUninstallNotes()

No description

bool hasInstallPostScreen()

Returns true if the package has a post install screen.

Return Value

bool

allowsFullContentSwap()

No description

getPackagePath()

No description

string getRelativePath()

Returns the path to the package's folder, relative to the install path.

Return Value

string

string getRelativePathFromInstallFolder()

Returns the path starting from c5 installation folder to the package folder.

Return Value

string

getTranslationFile($locale)

No description

Parameters

$locale

string contentProvidesFileThumbnails()

Returns a path to where the packages files are located.

Return Value

string

$path

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.

Return Value

Package

uninstall()

No description

string getChangelogContents()

Gets the contents of the package's CHANGELOG file. If no changelog is available an empty string is returned.

Return Value

string

static getInstalledList() deprecated

deprecated

No description

static getInstalledHandles() deprecated

deprecated

No description

static getByHandle($pkgHandle) deprecated

deprecated

No description

Parameters

$pkgHandle

static getLocalUpgradeablePackages() deprecated

deprecated

No description

static getRemotelyUpgradeablePackages() deprecated

deprecated

No description

static getAvailablePackages($filterInstalled = true) deprecated

deprecated

No description

Parameters

$filterInstalled

static getByID($pkgID) deprecated

deprecated

No description

Parameters

$pkgID

static getClass($pkgHandle) deprecated

deprecated

No description

Parameters

$pkgHandle

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.

Parameters

bool $testForAlreadyInstalled

Return Value

array|bool

Returns an array of errors or true if the package can be installed

protected getErrorText($result)

No description

Parameters

$result

bool|int[] testForUninstall()

No description

Return Value

bool|int[]

true on success, array of error codes on failure

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 This method was limited. It let you specify a location but in V8 with the Doctrine Entity Manager driver chain we also need to specify namespaces. Instead of specifying entity paths this way, update your package controller to implement the Concrete\Core\Database\EntityManager\Provider\ProviderAggregateInterface, and create a method named getEntityManagerProvider that returns an instance of the Concrete\Core\Database\EntityManager\Provider\ProviderInterface. For example, if I want to specify that my package has entities found at src/PortlandLabs\FooBar\Entity, with the namespace PortlandLabs\FooBar\Entity, my method is simply public function getEntityManagerProvider() { return new StandardPackageProvider($this->app, $this, ['src/MSM/Entity' => 'PortlandLabs\MSM\Entity']); }

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.

Parameters

string $xmlFile

Path to the database XML file

Return Value

bool|stdClass

Returns false if the XML file could not be found

Exceptions

ConnectionException

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.

Exceptions

ConnectionException
Exception

string getNamespace(bool $withLeadingBacksalsh = false)

Get the namespace of the package by the package handle.

Parameters

bool $withLeadingBacksalsh

Return Value

string

EntityManager getPackageEntityManager()

Create a entity manager used for the package installation, update and unistall process.

Return Value

EntityManager

protected destroyProxyClasses(EntityManagerInterface $em)

Destroys all proxies related to a package.

Parameters

EntityManagerInterface $em

getEntityManager() deprecated

deprecated

No description

getPackageID() deprecated

deprecated This should be handled by the Concrete\Core\Entity\Package object, not by this object

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.

Parameters

Translations $translations

Examples

If you add to this method these two strings:

<code>
$translations->insert('', 'String without context');
$translations->insert('MyContext', 'String with context');
</code>

Then you'll be able to translate these two strings in the Translator and write translated strings with:

<code>
echo t('String without context');
echo tc('MyContext', 'String with context');
</code>

getInstallErrorMessage()

No description