php5.3

Is Doctrine2 compatible with PHP 5.3 up?

It seems doctrine 2 is compatible only with PHP 5.3 and up, and is NOT compatible with php versions before 5.3. Can someone confirm if this is true? ...

Strange MySQL error "Empty row packet body" when using mysql_fetch_object (PHP 5.3.3)

Hi to all, i get a really strange, pointless and totally random error when i fetch rows from a resource (query) using PHP. My development machine is a Windows XP SP3 with Apache 2.2 while MySQL runs on a virtual machine, using ubuntu 10.04, with 768mb of ram, 100gb of hdd and 4 logic cores (intel q6600). However this problem is not rel...

PHP 5.2 and 5.3 together

I have XAMPP with PHP 5.2, but my new projects need PHP 5.3 How to have PHP 5.2 and 5.3 together? I have winXP. ...

in php - how to access the Folders which are out side the Web root Directory

How can we access the Folders out side the Web root Directory? We are using WAMPSERVER 2.0(Apache 2.2.11,php 5.3.0 & My Sql 5.1.36 ) please Help me out ...

Processid (PID) reuse problem with xCode

I have a large custom CMS and I use xcode to run a profiler to get debug information. So, I perform different functions in my CMS and "HOPE" to get ALL information via xDebug. Lets say I perform two functions: 1. Load a listing of users 2. Deleted a user 2.1 Calls an AJAX script to delete user. Now, due to the process id reuse...

How can I track user visit in my website?

How can I track user visit in my website? ...

PHP and Unicode: Weirdness between Windows and Linux.

Look at IBM's Unicode for the working PHP programmer, especially listings 3 and 4. On Ubuntu Lucid I get the same output from the code as IBM does, viz: Здравсствуйте Array ( [1] => 65279 [2] => 1047 [3] => 1076 [4] => 1088 [5] => 1072 [6] => 1074 [7] => 1089 [8] => 1089 [9] => 1090 [10] => 1074...

Self Executing functions in PHP5.3?

I was trying to borrow some programing paradigms from JS to PHP (just for fun). Is there a way of doing: $a = (function(){ return 'a'; })(); I was thinking that with the combination of use this can be a nice way to hide variables JS style $a = (function(){ $hidden = 'a'; return function($new) use (&$hidden){ $hidden...

PHP anonymous function before 5.3 - array_walk

Hi, I need some help here.. Is it possible to use PHP array_walk with an anonymous function (before PHP 5.3)? or some workaround.. I'm using array_walk inside a public class method and I don't want to define a PHP function.. I want to do something like: array_walk($array, function($value) {...}); If that's not possible is it possibl...

2 php.ini files

Hi, I have found that: When I type the following on terminal: php -i | grep php.ini I get the output: The Loaded Configuration file is @ /etc/php5/cli/php.ini However, from phpinfo(), I get to see: The loaded ini file is @ /etc/php5/apache2/php.ini Which one of these is working right now ? How is it possible to have 2 INI fil...

PHP static::DerivedClassName

Is there any way to get the Derived Class Name from static Keyword ? What I actually want to do is. Make a Reflection of the Derived Class Check Wheather it implements the Specified Class or not I've a static method the Base Class say its named Base::check() I want Base::check() will check for the existence of the Interface Implementat...

PHPUnit: "Invalid value passed to setPost()" when passing Zend_Db_Table_Row_Abstract converted using toArray()

The following code fails throws a Zend_Controller_Exception ("Invalid value passed to setPost(); must be either array of values or key/value pair") /** Model_Audit_Luminaire */ $luminaireModel = new Model_Audit_Luminaire(); if (!$fixture = $luminaireModel->getScheduleItem($scheduleId)) { $this->fail('Could not retrieve fixture from ...

Hudson failing build w/o revealing cause

Every build has failed as of Tuesday. I'm not exactly sure what happened. The Phing targets (clean/prepare) are being executed properly. Additionally, the unit tests are passing with flying colors, with only a warning for duplicate code (not a reason for a fail). I tried removing the phpDoc target to see if that was causing the error...

Store Open/Close Times and DST Changes

I've been stuck on this for two days and have gotten no where. I tend to think future and the future problems that will come around. My server's time is set to UTC and linux box is fully updated with the timezones as well as the data is in my database. I'll explain my system for the best answer. This site sells "items" but can only s...

Recommended Solutions for Creating a Callback that Chains Multiple Methods and/or Properties ?

We are working on a Builder type interface that basically constructs a list for doing CRUD management of individual objects (since we're using ActiveRecord an object == a database record). In order to make specifying the column values and parameters for list options flexible we originally implemented the callback arguments as an array t...

PHPUnit code coverage generation causing memory exhaustion

I'm currently using Zend Framework in conjunction with PHPUnit to conduct unit testing on an application. When Hudson executes the PHPUnit shell command, the maximum PHP memory limit is reached sometime during code coverage generation. I currently have a total of 41 tests with 334 assertions. I have successfully eliminated this error ...

Compiling PHP, are these errors ok? (Linux-Debian-PHP5.3.3)

Are these ok? My config line is this: ./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --without-sqlite --disable-pdo --disable-reflection --with-curl --with-mysqli=/usr/bin/mysql_config And the...

php5 and namespace?

Hei all. i work a lot in PHP5 but i never relly understand the namespace method in PHP can sombady help me here? i have read on php.net's website its not expalde good enof, and i can't find eks. on it. i need to know how i can make code in sample version. namespace: sample class: sample_class_1 function: test_func_1 class: sample_...

Download File to server from URL

Well, this one seems quite simple, and it is. All you have to do to download a file to your server is: file_put_contents("Tmpfile.zip", file_get_contents("http://someurl/file.zip")); Only there is one problem. What if you have a large file, like 100mb. Then, you will run out of memory, and not be able to download the file. What I wan...

How do you pull beans related by foreign keys in RedBeanPHP?

I'm using RedBean PHP ORM 1.2 with Zend and Mysql for a new project. I'm still in the process of learning it and it works very well for many scenarios, except i cant find how to load beans related by foreign keys. Allow me to explain. I have two tables; members and feeds. Each 'feed' is linked via a foreign key (in MySQL) to a member. T...