Helper Namespace


Classes


ArgumentHelper

constructor

With the help of this method you can create a new instance of ArgumentHelper.

Signature

constructor(void) : Object|ArgumentHelper

Returns

  • Object, ArgumentHelper
    • A new instance of ArgumentHelper

build

Build a new argument object to process.

Signature

build(Array args) : Object

Parameters

  • args
    • Arguments to analyse
    • Type: Array

Returns

  • Object
    • The return value is not further described


Argument

constructor

With the help of this method you can create a new instance of Argument.

Signature

constructor(void) : Object|Argument

Returns

  • Object, Argument
    • A new instance of Argument

setCommands

Define all commands to parse.

Signature

setCommands(Object commands) : void

Parameters

  • commands
    • Commands configuration
    • Type: Object

setValidator

Set the validator for all arguments.

Signature

setValidator(Function validator) : void

Parameters

  • validator
    • Validator function
    • Type: Function

parse

Parse the arguments and match up the commands to get a array of commands to run.

Signature

parse(void) : Array

Returns

  • Array
    • The return value is not further described


CacheHelper

constructor

With the help of this method you can create a new instance of CacheHelper.

Signature

constructor(void) : Object|CacheHelper

Returns

  • Object, CacheHelper
    • A new instance of CacheHelper

key

Build an cache key by given arguments.

Signature

key(Object args) : String

Parameters

  • args
    • Method arguments to build an key of
    • Type: Object

Returns

  • String
    • The return value is not further described


Dependency

constructor

With the help of this method you can create a new instance of Dependency.

Signature

constructor(void) : Object|Dependency

Returns

  • Object, Dependency
    • A new instance of Dependency

get

Allows to get a dependency.

Signature

get(String type, String key) : Mixed

Parameters

  • type
    • Maybe 'module' or 'path'
    • Type: String
  • key
    • Which path or module to get
    • Type: String

Returns

  • Mixed
    • The return value is not further described

set

Allows to set a dependency.

Signature

set(String type, String key, Mixed val) : Undefined

Parameters

  • type
    • Maybe 'module' or 'path'
    • Type: String
  • key
    • Which path or module to set
    • Type: String
  • val
    • Value for the specified key
    • Type: Mixed

Returns

  • Undefined
    • The return value is not further described

validateType

Checks, if a correct type string was provided.

Signature

validateType(String type) : String|Bool

Parameters

  • type
    • Type: String

Returns

  • String, Bool
    • The return value is not further described


I18nHelper

constructor

With the help of this method you can create a new instance of I18nHelper.

Signature

constructor(void) : Object|I18nHelper

Returns

  • Object, I18nHelper
    • A new instance of I18nHelper

listLanguagesCodes

Get a list of all ISO 639 language codes with their tags/regions.

Signature

listLanguagesCodes(void) : Array

Returns

  • Array
    • The return value is not further described

checkLanguageCode

Checks if the given language code is valid/known.

Signature

checkLanguageCode(String code) : Boolean

Parameters

  • code
    • Code to check
    • Type: String

Returns

  • Boolean
    • The return value is not further described


Path

constructor

With the help of this method you can create a new instance of Path.

Signature

constructor(void) : Object|Path

Returns

  • Object, Path
    • A new instance of Path

list

Recursivly list all files and/or directories for given start point(s).

Signature

list(Array|String startPoints, Object options) : Array

Parameters

  • startPoints
    • Startpoint to search, or multiple
    • Types: Array, String
  • options
    • Options for listing dirs and/or files
    • Type: Object

Returns

  • Array
    • The return value is not further described


Process

constructor

With the help of this method you can create a new instance of Process.

Signature

constructor(void) : Object|Process

Returns

  • Object, Process
    • A new instance of Process

findChilds

Find all child process ids for a given process id.

Signature

findChilds(String pid) : Array

Parameters

  • pid
    • Parent pid to search childs for
    • Type: String

Returns

  • Array
    • The return value is not further described

getMemoryUsage

Get the memory usage of the given process ids.

Signature

getMemoryUsage(Array pids) : Object

Parameters

  • pids
    • Pids to get memory usage for
    • Type: Array

Returns

  • Object
    • The return value is not further described

isRunning

Check if the given process id exists and is running.

Signature

isRunning(Integer pid) : Boolean

Parameters

  • pid
    • Process id
    • Type: Integer

Returns

  • Boolean
    • The return value is not further described

getPidPathForContext

Get the path to the process id file of a context.

Signature

getPidPathForContext(String path, String context) : String

Parameters

  • path
    • Path to the application
    • Type: String
  • context
    • Name of the context
    • Type: String

Returns

  • String
    • The return value is not further described

getPidForContext

Get the process for a given context.

Signature

getPidForContext(String path, String context) : Integer|Boolean

Parameters

  • path
    • Path of the application
    • Type: String
  • context
    • Name of the context to check
    • Type: String

Returns

  • Integer, Boolean
    • The return value is not further described

isContextRunning

Check if the given context is running.

Signature

isContextRunning(String path, String context) : Boolean

Parameters

  • path
    • Path of the application
    • Type: String
  • context
    • Name of the context to check
    • Type: String

Returns

  • Boolean
    • The return value is not further described

getContextState

Get the state as object for a given context.

Signature

getContextState(String path, String context) : Object

Parameters

  • path
    • Path of the application
    • Type: String
  • context
    • Name of the context to check
    • Type: String

Returns

  • Object
    • The return value is not further described

kill

Kill a process by it's id.

Signature

kill(Integer pid, [Integer|String signal], Function callback) : void

Parameters

  • pid
    • Process id to kill
    • Type: Integer
  • [signal]
    • Signal to send (default: SIGINT|2)
    • Types: Integer, String
  • callback
    • Function to call on finish
    • Type: Function


Project

constructor

With the help of this method you can create a new instance of Project.

Signature

constructor(void) : Object|Project

Returns

  • Object, Project
    • A new instance of Project

findAppPath

Find a greppy project by path.

Signature

findAppPath(String path) : Object

Parameters

  • path
    • Path to start looking
    • Type: String

Returns

  • Object
    • The return value is not further described

listContexts

List all context of an application path.

Signature

listContexts(String path) : Object

Parameters

  • path
    • Path to look for contexts
    • Type: String

Returns

  • Object
    • The return value is not further described

listModules

List all modules of an application path.

Signature

listModules(String path) : Object

Parameters

  • path
    • Path to look for modules
    • Type: String

Returns

  • Object
    • The return value is not further described

loadContexts

Load the contexts instances for a given context object which was build by ``listContexts``.

Signature

loadContexts(Object contextObject) : Object

Parameters

  • contextObject
    • Contexts Object
    • Type: Object

Returns

  • Object
    • The return value is not further described

findStartScript

Search the start script of a greppy application.

Signature

findStartScript(String path) : String|Boolean

Parameters

  • path
    • Path to search in
    • Type: String

Returns

  • String, Boolean
    • The return value is not further described

listConfigs

List all configurations of an application path.

Signature

listConfigs(String path) : Object

Parameters

  • path
    • Path to look for configurations
    • Type: String

Returns

  • Object
    • The return value is not further described

loadConfigs

Load the configuration instances for a given config object which was build by ``listConfigs``.

Signature

loadConfigs(Object configObject) : Object

Parameters

  • configObject
    • Configuration Object
    • Type: Object

Returns

  • Object
    • The return value is not further described

listModels

List all models of a given module path.

Signature

listModels(String path, [Boolean listAssociations]) : Object

Parameters

  • path
    • Path to look for models
    • Type: String
  • [listAssociations]
    • List associations - Default: false
    • Type: Boolean

Returns

  • Object
    • The return value is not further described

listModelsForAllModules

List all models of all modules of an application path.

Signature

listModelsForAllModules(String path, [Boolean listAssociations]) : Object

Parameters

  • path
    • Path to look for configurations
    • Type: String
  • [listAssociations]
    • List associations - Default: false
    • Type: Boolean

Returns

  • Object
    • The return value is not further described

listFixturesForConnection

List all fixtures for a connection.

Signature

listFixturesForConnection(String path, String connection) : Object

Parameters

  • path
    • Path to look for fixtures
    • Type: String
  • connection
    • Name of the connection
    • Type: String

Returns

  • Object
    • The return value is not further described

listMigrationsForConnection

List all fixtures for a connection.

Signature

listMigrationsForConnection(String path, String connection) : Object

Parameters

  • path
    • Path to look for fixtures
    • Type: String
  • connection
    • Name of the connection
    • Type: String

Returns

  • Object
    • The return value is not further described

formatContextRoutes

Format all routes of an given context.

Signature

formatContextRoutes(Object context) : Array

Parameters

  • context
    • Context were we format routes
    • Type: Object

Returns

  • Array
    • The return value is not further described