I'm trying to run some php script on cron. Unfortunately, the
$modx->config['base_url']
variable is not available. How to grab this value in cron job defined like:
php -f /path/to/my/php/file.php
? does anyone know?
-
☆ A M B ☆
- 24,524 Posts
For one thing, base_url is the base of the web root, which has no meaning to the filesystem. Paths are for files, URLs are for webpage requests.
A base_url might resolve to "/", while the base_path would be something like "/var/www/mydomain.com/public_html/".
Most of the paths you need are to be found in the core/configs/config.inc.php file; the path to the site's core is found in the three config.core.php files. For example, mine have this:
define('MODX_CORE_PATH', '/Applications/MAMP/htdocs/revo228/core/');
See
http://rtfm.modx.com/display/revolution20/Loading+MODx+Externally