Apache2-WURFLFilter
view release on metacpan or search on metacpan
Added Parameter CacheDirectoryStore to set the directory where the data are stored.
The Cache system use the Cache::FileBackend library, now the capabilities of device data are stored on filesystem. So if the version of WURFL or CapabilityList are not changed at startup Apache don't lost the data stored.
Fixed Bugs (thanks to Eladio)
Clear code
WURFLFilter 2.07
Clear code
WURFLFilter 2.06
Fixed Bugs for caching system thanks to nobbynobbs
For the uknown devices now the AMF_ID return "device_not_found" value (before was null)
Manage strange headers X-Device-User-Agent for Content Transformation (read more: http://www.w3.org/TR/ct-guidelines/)
ImageRenderingFilter 2.06
Clear the code
WURFLFilter 2.05
WURFLFIlter parameter DownloadZipFile now the Apache Mobile Filter detect automaticaly the file to download is a zip file.
Add Environment variable AMF_WURFLVER to know which version of WURFL the filter use.
Optimize the downloading phases of wurfl files.
ImageRenderFilter fixed bugs
lib/Apache2/AMFDeviceMonitor.pm view on Meta::CPAN
$f->print("</table>");
} else {
if ($ArrayQuery{form} eq "1") {
$f->print('<form action="" method=get>Search device id <input type="text" name="search"><input type="hidden" name="form" value="1"><input type=submit></form>');
}
$f->print("<table>");
$f->print("<tr><td>n.</td><td>device id</td><td>User Agent</td></tr>");
foreach $ua ( sort $cacheSystem->get_keys( 'wurfl-ua' ) )
{
$id =$cacheSystem->restore( 'wurfl-ua', $ua );
if ($ArrayQuery{form} eq "2" && $id eq 'device_not_found'){
$count++;
if ($count > $min - 1 && $count < $max + 1) {
$f->print("<tr><td>$count</td><td>$id</td><td>$ua</td></tr>");
}
}
if ($ArrayQuery{form} eq "1" && $id ne 'device_not_found') {
if ($ArrayQuery{search}) {
if ($id =~ m/$ArrayQuery{search}/i) {
$count++;
if ($count > $min && $count < $max + 1) {
$f->print("<tr><td>$count</td><td><a href=\"?form=3&deviceid=$id\">$id</a></td><td>$ua</td></tr>");
}
}
} else {
$count++;
lib/Apache2/WURFLFilter.pm view on Meta::CPAN
$cachedirectorystore=$ENV{CacheDirectoryStore};
$CommonLib->printLog("CacheDirectoryStore is: $cachedirectorystore");
} else {
$CommonLib->printLog("CacheDirectoryStore not exist. Please set the variable CacheDirectoryStore into httpd.conf, (the directory must be writeable)");
ModPerl::Util::exit();
}
#
# Define the cache system directory
#
my $cacheSystem = new Cache::FileBackend( $cachedirectorystore, 3, 000 );
$cacheSystem->store( 'wurfl-id', 'device_not_found', "id=device_not_found&device=false&device_claims_web_support=true&is_wireless_device=false");
if ($cacheSystem->restore('wurfl-conf','ver')) {
} else {
$CommonLib->printLog('Create new wurf-con store');
$cacheSystem->store('wurfl-conf', 'ver', 'null');
$cacheSystem->store('wurfl-conf', 'caplist', 'null');
$cacheSystem->store('wurfl-conf', 'listall', 'null');
$cacheSystem->store('wurfl-conf', 'RedirectTranscoderUrl','null');
$cacheSystem->store('wurfl-conf', 'MobileVersionUrl','null');
$cacheSystem->store('wurfl-conf', 'FullBrowserUrl','null');
$cacheSystem->store('wurfl-conf', 'ResizeImageDirectory','null');
lib/Apache2/WURFLFilter.pm view on Meta::CPAN
}
$f->pnotes('width' => $ArrayCapFound{max_image_width});
$f->pnotes('height' => $ArrayCapFound{max_image_height});
$f->pnotes('device_claims_web_support' => $ArrayCapFound{device_claims_web_support});
$f->pnotes('is_wireless_device' => $ArrayCapFound{is_wireless_device});
$f->pnotes('is_transcoder' => $ArrayCapFound{is_transcoder});
} else {
#
# unknown device
#
$cacheSystem->store( 'wurfl-ua', $user_agent, "device_not_found");
if ($cookiecachesystem eq "true") {
$f->err_headers_out->set('Set-Cookie' => "amf=device_not_found; path=/;");
}
}
}
$f->subprocess_env("AMF_VER" => $VERSION);
$f->subprocess_env("AMF_WURFLVER" => $WURFLVersion);
return Apache2::Const::DECLINED;
}
1;
__END__
( run in 0.559 second using v1.01-cache-2.11-cpan-9581c071862 )