uzywal ktos moze czegos takiego jak WURFL ? http://wurfl.sourceforge.net/
po krotce to taka klasa ktora na podstawie naglowkow wyslanych przez przegladarke (telefon, palmtopa) zwraca nam jego parametry. zainstalowalem to ,ale cos kiepsko mi dziala, wywala mi strone wap ze plik niezgodny z xml
wycinek logu:
Kod
Tue, 31 Jan 2006 12:20:09 +0100 [135.v.tld.pl 26724][constructor] Class Initiated
Tue, 31 Jan 2006 12:20:09 +0100 [135.v.tld.pl 26724][GetDeviceCapabilitiesFromAgent] searching for SEC-SGHE300
Tue, 31 Jan 2006 12:20:09 +0100 [135.v.tld.pl 26724][GetDeviceCapabilitiesFromAgent] WURFL is not loaded, now loading
Tue, 31 Jan 2006 12:34:58 +0100 [135.v.tld.pl 6570][constructor] Class Initiated
Tue, 31 Jan 2006 12:34:58 +0100 [135.v.tld.pl 6570][GetDeviceCapabilitiesFromAgent] searching for Nokia6610/1.0 (5.52) Profile/MIDP-1.0 Configuration/CLDC-1.0
Tue, 31 Jan 2006 12:34:58 +0100 [135.v.tld.pl 6570][GetDeviceCapabilitiesFromAgent] WURFL is not loaded, now loading
Tue, 31 Jan 2006 12:36:49 +0100 [135.v.tld.pl 7985][constructor] Class Initiated
Tue, 31 Jan 2006 12:36:49 +0100 [135.v.tld.pl 7985][GetDeviceCapabilitiesFromAgent] searching for Nokia6610/1.0 (5.52) Profile/MIDP-1.0 Configuration/CLDC-1.0
Tue, 31 Jan 2006 12:36:49 +0100 [135.v.tld.pl 7985][GetDeviceCapabilitiesFromAgent] WURFL is not loaded, now loading
Tue, 31 Jan 2006 12:20:09 +0100 [135.v.tld.pl 26724][GetDeviceCapabilitiesFromAgent] searching for SEC-SGHE300
Tue, 31 Jan 2006 12:20:09 +0100 [135.v.tld.pl 26724][GetDeviceCapabilitiesFromAgent] WURFL is not loaded, now loading
Tue, 31 Jan 2006 12:34:58 +0100 [135.v.tld.pl 6570][constructor] Class Initiated
Tue, 31 Jan 2006 12:34:58 +0100 [135.v.tld.pl 6570][GetDeviceCapabilitiesFromAgent] searching for Nokia6610/1.0 (5.52) Profile/MIDP-1.0 Configuration/CLDC-1.0
Tue, 31 Jan 2006 12:34:58 +0100 [135.v.tld.pl 6570][GetDeviceCapabilitiesFromAgent] WURFL is not loaded, now loading
Tue, 31 Jan 2006 12:36:49 +0100 [135.v.tld.pl 7985][constructor] Class Initiated
Tue, 31 Jan 2006 12:36:49 +0100 [135.v.tld.pl 7985][GetDeviceCapabilitiesFromAgent] searching for Nokia6610/1.0 (5.52) Profile/MIDP-1.0 Configuration/CLDC-1.0
Tue, 31 Jan 2006 12:36:49 +0100 [135.v.tld.pl 7985][GetDeviceCapabilitiesFromAgent] WURFL is not loaded, now loading
po wlaczeniu cache :
Kod
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] searching for SEC-SGHE300
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] cache enabled, WURFL is not loaded, now loading
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] loading WURFL from cache
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] Searching in the agent database
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] WARNING: I couldn't find the device in my list, the headers are my last chance
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_WriteFastAgentToId] Created temp file data/agent2id.php443df5781a85f76.42447410
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_WriteFastAgentToId] Done caching user_agent to wurfl_id
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_GetFullCapabilities] searching for generic
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_GetDeviceCapabilitiesFromId] reading id:generic
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_GetDeviceCapabilitiesFromId] ERROR: the id generic is not present in wurfl_agents
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] cache enabled, WURFL is not loaded, now loading
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] loading WURFL from cache
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] Searching in the agent database
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][GetDeviceCapabilitiesFromAgent] WARNING: I couldn't find the device in my list, the headers are my last chance
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_WriteFastAgentToId] Created temp file data/agent2id.php443df5781a85f76.42447410
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_WriteFastAgentToId] Done caching user_agent to wurfl_id
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_GetFullCapabilities] searching for generic
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_GetDeviceCapabilitiesFromId] reading id:generic
Tue, 31 Jan 2006 13:26:41 +0100 [135.v.tld.pl 21266][_GetDeviceCapabilitiesFromId] ERROR: the id generic is not present in wurfl_agents
tak jakby tego pliku xml nie widział
czesc skryptu:
<?php require_once('wurfl_config.php'); // include the configuration, make sure to configure it properly require_once(WURFL_CLASS_FILE); // include the main class. This is defined in the configuration file $myDevice = new wurfl_class($wurfl, $wurfl_agents); $myDevice->GetDeviceCapabilitiesFromAgent($_SERVER["HTTP_USER_AGENT"]); if ( $myDevice->browser_is_wap ) $tresc.='wap_ok'; else $tresc.='wap_nook'; ?>
oba sprawdzane telefony sa w pliku xml z danymi