Exemple #1
0
function init_script_filename()
{
    // $script にファイル名が設定されていれば、それを求める
    $script = init_script_uri('', 1);
    $pos = strrpos($script, '/');
    if ($pos !== false) {
        return substr($script, $pos + 1);
    }
    return '';
}
Exemple #2
0
bind_textdomain_codeset(DOMAIN, SOURCE_ENCODING);
textdomain(DOMAIN);
/////////////////////////////////////////////////
// リソースファイルの読み込み
require LIB_DIR . 'resource.php';
// Init encoding hint
// define('PKWK_ENCODING_HINT', isset($_LANG['encode_hint']) ? $_LANG['encode_hint'] : '');
define('PKWK_ENCODING_HINT', isset($_LANG['encode_hint']) && $_LANG['encode_hint'] != 'encode_hint' ? $_LANG['encode_hint'] : '');
// unset($_LANG['encode_hint']);
/////////////////////////////////////////////////
// INI_FILE: Init $script
if (isset($script)) {
    init_script_uri($script);
    // Init manually
} else {
    $script = init_script_uri();
    // Init automatically
}
/////////////////////////////////////////////////
// INI_FILE: $agents:  UserAgentの識別
$ua = 'HTTP_USER_AGENT';
$user_agent = $matches = array();
$user_agent['agent'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
// unset(${$ua}, $_SERVER[$ua], $HTTP_SERVER_VARS[$ua], $ua);	// safety
foreach ($agents as $agent) {
    if (preg_match($agent['pattern'], $user_agent['agent'], $matches)) {
        $user_agent['profile'] = isset($agent['profile']) ? $agent['profile'] : '';
        $user_agent['name'] = isset($matches[1]) ? $matches[1] : '';
        // device or browser name
        $user_agent['vers'] = isset($matches[2]) ? $matches[2] : '';
        // 's version