perl-freeze like alternative to php_serialize()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arkascha

    perl-freeze like alternative to php_serialize()

    Hi ,
    we are looking for an efficient method to transport array structures from a
    php script to some other engine. Currently we offer phps internal serialize
    function and (if present) the json encoding. For installations where the
    latter is _not_ present we are looking for something else, especially to
    hand over arrays to perl.
    Now there is a perl class living in CPAN that can unserialize php-serialized
    arrays but I wonder if there is some (already existing) way to generate a
    perl-freeze representations from within php ?
    Does anyone have a hint here, or maybe an alternative?

    Thanks, arkascha
  • petersprc

    #2
    Re: perl-freeze like alternative to php_serialize()

    You might store the array as XML, for example:

    Lars Marius Garshol’s XMLWriter class for Python struck me as a particularly elegant solution for generating simple XML documents without having to worry about encoding issues, missing tags and so …


    Perl can load it with XML::Simple:



    On Jul 11, 7:52 am, arkascha <no_spam@no_spa m.orgwrote:
    Hi ,
    we are looking for an efficient method to transport array structures from a
    php script to some other engine. Currently we offer phps internal serialize
    function and (if present) the json encoding. For installations where the
    latter is _not_ present we are looking for something else, especially to
    hand over arrays to perl.
    Now there is a perl class living in CPAN that can unserialize php-serialized
    arrays but I wonder if there is some (already existing) way to generate a
    perl-freeze representations from within php ?
    Does anyone have a hint here, or maybe an alternative?
    >
    Thanks, arkascha

    Comment

    • arkascha

      #3
      Re: perl-freeze like alternative to php_serialize()

      petersprc wrote:
      You might store the array as XML, for example:
      Lars Marius Garshol’s XMLWriter class for Python struck me as a particularly elegant solution for generating simple XML documents without having to worry about encoding issues, missing tags and so …

      Perl can load it with XML::Simple:
      http://articles.techrepublic.com.com...2-5363190.html
      Thanks for the hint, I'll give it a glimpse. I am always a fan of more than
      one possible solution, this adds stability to the general solution...

      Actually I have to admit that we are now using JSON more intense. I realized
      in the meantime that JSON is availible as a PECL extension that's quite
      easy to install. Works like charm :-)
      On Jul 11, 7:52 am, arkascha <no_spam@no_spa m.orgwrote:
      >Hi ,
      >we are looking for an efficient method to transport array structures from
      >a php script to some other engine. Currently we offer phps internal
      >serialize function and (if present) the json encoding. For installations
      >where the latter is _not_ present we are looking for something else,
      >especially to hand over arrays to perl.
      >Now there is a perl class living in CPAN that can unserialize
      >php-serialized arrays but I wonder if there is some (already existing)
      >way to generate a perl-freeze representations from within php ?
      >Does anyone have a hint here, or maybe an alternative?

      Comment

      Working...