Hello All,
I know I have done this before and it worked yet I cant get it to work again.
I want to access the $modx->config parameters through a php file in my snippet directory and yet when I do the following below
require_once ’../../../manager/includes/protect.inc.php’;
include_once ("../../../manager/includes/config.inc.php");
include_once(MODX_BASE_PATH."manager/includes/document.parser.class.inc.php");
$modx = new DocumentParser;
and then call print_r($modx->config); it returns an empty string. When I call $modx I get this
DocumentParser Object ( [db] => DBAPI Object ( [conn] => [config] => Array ( [host] => ... [dbase] => `...` [user] => ... [pass] => ... [charset] => latin1 [connection_method] => SET CHARACTER SET [table_prefix] => modx_ ) [isConnected] => [_dbconnectionmethod] => SET CHARACTER SET [dataTypes] => Array ( [numeric] => Array ( [0] => INT [1] => INTEGER [2] => TINYINT [3] => BOOLEAN [4] => DECIMAL [5] => DEC [6] => NUMERIC [7] => FLOAT [8] => DOUBLE PRECISION [9] => REAL [10] => SMALLINT [11] => MEDIUMINT [12] => BIGINT [13] => BIT ) [string] => Array ( [0] => CHAR [1] => VARCHAR [2] => BINARY [3] => VARBINARY [4] => TINYBLOB [5] => BLOB [6] => MEDIUMBLOB [7] => LONGBLOB [8] => TINYTEXT [9] => TEXT [10] => MEDIUMTEXT [11] => LONGTEXT [12] => ENUM [13] => SET ) [date] => Array ( [0] => DATE [1] => DATETIME [2] => TIMESTAMP [3] => TIME [4] => YEAR ) ) ) [event] => SystemEvent Object ( [name] => [_propagate] => 1 [_output] => [activated] => [activePlugin] => ) [Event] => SystemEvent Object ( [name] => [_propagate] => 1 [_output] => [activated] => [activePlugin] => ) [pluginEvent] => Array ( ) [config] => [rs] => [result] => [sql] => [table_prefix] => [debug] => [documentIdentifier] => [documentMethod] => [documentGenerated] => [documentContent] => [tstart] => [minParserPasses] => [maxParserPasses] => [documentObject] => [templateObject] => [snippetObjects] => [stopOnNotice] => [executedQueries] => [queryTime] => [currentSnippet] => [documentName] => [aliases] => [visitor] => [entrypage] => [documentListing] => [dumpSnippets] => [chunkCache] => [snippetCache] => [contentTypes] => [dumpSQL] => [queryCode] => [virtualDir] => [placeholders] => [sjscripts] => Array ( ) [jscripts] => Array ( ) [loadedjscripts] => Array ( ) [documentMap] => [forwards] => 3 [dbConfig] => Array ( [host] => ... [dbase] => `...` [user] => ... [pass] => ... [charset] => latin1 [connection_method] => SET CHARACTER SET [table_prefix] => modx_ ) )
Obviously I have removed db info and replaced with ...
Any ideas as to why I am not accessing the $modx?