我怎样才能设置到顶级目录(即public_html/folder
)?
我试过$_SERVER['DOCUMENT_ROOT']
没有运气。
define('JPATH_BASE', dirname(realpath(__FILE__)). '/folder' );
编辑: 这是整个代码,以防万一:
<?php
// Set flag that this is a parent file
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(realpath(__FILE__)). '/folder' );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
jimport('joomla.application.module.helper');
jimport('joomla.application.component.helper');
$mainframe =& JFactory::getApplication('site');
if (!$mainframe->getCfg('offline'))
{
echo "Folder is <span style=\"color:green;\">online</span>.";
}
?>