Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Upgrades
  • UpgradeUtil
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Upgrades

Handles the upgrade process to bring the current database up to the requirements of the installed files.

Model
Extended by Upgrades
Package: blesta\components\upgrades
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/upgrades/upgrades.php
Methods summary
public
# __construct( array $db_info = null )

Setup

Setup

Parameters

$db_info
The database connection information (optional)
public array
# getMappings( )

Returns all upgrade mappings

Returns all upgrade mappings

Returns

array
An array in key/value pairs where each key is the version from and each value is the version to
public
# start( string $from, string $to, callable $callback = null )

Starts the upgrade process

Starts the upgrade process

Parameters

$from
The version to start the upgrade from
$to
The version to upgrade to, null to upgrade to latest version
$callback
The callback to execute after each task in the upgrade process (for each version)
public array
# compareVersions( string $a, string $b )

Compares to semantic version numbers and returns the result

Compares to semantic version numbers and returns the result

Parameters

$a
A semantic version number
$b
A semantic version number

Returns

array

An array containing the comparison of the two versions, including: - major How major $a compares to $b (>, <, =) - minor How minor $a compares to $b (>, <, =) - patch How patch $a compares to $b (>, <, =) - pre How pre release $a compares to $b (>, <, =) - build How build meta data $a compare to $b (>, <, =) - diff How $a and $b differ (major, minor, patch, pre, build, null if versions are identical) - latest Either $a or $b, whichever is newer

public array
# parseVersion( string $v )

Parse the given semantic version number

Parse the given semantic version number

Parameters

$v
The version to parse

Returns

array

An array containing version info: - major - minor - patch - pre - build

public
# getUpgrades( string $from, string $to )

Generates a mapping of all files

Generates a mapping of all files

Parameters

$from
The version to start the upgrade from
$to
The version to upgrade to, null to upgrade to latest version

Throws

Exception
Thrown if the required upgrade files are not present
public
# processObject( string $obj, callable $callback = null )

Processes the given object, passes the callback to the object by passing the current task count being executed and the total number of tasks to be executed for that object.

Processes the given object, passes the callback to the object by passing the current task count being executed and the total number of tasks to be executed for that object.

Parameters

$obj
The full path to the SQL file to execute
$callback
The callback to execute after each task in the upgrade process
public
# processSql( string $file, callable $callback = null )

Processes the given SQL file, executes the given callback after each query by passing the current query number being executed and the total number of queries to be executed for that file.

Processes the given SQL file, executes the given callback after each query by passing the current query number being executed and the total number of queries to be executed for that file.

Parameters

$file
The full path to the SQL file to execute
$callback
The callback to execute after each query

Throws

PDOExcetion
if any query fails
public array
# errors( )

Return all errors

Return all errors

Returns

array
An array of errors
Blesta API documentation generated by ApiGen