どうすれば最上位ディレクトリに設定できますか (つまり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>.";
}
?>