I need to get the memory usage of the current process in C. Can someone offer a code sample of how to do this on a Linux platform?
I'm aware of the cat /proc/<your pid>/status method of getting memory usage, but I have no idea how to capture that in C.
BTW, it's for a PHP extension I'm modifying (granted, I'm a C newbie). If there are ...
What DB extension PHP has (mysqli, PDO etc) is the best for enterprise level application?
The important features that comes to my mind are:
under active maintenance
A lot of documentation and examples.
Probably endorsed by the Mysql people themselves.
Robust
scalable
...
I opened php_sqlite.dll & php_sockets.dll using Depends.exe. I saw only 1 function in both: get_module
How can I export all functions in extension to dll files when compiling the .dll? AFAIK, ZEND_FUNCTION is used to declare functions in the modules. Please kindly advise. Thank you very much!
...
I am thinking of writing a PHP extension library that will use the memcached library. It is trivial to simply link my library to the memcache shlib.
However, I am not sure what will happen if my (extension library) user already uses memcache on his/her website. My questions are:
Is it possible to have (possibly different versions) of...
I am using VC 2008 express, and tried to compile my own PHP extension with that. Any idea about the following error?
------ Rebuild All started: Project: xsplit, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'xsplit', configuration 'Debug|Win32'
Compiling...
xsplit.cpp
c:\x\php-5.3.1\zend\zend_exec...
I need this library http://svn.arabeyes.org/viewvc/projects/itl/ports/php/. It is a php extension, and I want to know how I can use this.
Do I need to compile this, and if so, how can I compile it? I've never compiled anything .. I need it to work for both Windows and Linux.
...
I compiled some PHP extention libs (in C/C++) a while back, on my XP platform. I have now moved the sources to my Ubuntu box, and want to build the libs for use on my Linux box.
However, I have come accross a number of obstacles:
I cant locate phpize (even after installing the php5dev package)
I cant find ext_skel to generate the skel...
I need to list all PHP extensions that's required by a given code base.
What would be the best way to tackle this problem?
My initial thought is to write a script that goes through all files and find all functions and compare them to a given extension/function database. Any other suggestions?
Update: I already did some Bash script w...
Hi guys, I am new in this area of writing extension for PHP, however I need to create a wrapper class for C++ to PHP. I am currently using PHP 5.2.13. I read this article http://devzone.zend.com/article/4486-Wrapping-C-Classes-in-a-PHP-Extension, a tutorial on how I could proceed to wrap C++ class to communicate with PHP Zend however it ...
What are first steps creating a loadable DLL module extension for PHP to create native support for my own library on Windows?
Would it require re-compiling PHP on windows? What are the tools needed? I don't want to have to use exec and the command line.
...
I would like to know how to create a php function that can be installed in php
just like the already built in functions like :
rename
copy
The main point I would like to achieve is a simple php function that can be called from ANY php page on the whole host without needing to have a php function within the php page / needing an inc...
I need to learn how to develop PHP extensions.
So, I assume I have to refresh my CPP skills (or is it C?).
What IDE should I use (auto-completion, object browsers etc). I plan to develop on Ubuntu 32.
Is there a good book or good website I can learn from?
...
I have a suite of PHPUnit tests for my extension, and I want to run them as part of the extension's Hudson build process.
So I want to run PHPUnit specifying the extension library to load at runtime, but I can't figure out how to do this.
My directory structure is as follows:
/myextension.c
/otherextensionfiles.*
/modules/myextension....
Hi guys,
I am developing a php extension that require the use of opengl. I tried to initialize the library with glutinit; it works in CLI environment but when I tried on browser it doesn't seem to execute the code.
The code is actually executed on the server side. It is part of a process to extract features from an image, and the serv...
I have a C++ object, Graph, which contains a property named cat of type Category. I'm exposing the Graph object to PHP in an extension I'm writing in C++.
As long as the Graph's methods return primitives like boolean or long, I can use the Zend RETURN_*() macros (e.g. RETURN_TRUE(); or RETURN_LONG(123);. But how can I make
Graph->ge...
Hi, I've been tasked to create a PHP app which accesses an existing PostgreSQL database. This is my first time working with Postgre, not to mention the PHP has already been installed in the Linux box on which the app is supposed to run. I have no experience setting up this stuff, I just code.
My question is that I can't seem to get the ...
This new language called Vala, which is said to be C#-like and supposedly easier than C++ or C, compiles down into C on Linux with the GCC compiler.
Sounds great. Now I want to use it to make a PHP extension module so that slow PHP code can be made in Vala and imported into PHP as a function.
How do I accomplish this in Vala? Is it eve...
In PHP 5.3 is there a way to rename a function or "hook" a function.
There is the rename_function() within "APD" which has been broken since ~2004. If you try and build it on PHP 5.3 you'll get this error:
'struct _zend_compiler_globals' has no member named 'extended_info'
This is a really easy error to fix, just change this line:
...
I need to have my PHP extension return an array of objects, but I can't seem to figure out how to do this.
I have a Graph object written in C++. Graph.getNodes() returns a std::map<int, Node*>. Here's the code I have currently:
struct node_object {
zend_object std;
Node *node;
};
zend_class_entry *node_ce;
then
PH...
I have written some C/C++ extension modules for PHP, using the 'old fashioned way' - i.e. by using the manual way (as described by Sarah Golemon in her book).
This is too fiddly for me, and since I am lazy, and would like to automate as much as possible. Also, I have used SWIG now to generate extensions to Python, and I am getting to li...