(a) ストアがオンラインで、(b) ディレクトリ/storeが利用可能かどうかを確認する次のコードがあります。
<?php
// Set flag that this is a parent file
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(realpath(__FILE__)). '/../store' );
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');
$filename = '../store/';
if (!$mainframe->getCfg('offline') && file_exists($filename))
{
echo "online";
}
else
{
echo "offline";
}
?>
コントロール パネルでストアをオフラインとして設定すると正常に動作しますが、ディレクトリ/storeの名前が変更されているか、削除されている (利用できなくなっている) と、ページでサーバー エラーが生成されますが、"offline" がエコーされます。ディレクトリ名が変更されたときに「オフライン」を反映するように変更するにはどうすればよいですか