Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • AutomaticTranslationCommand
  • ConsoleFormatterUtil
  • CronCommand
  • CryptSetupCommand
  • DummyCommand
  • ExportFixtureCommand
  • MigrateCustomCommand
  • SampleDataCommand
  • UpdateCommand
  • UpdaterPackageCommand
  • Overview
  • Package
  • Class
  • Tree

Class SampleDataCommand

Sample/dummy data exporter.

A command for exporting non-application (human-entered) data into an SQL script for use as sample data. Requires the "mysqldump" utility to be installed on the system.

The SQL generated by this script can be used as an alternate method for exporting data, reinstalling and importing data into the fresh installation. Note, however that it does not save custom modules or any of the tables listed in $tblsExclude for these reasons:

  • x2_auth tables: there is no easy, reliable way of distinguishing user-entered data in this table from default application data.
  • x2_sessions/x2_temp_files: This data is entirely ephemeral
  • x2_timezones/x2_timezone_points: This is static data inserted during installation and doesn't need to be exported.

Note also that any files in the uploads folder will also need to be backed up, if the data is to be re-used elsewhere; references to files on the server will otherwise point to nonexistent files.

CComponent
Extended by CConsoleCommand
Extended by SampleDataCommand
Package: application\commands
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/commands/SampleDataCommand.php
Methods summary
public str
# sqlValue( type $val )

Format a string with a value such that it can be used in an SQL statement

Format a string with a value such that it can be used in an SQL statement

Parameters

$val
type
$x

Returns

str
public type
# actionExport( array $args )

Exports the database content into dummy data files

Exports the database content into dummy data files

Parameters

$args
array
$args

Returns

type
public
# actionFutureTimes( type $args )

Hunts through the database for in-the-future timestamps and reports them

Hunts through the database for in-the-future timestamps and reports them

Parameters

$args
type
$args
public
# actionSquashtime( array $dtnew )

"Compress" all sample data timestamps

"Compress" all sample data timestamps

Brings all timestamps closer to "now" using a logarithmic scale. This is to bring really far-apart events closer together while avoiding too much "clumping" of events around the installation timestamp.

Parameters

$dtnew
array
$newDisp The new furthest time into the past that any event is allowed to go.
public type
# timeCompressSql( string $column, type $ti, type $dtMax, type $dtMaxNew )

Generates update SQL for a timestamp column to "compress" times

Generates update SQL for a timestamp column to "compress" times

Parameters

$column
string
$column Attribute/column name to be changed
$ti
type
$ti Timestamp of installation ("now")
$dtMax
type
$dtMax Furthest time into the past that events go
$dtMaxNew
type
$dtMaxNew New furthest time into the past that events can go

Returns

type
Methods inherited from CConsoleCommand
__construct(), afterAction(), beforeAction(), behaviors(), buildFileList(), confirm(), copyFiles(), ensureDirectory(), getCommandRunner(), getHelp(), getName(), getOptionHelp(), init(), onAfterAction(), onBeforeAction(), pluralize(), prompt(), renderFile(), resolveRequest(), run(), usageError()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public mixed $pdo
#
Properties inherited from CConsoleCommand
$defaultAction
Magic properties inherited from CConsoleCommand
$commandRunner, $help, $name, $optionHelp
X2CRM Documentation API documentation generated by ApiGen 2.8.0