Properties

$a

$a : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$b

$b : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$c

$c : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$d

$d : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$e

$e : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$f

$f : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$g

$g : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$h

$h : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$i

$i : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$j

$j : mixed

The a-j property, stores convenient ajax data for CJAX to use.

Type

mixed

$config

$config : \CJAX\Core\Config|\CJAX\Core\Ext

The config property, specifies the configuration variables for CJAX.

Type

\CJAX\Core\Config|\CJAX\Core\Ext

$caching

$caching : string

The caching property, checks if disk level caching is enabled.

Type

string

$callbacks

$callbacks : array

The callbacks property, stores a list of cached callbacks for CJAX to use.

Type

array

$controllerDir

$controllerDir : string

The controllerDir property, defines where controllers are located in a sub directory.

Type

string

$crc32

$crc32 : string

The crc32 property, defines information for CJAX's crc32 string.

Type

string

$event

$event : string

The event property, specifies the default event for CJAX if not specified.

Type

string

$file

$file : string

The file property, specifies the full name of cjax.js file.

Type

string

$flag

$flag : string

The flag property, holds the last flag set by CJAX internal processes.

Type

string

$fullPath

$fullPath : string

The fullPath property, defines fullPath of CJAX library.

Type

string

$initExtra

$initExtra : array

The initExtra property, stores a list of extra parameters upon CJAX initialization.

Type

array

$jsDir

$jsDir : string

The jsDir property, defines where javascript files are located in a sub directory.

Type

string

$lastCmd

$lastCmd : string

The lastCmd property, defines the last command/action executed for CJAX.

Type

string

$log

$log : boolean

The log property, specifies whether to show internal debug info.

Type

boolean

$method

$method : string

The method property, specifies the default way of making AJAX calls, either get or post.

Type

string

$path

$path : string

The path property, defines the path where Javascript library is located.

Type

string

$port

$port : \CJAX\Core\80

The port property, defines the port number when connecting to web pages.

Type

\CJAX\Core\80

$strict

$strict : boolean

The strict property, defines whether CJAX strict mode is enabled.

Type

boolean

$version

$version : string

The version property, defines the version number for CJAX.

Type

string

$cache

$cache : \CJAX\Core\Cache

The cache property, stores a refernece to the Cache object.

Type

\CJAX\Core\Cache

$pluginManager

$pluginManager : \CJAX\Core\PluginManager

The PluginManager property, stores a reference of PluginManager object.

Type

\CJAX\Core\PluginManager

$shutDown

$shutDown : boolean

The shutDown property, checks if system shutdown is executed.

Type

boolean

$xmlObjects

$xmlObjects : \CJAX\Core\Ext

The xmlObjects property, stores an object that holds referneces to XmlItem Ids.

Type

\CJAX\Core\Ext

$wrapper

$wrapper : string

The wrapper property, defines wrapper text for CJAX cache.

Type

string

Methods

__construct()

__construct(\CJAX\Core\Config|\CJAX\Core\Ext  $config, \CJAX\Core\Cache  $cache) : \CJAX\Core\CoreEvents

The constructor for CoreEvents class, creates an instance of CoreEvents object.

Parameters

\CJAX\Core\Config|\CJAX\Core\Ext $config
\CJAX\Core\Cache $cache

Returns

\CJAX\Core\CoreEvents

getCache()

getCache() : \CJAX\Core\Cache

The getCache method, obtains the cache instance stored in CoreEvents.

Returns

\CJAX\Core\Cache

getPluginManager()

getPluginManager() : \CJAX\Core\PluginManager

The getPluginManager method, obtains the plugin manager instance stored in CoreEvents.

Returns

\CJAX\Core\PluginManager

xmlItem()

xmlItem(integer  $xml, string  $name) : \CJAX\Core\XmlItem

The xmlItem method, creates an instance of XmlItemobject given its id and name.

Parameters

integer $xml
string $name

Returns

\CJAX\Core\XmlItem

xmlObject()

xmlObject(string  $id = null) : mixed

The xmlObject method, fetches an XmlItem object stored in CoreEvents.

Parameters

string $id

Returns

mixed

xmlObjects()

xmlObjects(string  $id = null) : mixed

The xmlObjects method, fetches one or all of XmlItems stored in CoreEvents.

Parameters

string $id

Returns

mixed

callbacks()

callbacks(array  $cache, boolean  $test = false) : array

The callbacks method, assigns a cache to callback array in CoreEvents.

Parameters

array $cache
boolean $test

Returns

array

out()

out() : string

The out method, writes the output of cache stored in CoreEvents.

Returns

string

commit()

commit() : string

The commit method, commits changes made in CoreEvents cache and creates xml/json response.

Returns

string

simpleCommit()

simpleCommit(boolean  $return = false) : mixed

The simpleCommit method, creates xml/json response from cache.

simpleCommit does not update internal cache, only uses cache contents to create responses.

Parameters

boolean $return

Returns

mixed

cacheWrapper()

cacheWrapper(array  $wrapper = array()) : void

The cacheWrapper method, creates cache wrapper string for AJAX responses.

Parameters

array $wrapper

saveCache()

saveCache() : void

The saveCache method, saves and prints out cached response data.

This method is registered as shutdown function to call before script exits.

processCache()

processCache(array  $cache) : array

The processCache method, process cached data for ajax request.

Parameters

array $cache

Returns

array

processPluginCache()

processPluginCache(array  $v, string  $caller = null) : array

The processPluginCache method, process cached data for CJAX plugins.

Parameters

array $v
string $caller

Returns

array

processEventCache()

processEventCache(array  $event) : array

The processEventCache method, process cached data for ajax events.

Parameters

array $event

Returns

array

updateCache()

updateCache(integer  $instanceId, mixed  $data) : array

The updateCache method, updates a given cached data given its id and new value.

Parameters

integer $instanceId
mixed $data

Returns

array

lastEntryId()

lastEntryId() : integer

The lastEntryId method, finds the id number for last cache.

Returns

integer

isPlugin()

isPlugin(string  $pluginName) : boolean

The isPlugin method, checks if a given plugin exists.

Parameters

string $pluginName

Returns

boolean

import()

import(string  $file, integer  $loadTime) : integer

The import method, imports css or javascript files for CJAX to use.

Parameters

string $file
integer $loadTime

Returns

integer

imports()

imports(array  $files = array(), array  $data = array()) : integer

The imports method, imports more than one file for CJAX.

Parameters

array $files
array $data

Returns

integer

first()

first() : void

The first method, sets 'first' flag for CJAX events, alias to preload method.

preload()

preload() : void

The preload method, flags command execution in high priority preload mode.

xml()

xml(\CJAX\Core\xml  $xml, string  $apiName = null) : integer

The xml method, it is an outputer that allows the interaction with xml.

Parameters

\CJAX\Core\xml $xml
string $apiName

Returns

integer

fallbackPrint()

fallbackPrint(string  $out) : string

The fallbackPrint method, it is used by CJAX to fallback on a small footprint on the page to be able to pass the pending data.

Parameters

string $out

Returns

string

cache()

cache(mixed  $value = null, integer  $cacheId = null) : string

The cache method, it is used for loading 'fly' events.

Parameters

mixed $value
integer $cacheId

Returns

string

jsonEncode()

jsonEncode(array  $array) : object

The jsonEncode method, encodes data into json format.

Parameters

array $array

Returns

object

mkArray()

mkArray(array  $array, string  $tag = 'json', boolean  $double = false) : string

The mkArray method, creates response data array given raw array data and tag name.

Parameters

array $array
string $tag
boolean $double

Returns

string

headRef()

headRef(string  $jsPath = null, boolean  $min = false) : string

The headRef method, loads cjax javascript library and outputs html for script tags.

If min parameter is specified, i

Parameters

string $jsPath
boolean $min

Returns

string

init()

init(boolean  $min = true) : string

The init method, initiates the process of sending the javascript file to the application.

Parameters

boolean $min

Returns

string

js()

js(string  $jsDir, boolean  $force = false) : boolean

The js method, it sets up the directory where the CJAX FRAMEWORK resides.

Parameters

string $jsDir
boolean $force

Returns

boolean

curl()

curl(string  $url, array  $postData = array()) : mixed

The curl method, opens a curl request with given url and post data.

Parameters

string $url
array $postData

Returns

mixed

remote()

remote(string  $url) : mixed

The remote method, creates a remote url/cross-domain request.

Parameters

string $url

Returns

mixed

fsockopen()

fsockopen(string  $url, string  $errno = null, string  $errstr = null) : mixed

The fsockopen method, opens a socket for ajax request.

Parameters

string $url
string $errno
string $errstr

Returns

mixed

readCache()

readCache(string  $crc32 = null) : string

The readCache method, reads available cache for CJAX.

Parameters

string $crc32

Returns

string

write()

write(string  $content, string  $filename = null) : string

The write method, writes to a file used as alternative for CJAX internal cache.

Parameters

string $content
string $filename

Returns

string

wait()

wait(  $seconds, boolean  $milliseconds = false, boolean  $expand = true) : \CJAX\Core\CoreEvents

The wait method, it will execute a command in a specified amouth of time.

Parameters

$seconds
boolean $milliseconds
boolean $expand

Returns

\CJAX\Core\CoreEvents

flag()

flag(integer  $flagId, integer  $commandCount = 1, array  $settings = array()) : \CJAX\Core\CoreEvents

The flag method, helper method to generate flags quicker.

Parameters

integer $flagId
integer $commandCount
array $settings

Returns

\CJAX\Core\CoreEvents

isAjaxRequest()

isAjaxRequest() : boolean

The flag method, tells whether this is an ajax request or not.

Returns

boolean

addEventTo()

addEventTo(string  $element, string|array  $actions, string  $event = 'onclick') : \CJAX\Core\XmlItem

The addEventTo method, attaches a CJAX event to DOM element.

Parameters

string $element
string|array $actions
string $event

Returns

\CJAX\Core\XmlItem

exec()

exec(string  $selector, array  $actions, string  $event = "click") : \CJAX\Core\XmlItem

The exec method, binds any events to given elements.

This method is the generic event binder that can handle any types of events.

Parameters

string $selector
array $actions
string $event

Returns

\CJAX\Core\XmlItem

encode()

encode(string  $data) : array

The encode method, endodes data to be used in url.

Parameters

string $data

Returns

array

xmlIt()

xmlIt(array  $input = array(), string  $tag = null) : string

The xmlIt method, converts an array into xml.

Parameters

array $input
string $tag

Returns

string

save()

save(string  $setting, mixed  $value = null, boolean  $useCookie = false) : void

The save method, saves settings/data into PHP sessions and cookies.

Parameters

string $setting
mixed $value
boolean $useCookie

cookie()

cookie(string  $setting, mixed  $value = null) : void

The cookie method, sets a cookie given its name and value.

Parameters

string $setting
mixed $value

input()

input(mixed  $value = 'cjax') : string

The input method, fetches and filters input with given value.

Parameters

mixed $value

Returns

string

get()

get(string  $setting, boolean  $getAsObject = false) : mixed

The get method, acquires session or cookie value.

If the parameter $getAsObject is true, array values will be converted into objects.

Parameters

string $setting
boolean $getAsObject

Returns

mixed

getSetting()

getSetting(string  $setting) : mixed

The getSetting method, gets raw data stored in session or cookie.

Parameters

string $setting

Returns

mixed

removeCache()

removeCache(integer  $cacheId) : void

The removeCache method, removes data from internal cache and commits this change.

Parameters

integer $cacheId

path()

path(string  $path) : void

The path method, specifies the path/url for where CJAX is located in a child/sub-directory.

Parameters

string $path

remotePath()

remotePath() : string

The remotepPath method, obtains the remote path information for CJAX library.

Returns

string

getFile()

getFile(string  $file = null) : string

The getFile method, finds and opens a given file given its name.

Parameters

string $file

Returns

string

connect()

connect(string  $file = null, integer  $port = 80,   $local = false) : string

The connect method, connects to a remote or local server and loads a given file.

Parameters

string $file
integer $port
$local

Returns

string

execActions()

execActions(array  $actions, string  $selector) : array

The execActions method, executes actions for cjax request and saves to cache.

Parameters

array $actions
string $selector

Returns

array

xmlInput()

xmlInput(string  $tag, array  $input) : array

The xmlInput method, helper method to convert each input data into xml.

Parameters

string $tag
array $input

Returns

array