Minutes back I read something like "it should be possible to link the C++ library as a php extension".
Is it really possible?
if yes, which is better, newly written extension or a linked library (efforts and performance wise).
Also can you guys point me to some How-to or related doc.
Yes it is, check these out:
http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/
How to start writing a PHP5 extension in C++
The following link will probably answer all your questions. Basically yes, it's possible to link C++ lib as PHP extension.
Related
I have C++ library that I would like to use to create a PHP extension.
I don't have anything besides the compiled DLL file.
I would just like to know if this is possible or does it need to be a C library?
Yes, You can build extension using C++ libraries.
There is a very good example describing the process here : http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/
Can I program the Peripheral Interface Controller (PIC) using PHP language?
I searched many websites and they didn't mention any clues. I hope someone here can help me.
Yes and no, depending on what you understand by "using" PHP.
If you want to use stock PHP installation, then no, there is no such way. However, you can create your own PHP extension in for example C language. This way, you can import anything the underlying system offers into PHP.
The short answer is no. The PHP interpreter would be too heavy weight for the limitations of a PIC processor.
You could convert your PHP to c/c++ with something like HipHop, but your PHP code would not be able to access any of the registers or input/output pins.
Now the long answer is that you could create a PHP extension to support the PIC and then cross-compile that to the PIC. That would be a pretty cool project.
I have a C dll containing functions and enumerations I want to make accessible from php.
How can I do it?
You need to write an extension. You do need some C experience but this tutorial is pretty easy to follow.
edit I googled around out of curiosity, apparently you can sort-of dynamically load a dll from php using w32api. I'd still go for the extension ;-)
i know there is a convert -swirl effect in imagemagick but can i create other effects for text like curved, arched, wedged, pinched etc.. just like wordart in word.
i am open to other packages that might help me get this thing done.. php or ruby..
Here are some examples: http://www.fmwconcepts.com/imagemagick/texteffect/index.php
If you are interested, you can run this shell script through php exec() function or any other language which provide you with such an ability.
Check out RMagick, which is a Ruby interface to the ImageMagick library.
There are interfaces for many other languages as well, including PHP.
Look here for an overview.
As Lars suggested, RMagick is a good choice for doing it in RoR. If you're looking in PHP, I'm not sure that it can do some of the things you're wanting to, but GD2 (which is usually natively included with PHP if you installed PHP with a package manager) is a good tool. There is also a PHP extension for ImageMagick.
hi i am new in php,i made the whole code in c++ and want to use this code in php.so i made dll to my code for using it.but i am not able to use this dll in php ,can anybody send me the complete code to use php,c++ extensions.
There's a whole section about some php internals and how to write/build a php extension in the online manual at http://php.net/internals2, and I especially want to point out the description of the ext_skel script there as it helps you to set up a new "empty" extension project.
And there are alos tools like SWIG that help you to wrap existing libraries into extensions for numerous languages including PHP.
I made a PHP extension in C++ using SWIG. The PHP specific documentation can be found here.
Since very few online documentation is avaible on using the Zend API I also recommend the book Extending and Embedding PHP.