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

  • ThemeBuildCommand
  • Overview
  • Package
  • Class
  • Tree

Class ThemeBuildCommand

CConsoleCommand represents an executable console command.

It works like CController by parsing command line options and dispatching the request to a specific action with appropriate option values.

Users call a console command via the following command format:

yiic CommandName ActionName --Option1=Value1 --Option2=Value2 ...

Child classes mainly needs to implement various action methods whose name must be prefixed with "action". The parameters to an action method are considered as options for that specific action. The action specified as CConsoleCommand::$defaultAction will be invoked when a user does not specify the action name in his command.

Options are bound to action parameters via parameter names. For example, the following action method will allow us to run a command with yiic sitemap --type=News:

class SitemapCommand extends CConsoleCommand {
    public function actionIndex($type) {
        ....
    }
}

Since version 1.1.11 the return value of action methods will be used as application exit code if it is an integer value.

CComponent
Extended by CConsoleCommand
Extended by ThemeBuildCommand
Package: system\console
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/commands/ThemeBuildCommand.php
Methods summary
public integer
# run( array $args )

Entry point

Entry point

Parameters

$args
array
$args command line parameters for this command.

Returns

integer
application exit code, which is returned by the invoked action. 0 if the action did not return anything. (return value is available since version 1.1.11)

Overrides

CConsoleCommand::run()
public
# writeFile( mixed $outputFile, mixed $output )
public array
# getCssFiles( mixed $root )

Gets a list of all css files in the directory, recusrively

Gets a list of all css files in the directory, recusrively

Parameters

$root
mixed
$root string Path of the root directoy

Returns

array
list of full paths
public Array
# scanCssFile( mixed $path )

Scans a css file and for theme tags and formats an array of rules

Scans a css file and for theme tags and formats an array of rules

Parameters

$path
mixed
$path string pathname of a file to scan

Returns

Array
of rules in the following format: '<Selector>' => // ex. div.icon 'comments' => '<comment1>', // ex. line 223 of css ... 0 => 'rule' => <rule> // ex. background 'value' => <value> // ex. darker_link ...
public array
# makeRule( mixed $file, mixed $lineNumber )

Parameters

$file
mixed
$file string pathname of a css file
$lineNumber
mixed
$lineNumber int lineNumber of the theme tag

Returns

array
of needed items to construct the array seen in ThemeBuildCommand::scanCssFile().
public
# formatRule( string $selector, string $rule, mixed $addNoThemeRule = false )

Formats a rule array into CSS

Formats a rule array into CSS

Parameters

$selector
string
$selector CSS selector to put the rules under
$rule
string
$rule array of comments and items to put into the CSS
$addNoThemeRule
public
# formatModuleOverridesRule( mixed $selector, mixed $rule )

Formats rules for module-specific theming. Detects module theme override rules and converts them into templated rules. Uses caching to prevent insertion of duplicate rules.

Formats rules for module-specific theming. Detects module theme override rules and converts them into templated rules. Uses caching to prevent insertion of duplicate rules.

public string
# getHelp( )

Provides the command description. This method may be overridden to return the actual command description.

Provides the command description. This method may be overridden to return the actual command description.

Returns

string
the command description. Defaults to 'Usage: php entry-script.php command-name'.

Overrides

CConsoleCommand::getHelp()
public
# progressBar( mixed $amount )
Methods inherited from CConsoleCommand
__construct(), afterAction(), beforeAction(), behaviors(), buildFileList(), confirm(), copyFiles(), ensureDirectory(), getCommandRunner(), getName(), getOptionHelp(), init(), onAfterAction(), onBeforeAction(), pluralize(), prompt(), renderFile(), resolveRequest(), 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 string $inputDir '../'
#

Input directory of the css Root

Input directory of the css Root

public string $outputFile 'components/ThemeGenerator/templates/generatedRules.php'
#

Output file

Output file

public string $moduleOverridesFile 'components/ThemeGenerator/templates/generatedModuleOverrides.php'
#
Properties inherited from CConsoleCommand
$defaultAction
Magic properties inherited from CConsoleCommand
$commandRunner, $help, $name, $optionHelp
X2CRM Documentation API documentation generated by ApiGen 2.8.0