Communication between Python and PHP

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

    Communication between Python and PHP

    Don't ask me why, but we have a bunch of legacy code in PHP on a
    server and a wee-bit of Python code for integrating GData google
    calendar services. We now need to build a way of sending messages
    between them. The general flow is:

    PHP Web Page(on apache) ---Python Gdata Consumer -----Gdata
    and then json is returned back like:
    PHP Web Page<----json data---- Pthon Gdata Consumer

    So I tried to convince my boss to let me use the python c extension to
    write a native bridge but 'no dice'. He also does not want anything
    'experimental' so pyphp is out. He'd like me to basically have them
    communicate by passing the json via http/apache - so in essence, I'll
    have to make (what I feel) are very expensive calls between two
    objects that, in a perfect world, would be on the same machine in the
    same language! I see this as a potential bottleneck. Any suggestions?
    I have to start prototyping this today so the sooner the better, um,
    please ;) Thanks gurus out there.
  • Larry Bates

    #2
    Re: Communication between Python and PHP

    nicodotti2 wrote:
    Don't ask me why, but we have a bunch of legacy code in PHP on a
    server and a wee-bit of Python code for integrating GData google
    calendar services. We now need to build a way of sending messages
    between them. The general flow is:
    >
    PHP Web Page(on apache) ---Python Gdata Consumer -----Gdata
    and then json is returned back like:
    PHP Web Page<----json data---- Pthon Gdata Consumer
    >
    So I tried to convince my boss to let me use the python c extension to
    write a native bridge but 'no dice'. He also does not want anything
    'experimental' so pyphp is out. He'd like me to basically have them
    communicate by passing the json via http/apache - so in essence, I'll
    have to make (what I feel) are very expensive calls between two
    objects that, in a perfect world, would be on the same machine in the
    same language! I see this as a potential bottleneck. Any suggestions?
    I have to start prototyping this today so the sooner the better, um,
    please ;) Thanks gurus out there.
    Use sockets. They are efficient and both languages have good implementations .

    -Larry

    Comment

    • nicodotti2

      #3
      Re: Communication between Python and PHP

      On Jun 25, 1:50 pm, Larry Bates <larry.ba...@we bsafe.com`wrote :
      nicodotti2 wrote:
      Don't ask me why, but we have a bunch of legacy code in PHP on a
      server and a wee-bit of Python code for integrating GData google
      calendar services. We now need to build a way of sending messages
      between them. The general flow is:
      >
      PHP Web Page(on apache) ---Python Gdata Consumer -----Gdata
      and then json is returned back like:
      PHP Web Page<----json data---- Pthon Gdata Consumer
      >
      So I tried to convince my boss to let me use the python c extension to
      write a native bridge but 'no dice'. He also does not want anything
      'experimental' so pyphp is out. He'd like me to basically have them
      communicate by passing the json via http/apache - so in essence, I'll
      have to make (what I feel) are very expensive calls between two
      objects that, in a perfect world, would be on the same machine in the
      same language! I see this as a potential bottleneck. Any suggestions?
      I have to start prototyping this today so the sooner the better, um,
      please ;) Thanks gurus out there.
      >
      Use sockets. They are efficient and both languages have good implementations .
      >
      -Larry
      Thanks Larry I'll look into going that route.

      Comment

      • nicodotti2

        #4
        Re: Communication between Python and PHP

        On Jun 25, 1:50 pm, Larry Bates <larry.ba...@we bsafe.com`wrote :
        nicodotti2 wrote:
        Don't ask me why, but we have a bunch of legacy code in PHP on a
        server and a wee-bit of Python code for integrating GData google
        calendar services. We now need to build a way of sending messages
        between them. The general flow is:
        >
        PHP Web Page(on apache) ---Python Gdata Consumer -----Gdata
        and then json is returned back like:
        PHP Web Page<----json data---- Pthon Gdata Consumer
        >
        So I tried to convince my boss to let me use the python c extension to
        write a native bridge but 'no dice'. He also does not want anything
        'experimental' so pyphp is out. He'd like me to basically have them
        communicate by passing the json via http/apache - so in essence, I'll
        have to make (what I feel) are very expensive calls between two
        objects that, in a perfect world, would be on the same machine in the
        same language! I see this as a potential bottleneck. Any suggestions?
        I have to start prototyping this today so the sooner the better, um,
        please ;) Thanks gurus out there.
        >
        Use sockets. They are efficient and both languages have good implementations .
        >
        -Larry
        Thanks Larry I'll look into going that route.

        Comment

        • askel

          #5
          Re: Communication between Python and PHP

          On Jun 25, 6:59 pm, nicodotti2 <nicodot...@gma il.comwrote:
          On Jun 25, 1:50 pm, Larry Bates <larry.ba...@we bsafe.com`wrote :
          >
          >
          >
          nicodotti2 wrote:
          Don't ask me why, but we have a bunch of legacy code in PHP on a
          server and a wee-bit of Python code for integrating GData google
          calendar services. We now need to build a way of sending messages
          between them. The general flow is:
          >
          PHP Web Page(on apache) ---Python Gdata Consumer -----Gdata
          and then json is returned back like:
          PHP Web Page<----json data---- Pthon Gdata Consumer
          >
          So I tried to convince my boss to let me use the python c extension to
          write a native bridge but 'no dice'. He also does not want anything
          'experimental' so pyphp is out. He'd like me to basically have them
          communicate by passing the json via http/apache - so in essence, I'll
          have to make (what I feel) are very expensive calls between two
          objects that, in a perfect world, would be on the same machine in the
          same language! I see this as a potential bottleneck. Any suggestions?
          I have to start prototyping this today so the sooner the better, um,
          please ;) Thanks gurus out there.
          >
          Use sockets. They are efficient and both languages have good implementations .
          >
          -Larry
          >
          Thanks Larry I'll look into going that route.
          I wouldn't even try to reinvent the wheel in such a case. You are
          going to use GData and yet consider HTTP over LAN to be expensive. Get
          real, man. Save yourself a time by not developing and supporting your
          own very special wheel. Your boss is not that stupid as he probably
          seems to you.

          Comment

          Working...