SWIG to create PHP extensions, have you tried this?

I have several small libraries and shells written in C (not C ++) that I would like to make available to PHP through extensions. I have read several tutorials on writing the correct PHP extensions , and this does not seem difficult, however I do not want problems with the continued addition to the libraries.

I read that SWIG supports creating extensions compatible with Zend PHP 5, which is ideal for me. However, support seems to be in beta according to the SWIG documentation.

My libraries are pretty common, as a meta-example use in C:

int main(void)
{
    struct libfoo *foo;

    char **tmp;

    foo = foo_init();
    if (foo == NULL) {
        fprintf(stderr, "Could not allocate foo\n");
        return 1;
     }

     tmp = foo_parse(foo, "/foo/foo.txt");
     ......
     foo_finit(foo);
}

- SWIG, , ? - - , C, SWIG php ?

, . , , SWIG.. , , .

+3
1

Python- C API. SWIG, , API Python C. , , SWIG- .

PHP PHP C , "" C, SWIG, , . , PHP Sara Golemon.

+2

All Articles