Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter WURFL API Wrapper Library
#1

[eluser]simonmaddox[/eluser]
I've released my CI WURFL API Wrapper Library, which allows you to take the new WURFL API and access it in CodeIgniter.

If you don't know what WURFL is, see here:
http://wurfl.sourceforge.net/backgroundinfo.php

You use it as follows:
Code:
$this->wurfl->load($this->agent->agent_string()); // You can also pass through a $_SERVER array
$xhtml_make_phone_call_string = $this->wurfl->getCapability('xhtml_make_phone_call_string');

Instructions on how to install, plus downloads, are here:
http://github.com/simonmaddox/codeignite...ree/master

If anyone has bugs, comments, suggestions, please post.
#2

[eluser]holly123[/eluser]
first at all:

hi to all in this forum. i'm new here because i really exited about codeigniter...

now i wanted to build a webpage for mobile phones and tried to use the wurfl-database but it won't work. if i trie to read the device-capabilities there is alway a buffer-overflow..

i copied the wurfl-library in the /applications/libraries - folder
then i copied the wurfl.xml, web_browser_patch.xml and wurfl-config.xml in the /applications/config - folder
and created a folder /applications/config/cache

so, now alway when i try to get the device-capabilities with:
Code:
$this->load->library('wurfl');
$this->wurfl->load($_SERVER['HTTP_USER_AGENT']);
        
$data['jpg_supported'] = $this->wurfl->getCapability('jpg') ? true : false;


i'll get the following error:
Code:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 524377 bytes) in D:\xampp\htdocs\philipp\CodeIgniter_1.7.1\system\application\libraries\WURFL\FileManager.php on line 84


edit: i forgot to post the error-description from codeigniter:
Code:
A PHP Error was encountered

Severity: Notice

Message: Indirect modification of overloaded property WURFL_Xml_ParsingResult::$devicesMap has no effect

Filename: Xml/XMLResourceManager.php

Line Number: 112



my wurfl-config.xml is:

Code:
<wurfl-config>
    <wurfl>
        <main-file>wurfl.xml</main-file>
    </wurfl>
    <persistance>
      <provider>file</provider>
      <params>dir=cache</params>
    </persistance>
    <cache>
      <provider>null</provider>
    </cache>
</wurfl-config>



please help me! - thank you!

best,
holly
#3

[eluser]pistolPete[/eluser]
Code:
Fatal error: Allowed memory size of 33554432 bytes exhausted ...
probably means your memory limit is too low. Try increasing the value of memory_limit in your php.ini.
#4

[eluser]holly123[/eluser]
no, there has to be an other problem..

i had the same effect as i set the memory_limit up to 100MB!!!

why does the wurfl-lib nees so much memory???
#5

[eluser]aruna[/eluser]
[quote author="pistolPete" date="1235938353"]
Code:
Fatal error: Allowed memory size of 33554432 bytes exhausted ...
probably means your memory limit is too low. Try increasing the value of memory_limit in your php.ini.[/quote]


hi ,
even after setting the memory limit in php.in file ...still i m getting the error.please resolve it.....
#6

[eluser]simonmaddox[/eluser]
Hi,

What else are you doing on the page/server? I've got a page looking up 9 phones in WURFL, and it's using just under 8MB.

Try putting this at the top of your code, to make sure the memory limit is actually being set:

Code:
ini_set(’memory_limit’, ‘64M’);

I'm not sure what the CodeIgniter (in fact, I think it's a WURFL API error) error means, but if it's not set up correctly you'll see all sorts of odd errors...

Cheers,

Simon
#7

[eluser]aruna[/eluser]
[quote author="simonmaddox" date="1236730223"]Hi,

What else are you doing on the page/server? I've got a page looking up 9 phones in WURFL, and it's using just under 8MB.

Try putting this at the top of your code, to make sure the memory limit is actually being set:

Code:
ini_set(’memory_limit’, ‘64M’);

I'm not sure what the CodeIgniter (in fact, I think it's a WURFL API error) error means, but if it's not set up correctly you'll see all sorts of odd errors...

Cheers,

Simon[/quote]
thanks,its working now......
#8

[eluser]RaBu[/eluser]
Hi,

I also have some problems, and can't get it to work - I get this error:
Code:
[12-Apr-2009 21:21:54] PHP Fatal error:  Call to a member function getDeviceForUserAgent() on a non-object in /Applications/MAMP/htdocs/sandbox/system/application/libraries/Wurfl.php on line 27
[12-Apr-2009 21:22:03] PHP Fatal error:  WURFL_ClassLoader::require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/Applications/MAMP/htdocs/sandbox/system/application/libraries/WURFL/../WURFL/Xml/ParsingResult.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/sandbox/system/application/libraries/WURFL/ClassLoader.php on line 40

In application/config i have:
wurfl.xml
wurfl_config.xml
web_browsers_patch.xml
cache (read/write able folder)

In application/libraries i have:
Wurfl.php
WURFL (folder with all the contents from http://m.wurflpro.com/~wurfl/php/wurfl-php-1.0.tar.gz)

Hope someone can help me with a pointer in the right direction.
#9

[eluser]RaBu[/eluser]
Okay, now I have tried with only putting the contents from the WURFL folder from http://m.wurflpro.com/~wurfl/php/wurfl-php-1.0.tar.gz, in application/libraries.

But in the WURFLManagerProvider.php file, it makes these calls:
Code:
define('LIB_DIR', dirname(__FILE__).'/../lib');
require_once   (LIB_DIR . '/Log/Log.php');
If I comment these two lines out, I don't get any errors - but then when I call controller in the browser, it just keep loading for ever - it doesn't even timeout...
#10

[eluser]RaBu[/eluser]
Hmm... anybody? Can you please help with a bit more clearly guide to versions, file-structure and the needed modifications necessary to the files?




Theme © iAndrew 2016 - Forum software by © MyBB