Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_Package_Exception class

Exception
   |
   --AMI_Exception
      |
      --AMI_Package_Exception

• Introduction

Transaction CMS module manipulating command exception.

• Class synopsis

AMI_Package_Exception extends AMI_Exception {
/* Constants */
// Throws if passed already installed module Id for installation.
const AMI_Package_Exception::ALREADY_INSTALLED =  10020;
// Throws if captions file has current module opening/closing markers without its pairs during installation.
const AMI_Package_Exception::BROKEN_CAPTIONS_FILE =  10080;
// Throws installing/uninstalling custom script detect a problem.
const AMI_Package_Exception::CUSTOM_ERROR =  20000;
// Throws if module was already installed/uninstalled during script execution (old core limitation).
const AMI_Package_Exception::ENTITY_PROCESSED =  10160;
// Throws if installation is not in overwrite mode and some module captions are already existing during installation.
const AMI_Package_Exception::EXISTING_CAPTIONS =  10070;
// Throws if installation is not in overwrite mode module declaration is already existing in local declaration file during installation.
const AMI_Package_Exception::EXISTING_DECLARATION =  10130;
// Throws if try to uninstall base instance module.
const AMI_Package_Exception::HAS_DEPENDENCIES =  10220;
// Throws if import called on module with configuration that doesn't support import.
const AMI_Package_Exception::IMPORT_FORBIDDEN =  10200;
// Throws if configuration has 1 instance limit during installation.
const AMI_Package_Exception::INSTANCE_LIMIT =  10150;
// Throws if passed not all obligatory captions data for installation.
const AMI_Package_Exception::INVALID_CAPTIONS_DATA =  10050;
// Throws if passed invalid hypermodule or configuration for installation.
const AMI_Package_Exception::INVALID_HYPER_MOD_CONFIG =  10040;
// Throws if invalid module Id passed.
const AMI_Package_Exception::INVALID_MOD_ID =  10010;
// Throws if passed invalid package Id for installation.
const AMI_Package_Exception::INVALID_PKG_ID =  10170;
// Throws if template mode is set to read templates from disk.
const AMI_Package_Exception::INVALID_TEMPLATE_MODE =  10000;
// Throws if try to uninstall permanent module.
const AMI_Package_Exception::IS_PERMANENT =  10190;
// Throws if configuration resource not found during installation.
const AMI_Package_Exception::MISSING_CONFIG_RESOURCE =  10060;
// Throws if unable to find declaration template i. e.
const AMI_Package_Exception::MISSING_DECLARATION_TPL =  10100;
// Throws if try to uninstall not installed module.
const AMI_Package_Exception::NOT_INSTALLED =  10180;
// Throws if unable to save patched captions file during installation.
const AMI_Package_Exception::ON_CREATE_CAPTIONS =  10090;
// Throws if unable to save patched local declaration file during installation.
const AMI_Package_Exception::ON_CREATE_DECLARATION =  10140;
// Throws if unable to open local declaration file "_local/modules/declaration/declares.php" during installation.
const AMI_Package_Exception::OPEN_DECLARATION =  10110;
// Throws if local declaration file has current module opening/closing markers without its pairs during installation.
const AMI_Package_Exception::PARSE_DECLARATION =  10120;
// Throws if passed reserved module Id (some configurations has same).
const AMI_Package_Exception::RESERVED_MOD_ID =  10030;
// Throws if try to uninstall base instance module.
const AMI_Package_Exception::UNINSTALL_FORBIDDEN =  10210;
/* Inherited Properties */
// Data
/* Inherited Methods */
// Construct the exception.
public AMI_Exception::__construct ( [ string $message = '' ], [ int $code = 0 ], [ $oPrevious = NULL ], [ mixed $data = NULL ] ) returns AMI_Exception;
// Returns exception data.
public AMI_Exception::getData ( ) returns mixed;
}
Tags:
since 6.0.2

• Class Constants

ALREADY_INSTALLED

Throws if passed already installed module Id for installation.

Manipulating CMS module transaction command code

BROKEN_CAPTIONS_FILE

Throws if captions file has current module opening/closing markers without its pairs during installation.

Manipulating CMS module transaction command code

CUSTOM_ERROR

Throws installing/uninstalling custom script detect a problem.

Manipulating CMS module transaction command code

Example:

  •  // "install_after.php" / "install.php" /
  •  // "uninstall_before.php" / "uninstall_after.php" / "uninstall.php" / "uninstall_all.php" context
  •  
  •  // 'key_from_error_message_locale_file' will be read from "errors.lng"
  •  // located at configuration and same folder as this script.
  •  
  •  if(...){
  •      throw new AMI_Package_Exception(
  •          'key_from_error_message_locale_file',
  •          AMI_Package_Exception::CUSTOM_ERROR,
  •          null,
  •          // possible locale message aruments
  •          array('var1' => 'val1'...)
  •      );
  •  }

ENTITY_PROCESSED

Throws if module was already installed/uninstalled during script execution (old core limitation).

Manipulating CMS module transaction command code

EXISTING_CAPTIONS

Throws if installation is not in overwrite mode and some module captions are already existing during installation.

Manipulating CMS module transaction command code

EXISTING_DECLARATION

Throws if installation is not in overwrite mode module declaration is already existing in local declaration file during installation.

Manipulating CMS module transaction command code

HAS_DEPENDENCIES

Throws if try to uninstall base instance module.

Manipulating CMS module transaction command code

IMPORT_FORBIDDEN

Throws if import called on module with configuration that doesn't support import.

Manipulating CMS module transaction command code

INSTANCE_LIMIT

Throws if configuration has 1 instance limit during installation.

Manipulating CMS module transaction command code

INVALID_CAPTIONS_DATA

Throws if passed not all obligatory captions data for installation.

Manipulating CMS module transaction command code

INVALID_HYPER_MOD_CONFIG

Throws if passed invalid hypermodule or configuration for installation.

Manipulating CMS module transaction command code

INVALID_MOD_ID

Throws if invalid module Id passed.

Manipulating CMS module transaction command code

INVALID_PKG_ID

Throws if passed invalid package Id for installation.

Manipulating CMS module transaction command code

INVALID_TEMPLATE_MODE

Throws if template mode is set to read templates from disk.

Manipulating CMS module transaction command code

IS_PERMANENT

Throws if try to uninstall permanent module.

Manipulating CMS module transaction command code

MISSING_CONFIG_RESOURCE

Throws if configuration resource not found during installation.

Manipulating CMS module transaction command code

MISSING_DECLARATION_TPL

Throws if unable to find declaration template i. e.

Manipulating CMS module transaction command code "_local/modules/distrib/configs/ami_clean/ami_sample/declaration/declaration.php" during installation.

NOT_INSTALLED

Throws if try to uninstall not installed module.

Manipulating CMS module transaction command code

ON_CREATE_CAPTIONS

Throws if unable to save patched captions file during installation.

Manipulating CMS module transaction command code

ON_CREATE_DECLARATION

Throws if unable to save patched local declaration file during installation.

Manipulating CMS module transaction command code

OPEN_DECLARATION

Throws if unable to open local declaration file "_local/modules/declaration/declares.php" during installation.

Manipulating CMS module transaction command code

PARSE_DECLARATION

Throws if local declaration file has current module opening/closing markers without its pairs during installation.

Manipulating CMS module transaction command code

RESERVED_MOD_ID

Throws if passed reserved module Id (some configurations has same).

Manipulating CMS module transaction command code

UNINSTALL_FORBIDDEN

Throws if try to uninstall base instance module.

Manipulating CMS module transaction command code