By request, a quick post on using PHP references in extensions. To start, here’s an example of references in PHP we’ll be translating into C: This will print: x is 1 called not_by_ref(1) x is 1 called by_ref(1) x is 3 If you want your C extension’s function to officially have a signature with ampersandsContinue reading “More PHP Internals: References”
Tag Archives: PHP
Mongo Mailbag #2: Updating GridFS Files
Welcome to week two of Mongo Mailbag, where I take a question from the Mongo mailing list and answer it in more detail. If you have a question you’d like to see answered in excruciating detail, feel free to email it to me. Is it possible (with the PHP driver) to storeBytes into GridFS (forContinue reading “Mongo Mailbag #2: Updating GridFS Files”
Mongo Mailbag: Master/Slave Configuration
Trying something new: each week, I’ll take an interesting question from the MongoDB mailing list and answer it in more depth. Some of the replies on the list are a bit short, given that the developers are trying to, you know, develop (as well as answer over a thousand questions a month). So, I’m goingContinue reading “Mongo Mailbag: Master/Slave Configuration”
PHP Extension Wiki
I started a wiki on this site (http://www.kchodorow.com/php) to write down all the stuff I learn about writiing PHP extensions. If anyone else has experience with them, feel free to add or edit articles. Some basics: a PHP extension is written in C. In fact, PHP itself is written in C, so there’s a lotContinue reading “PHP Extension Wiki”
Got Mongo Working on Hostmonster!
This was written in April of 2009. It is very out of date. See http://rcrisman.net/article/11/installing-mongodb-on-hostmonster-bluehost-accounts for more up-to-date information (as of August 2010). Keep in mind that shared hosting with Hostmonster is very lame. They only lets you run a program for 5 minutes before killing it, so it’s fairly useless to install MongoDB unlessContinue reading “Got Mongo Working on Hostmonster!”
phpdoc hell
I’ve been fighting with phpdoc for about a week now, trying to figure out how to document my extension, which is a combination of PHP and C code. I finally figured it out, and since I haven’t seen this documented anywhere, I figured I’d reproduce the steps here: Download phpdoc from CVS. No! Not PEAR,Continue reading “phpdoc hell”
Pain in my CVS
This is pretty geeky, so sorry non-technical reader. There’s a glossary at the bottom if you’d like to follow along. I’ve been developing a PHP database driver for work, and this week I proposed it as a new PECL (pronounced “pickle”) package. Unfortunately, they use CVS for their packages. I’m used to Git. So, IContinue reading “Pain in my CVS”