Framework Skeleton: Setting STDOUT XML

This user-defined file is a XML requirement of STDOUT MVC API. Skeleton comes with a built-in version that uses following bindings:

API XML Tag Bound to Description
application>paths>controllers application/controllers Sets folder where controllers are searched
application>paths>views application/views Sets folder where views are searched
application>paths>resolvers application/resolvers Sets folder where view resolvers/renderers are searched
application>paths>listeners application/listeners Sets folder where event listeners are searched
formats HtmlResolver
ViewLanguageResolver
JsonResolver
Support for HTML and JSON view resolvers/renderers

Below are additional tags required by event listeners and view resolvers if any of former is used:

Tag Required by Required if
loggers LoggingListener you need logging.
servers>sql SQLDataSourceInjector you need to query SQL databases (eg: mysql).
servers>nosql NoSQLDataSourceInjector you need to query NoSQL databases (eg: memcache)
security SecurityListener you need authentication and authorization of requests.
users SecurityListener you need access control list authentication.
routes SecurityListener you need access control list authorization of requests.
routes ValidationListener you need to validate request by parameters and method.
internationalization LocalizationListener you need response being automatically translated to client language.
http_caching HttpCachingListener you need HTTP caching of response via ETAGs/LastModified headers.
application ViewLanguageResolver you need HTML views to be templated and free of PHP.

loggers

This tag stores loggers your application is using, per development environment, to be used in Logging API integration.

Syntax:

<loggers path="{PATH}"> <{ENVIRONMENT}> <logger class="{CLASS}" {ADDITIONAL_ATTRIBUTES}> ... </{ENVIRONMENT}> ... </loggers>

Where:

Framework comes with following loggers preinstalled:

Example:

<loggers> <local> <logger class="FileLoggerWrapper" path="C:\xampp\htdocs\tmp" format="%d %v %u %e %f %l %m"/> </local> <live> <logger class="FileLoggerWrapper" path="/tmp/log" rotation="Y-m-d" format="%d %v %u %e %f %l %m"/> <logger class="SysLoggerWrapper" application="My App" format="%u %e %f %l %m"/> </local> </loggers>

NOTE: it is allowed to log same message to multiple drivers at once for same development environment

servers > sql

This tag stores list of sql servers you will be connecting to across the application, per development environment, to be used in SQL Data Access API integration

Syntax:

<servers> <sql> <{ENVIRONMENT}> <server name="{NAME}" driver="{DRIVER}" {ADDITIONAL_ATTRIBUTES}> ... </{ENVIRONMENT}> ... </sql> </servers>

Where:

Following {ADDITIONAL_ATTRIBUTES} are known:

Example:

<servers> <sql> <local> <server driver="mysql" host="localhost" port="3306" username="root" password="" schema="example" charset="utf8"/> </local> <live> <server driver="mysql" host="localhost" port="3306" username="hello" password="world" schema="example" charset="utf8"/> </live> </sql> </servers>

servers > nosql

This tag stores list of nosql servers/drivers you will be connecting to across the application, per development environment, to be used in NoSQL Data Access API integration

Syntax:

<servers> <nosql> <{ENVIRONMENT}> <server name="{NAME}" driver="{DRIVER}" {ADDITIONAL_ATTRIBUTES}> ... </{ENVIRONMENT}> ... </nosql> </servers>

Where:

Following {ADDITIONAL_ATTRIBUTES} are known:

Example:

<servers> <nosql> <local> <server driver="memcached" host="localhost"/> </local> <live> <server driver="memcache" host="host1:11211, host2:11212" persistent="1" timeout="10"/> </live> </nosql> </servers>

security

This tag stores global web security settings, to be used in Web Security API integration via following sub-tags:

Syntax:

<security dao_path="{DAO_PATH}"> <{CSRF}> <persistence> <{SESSION}> <{REMEMBER_ME}> <{SYNCHRONIZER_TOKEN}> <{JSON_WEB_TOKEN}> </persistence> <authentication> <{FORM}> <{OAUTH2}> </authentication> <authorization> <{BY_DAO}> <{BY_XML}> </authorization> </security>

Where:

Example:

<security dao_path="application/models/dao"> <csrf secret="pxNa}aJSS|ojCPA"/> <authentication> <form dao="Users" throttler="SqlLoginThrottler""/> <oauth2 dao="Users"> <live> <driver name="Facebook" client_id="{CLIENT_ID}" client_secret="{CLIENT_SECRET}" callback="login/facebook"/> <driver name="Google" client_id="{CLIENT_ID}" client_secret="{CLIENT_SECRET}" callback="login/google"/> </live> </oauth2> </authentication> <persistence> <session/> <rememberMe secret="pxNa}aJSS|ojCPA"/> </persistence> <authorization> <by_dao page_dao="Pages" user_dao="Users" /> </authorization> </security>

internationalization

This tag stores localization settings for your application, to be used in Internationalization API integration.

Syntax:

<internationalization locale="{LOCALE}" domain="{DOMAIN}" folder="{FOLDER}" method="{METHOD}"/>

Where:

If detection method is 'session', inside <internationalization> tag there MUST be a <session> tag with following syntax

<session expiration="{value}" is_http_only="{value}" is_https_only="{value}" handler="{value}"/>

Where:

Example:

<internationalization locale="en_US" method="header"/>

http_caching

This tag configures HTTP caching for your application, to be used in HTTP Caching API integration. Root tag stores global policies, while its children store route-based settings that override global.

Syntax:

<http_caching drivers_path="{DRIVERS_PATH}" expiration="{EXPIRATION}" class="{CLASS}" no_cache="{NO_CACHE}"> {ROUTES} </http_caching>

Where:

Framework comes with two Lucinda\Caching\Cacheable implementations already pre-installed (EtagCacheableDriver & DateCacheableDriver) available in application/models/cacheables folder.

Example:

<http_caching drivers_path="application/models/cacheables" class="EtagCacheableDriver"> <route url="login" no_cache="1"/> <route url="terms-and-conditions" expiration="60"/> </http_caching>

application

This tag is a requirement of STDOUT MVC API, also used in View Language API integration. Documentation of STDOUT structural requirements is already given HERE, so we will only concentrate in templating-specific additions.

Syntax:

<application templates_extension="{EXTENSION}" ...> <paths> <compilations>{COMPILATIONS}</compilations> <tags>{TAGS}</tags> ... </paths> </application>

Where:

Example:

<application templates_extension="html" auto_routing="0" default_page="index" default_format="html"> <paths> <controllers>application/views</controllers> <views>application/views</views> <tags>application/taglib</tags> <compilations>compilations</compilations> </paths> </application>

formats

This tag is a requirement of STDOUT MVC API to configure format in which response will be displayed. Documentation of API structural requirements is already given HERE, so we will only concentrate in framework additions.

Framework comes with following formats preinstalled, found in application/resolvers folder:


Share