ܻؤ1顪30奵꡼ޥܥ

ITȤƯ30奵꡼ޥΥ饤ߥ󥰵Ͽ

2010ǯ01

ȤꤢƥȤǥХ륵ȤǺäƤߤ褦ȡ
¸ΤܤƤ륵ȡʥͥȥˤΥХǺäƤߤ

Ȥ˥ХѤ˵ǽɲäʤɤϤƤ餺
ǥ꡼ä󥭥󥰤ñ̤ˤɽ餤
PCǤZendFrameworkǺäƤ뤱ɡХǤCakePHPäƤȤʰ㤤

2010ǯ118PCȤǥХǤιΡ
1֤η¬

Х


moPV

moUU



Ʊ֤PCǡ


pcPV

pcUU



ͻ


UUߤȡΤޤޤǤPCǤ1/10餤Υ桼褽ʴ
ޡǤ⡢ΥȤ9᤯Υ桼ͥȥ򥿤ʤΤPCȤȤ⤤äƤȤ
΢̤ǥå뤳Ȥ¿
Ĥ1ΥꥢʾСˤưȤ˸Ƥäƹͤȡη̤Ǽ

褯ȥХǤPV1/231/24ȤǤ롣


פ˳ˤϽФˡȤǤäȥͥȥäƤѥ͡


ʤ󤫤ޤǹͻ˳οƤäƤʤʤʤ͡
    Υȥ꡼ϤƤʥ֥åޡɲ

˰³GoogleAnalyticsƳ
ľܽ񤤤Ƥ⤤ɡȤꤢإѡͤù󤿡
vendorˤΤޤޤۤΤʡ

APP/views/helpers/ga.php

Υץ륽إѡѤ˽񤭴

<?php
class GaHelper extends Helper {
  private $GA_ACCOUNT="MO-XXXXXX-X";
  private $GA_PIXEL="/ga.php";

  function getUrl() {
    $url = "";
    $url .= $this->GA_PIXEL . "?";
    $url .= "utmac=" . $this->GA_ACCOUNT;
    $url .= "&utmn=" . rand(0, 0x7fffffff);
    $referer = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '';
    $query = $_SERVER["QUERY_STRING"];
    $path = $_SERVER["REQUEST_URI"];
    if (empty($referer)) {
      $referer = "-";
    }

    $url .= "&utmr=" . urlencode($referer);
    if (!empty($path)) {
      $url .= "&utmp=" . urlencode($path);
    }
    $url .= "&guid=ON";
    return str_replace("&", "&", $url);
  }
}
?>

APP/controllers/app_controller.php

٤ƤΥڡǽФ顢app_controller

<?php
class AppController extends Controller {
  var $helpers = array('ga');

APP/views/layouts/main.ctp

ᥤΥ쥤Ȥbody˽񤯡

<html>
<head></head>
<body>
   
   
<?php $googleAnalyticsImageUrl = $ga->getUrl(); ?>
<img src="<?php echo $googleAnalyticsImageUrl; ?>" />
</body>
</html>

APP/webroot/ga.php

ȤGAδ̤DLǤga.phpwebroot֤ƽλ
ưƤߤ

    Υȥ꡼ϤƤʥ֥åޡɲ

xml

<?xml version="1.0" encoding="Shift_JIS"?>

ǽ񤯤ȥ顼ˤʤ롣
֤ߤʺǽˤǤĤޤŤ͡
ä餹ǤƤ

ˡϤĤäơ
echoǤ
apache
Ȥ

echoǽФޤ
<?php echo'<?xml version="1.0" encoding="Shift_JIS"?>'."\n"; ?>

DOCTYPEλ

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

3ꥢ̤DOCTYPEʬΥ
http://ma-san.org/2009/10/htmlphpdoctype.html

Content-Typeإåλ

<meta http-equiv="Content-Type" content="application/xhtml+xml ; charset=Shift_JIS" />

apacheǤǤϤʤ󻪤ȤŪˤ褦˥ˡ
app_controller.phpbeforerenderǽϡ
*)Ѿbeforerender()parent:beforerender()˺줺ˡ

APP/controller/app_controller.php

<?php
class AppController extends Controller {
  function beforerender() {
    header('Content-Type: application/xhtml+xml');
  }
}

ߥ졼

docomo
http://www.nttdocomo.co.jp/service/imode/make/content/browser/html/tool2/index.html

softbank
http://creation.mb.softbank.jp/web/web_tool.html

au
http://www.au.kddi.com/ezfactory/tool/ue/
http://web.archive.org/web/*/developer.openwave.com/ja/tools_and_sdk/openwave_mobile_sdk/SDK62K/Openwave_SDK_62K.exe

fireMobileSimulator
http://firemobilesimulator.org/
    Υȥ꡼ϤƤʥ֥åޡɲ

դѤäƤФ餯ΤӤꤷơ1᤮餤˽ؤء
̲äɤʤȤޤ
ǯۤΤϺǯơ

ɤβֱҤޤǡ
2餤Ǥ⤹Ǥ
礦1֤餤¤̵ؽλǤ

ǯΤߤǤ
Ǥ񤤤Ƥ뤳Ȥ󤼤Ȥʤ
ʤˤ줳襤


    Υȥ꡼ϤƤʥ֥åޡɲ

ΥڡΥȥåץ