Search

This extension requires PHP 5.3

Thanks ! I can get that resolved :)

might be good to throw on the extension page and git rep as a prereq

Has anyone re-written this extension to work with PHP 5.2? (Unfortunatley I have a website running on a managed server with PHP 5.2)

Am I right in thinking that once installed and enabled this extension should place a 'device' node in all pages' output XML?

I'm trying it in Symphony 2.2.1 (PHP 5.3.3-1ubuntu9.5 with Suhosin-Patch on local dev machine) and I'm not getting any extra XML.

Am I right in thinking that once installed and enabled this extension should place a 'device' node in all pages' output XML?

Not quite. You still need to add the DS to the pages you want it on.

How embarrassing! Thanks. :-)

Is there an earlier build of this extension that is available to work with 2.0.4 release? It says it works for all versions of Symphony 2 but the Github repo states 2.1 and above to use it?

If you look back through the commit history there is a version that probably would've been compatible with 2.0.4. It was a significantly more limited version of the extension though, so your mileage may vary.

Dont need any redirect stuff.. just User Agent string in my XMl, I'll take a look, thanks.

Dont need any redirect stuff.. just User Agent string in my XMl, I'll take a look, thanks

If that's all you need then the Global Parameter Loader can dump the UA string from the $_SERVER array.

Ahhh cool. That's already installed as well! cheers Nick.

I'd need some regexp to grab the OS part of the array into the Global Parameter field right?

Yes, if you need specific portions of the UA string ten you'll need to parse it. In which case the mobile detection extension is your better bet as it probably does this for you! Sorry, I thought you needed something much more simple.

Mobile Device Detection updated to version 1.2 on 29th of August 2011

Adds PHP 5.2 compatibility courtesy of Rowan.

Thank you Rowan and Makenosound! I'm planning to change my hosting around so I should have PHP 5.3 at some stage, but until then I can now use this.

All cred to Rowan — glad it'll help you out in the interim.

Could it be that this extension doesn't play nicely with the Language Redirect Extension?

Anyone have luck on this with 5.2? There was a note that PHP5.2 was supported thanks to contrib from Rowan (Thanks Rowan!, you have no idea what a help that will be), however, latest download throws error in class.mobiledevice.php.

The hosting company does not have 5.3 installed and that is apparently not an option at this time.

In PHP 5.2: Parse error: syntax error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /home/plantco/public_html/e/extensions/mobiledevicedetection/libs/class.mobiledevice.php on line 7

Line 7:

if (!isset(static::$instance)) {

Hi Davlun/David

You can try the following if you're in hurry to get it working. I happened to be working on this today as I was getting the same error. I managed to get it working as expected by doing the following, but it's not 100% tested. So use at your own risk ;)

Replace (lines 4-13):

static public function instance($class) {
            if (!isset($class::$instance)) {
                $class::$instance = new $class();
                $class::$instance->initialize();

                MobileDetector::registerDevice($class::$instance);
            }

            return $class::$instance;
        }

With:

      static public function instance($class) {
            if (!isset($class->$instance)) {
                $instance = new $class();
                $instance->initialize();
                MobileDetector::registerDevice($instance);
            }

            return $instance;
        }

Replace (lines 56-58)

      public function allow() {
        $this->allows = array_merge($this->allows, func_get_args());
    }

With:

public function allow() {
            $func_args=func_get_args();
            $this->allows = array_merge($this->allows, $func_args);
        }

Replace (lines 60-62)

public function deny() {
            $this->denies = array_merge($this->denies, func_get_args());
        }

With:

public function deny() {
        $func_args=func_get_args();
        $this->denies = array_merge($this->denies, $func_args);
    }

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details