Buildout

This class is used by the Artaengine frame to build applications, unless you want to tweak or hack something reading this API is a waste of time. Builds an Artaengine application. Synchronizes database with models(if used), creates cache and meta files, fetches translation keys out of models, phptal or smarty templates. This class is used internally by the framework, normally programmers do not need to tamper with this class. Note that this class does not implement an interface, the API for this class is subject to change. You can build an application by: 1- Calling Arta::build(); 2- Creating an ArtaCli app and calling $this->build('configure.ini'); 3- Browser, add /build//// to the application URL. Zero or more trailing slashes can be added to this path to avoid conflicts with application paths. Build path can be enabled or disabled in app configs.
Source
Buildout.php
Depends on
Arta , Request , Database , Model , Models , SessionDb , ErrorException , Inspect

Constants

VERSION = '1.1.6'

Builder version

Properties

authorizeDbo = 'null'

$obj->authorizeDbo = 'null'

Database object name to be used for Authorization

file = array

$obj->file = array(
        'phptal_i18n' => null, // PHP TAL translation keys
        'smarty_i18n' => null, // Smarty translation keys
        'browser'     => null, // Browser dictionary
        'factory'     => null, // URL map to factory
        'build'       => null, // Build info
    )

File-paths whch to be created by the builder {key: file-path,}

msgs = array

$obj->msgs = array()

[[message-text, message-type,],] list of buildout messages. message-type: 0 header text 1 function - start text 2 function - time 3 end text 4 end text - time 5 warning 6 fatal error 7 action description 8 action description indented 9 action description indented 10 end

Static Methods

errorHandler

void Buildout::errorHandler(int code, string description, string file, int line)

Buildout error handler - converts error to exception and calls the exception handler.

Arguments

    code (int)
    Error code
    description (string)
    Error description
    file (string)
    File which raised the error
    line (int)
    Line where the error happened

Returns

void

Throws

  • ErrorException Throws the error as exception

exceptionHandler

void Buildout::exceptionHandler(ErrorException exception)

Buildout exception handler.

Arguments

    exception (ErrorException)
    ErrorException Object to be handled

Returns

void

p

string Buildout::p(array | strings | [string] An)

Fixes/sticks a path(s) and replaces "ARTA_DIR", "APP_DIR", "ARTA_TEMP_DIR" and "TEMP_DIR" inside the path with their real directory values.

Since
Artaengine 1.1.0

Arguments

    An (array | strings | [string])
    array of paths, one paths or parts of a path to be sticked together, be fixed and constants be replaced with real paths.

Returns

string
Fixed path

Methods

__construct

Buildout $obj = new Buildout(
    string | array configs=null,
    array constants=null,
    bool manual=false
)

Buildout constructor.

Arguments

    configs=null (string | array)
    App configs ini file or array
    constants=null (array)
    Artaengine constant names and key and their values regarding the application which will be built
    manual=false (bool)
    false=constructor will build everything, true=building will be done manually

Returns

void

addMessage

void $obj->addMessage(string msg=null, int type=0)

Buildout message. 0 header text 1 function - start text 2 function - time 3 end text 4 end text - time 5 warning 6 fatal error 7 action description 8 action description indented 9 action description indented 10 end

Arguments

    msg=null (string)
    type=0 (int)

Returns

void

browserDictionary

void $obj->browserDictionary(array filenames=null)

Builds catche files required for browser dictionary (front-end resource dictionary).

Arguments

    filenames=null (array)
    [browser-dictionary-file-paths,]

Returns

void

dataModels

void $obj->dataModels(
    array databases=null,
    array models=null,
    bool clear=false,
    string sessionDbo=null
)

Builds cache files needed for data modeling, synchronizes models with database.

Arguments

    databases=null (array)
    {database-object-name: {database-connection-configs},}
    models=null (array)
    {model-group-name: {model-configs},}
    clear=false (bool)
    Clear cache files before doing anything
    sessionDbo=null (string)
    Name of database object used by session, if session repo is database

Returns

void

database

void $obj->database(array databases=null)

Runs SQLs if set to do so.

Arguments

    databases=null (array)
    {database-object-name: {database-connection-configs},}

Returns

void

extractSmartyi18n

void $obj->extractSmartyi18n(string tplDirectory=null)

SmartyGetText > Rips gettext strings from smarty template.

Author
Sagi Bashari

Arguments

    tplDirectory=null (string)
    Templates path

Returns

void

extractTALi18n

void $obj->extractTALi18n(string tplDirectory=null)

Parses all templates(phptal) and extracts translation keys.

Arguments

    tplDirectory=null (string)
    Templates path

Returns

void

factory

void $obj->factory(array factoryConfigs=null)

Builds cache files required for URL/Factory mapping and permissions.

Arguments

    factoryConfigs=null (array)
    array (factory_path: factory-directory, factory_config: URL-mapping-file-path)

Returns

void