Daily Archives: May 31, 2012

Cpanel email add forwarder missing 1

I setup a new site and added a few email accounts this evening. In Cpanel, I clicked add forwarder and for some reason I could only select “add domain fowarder”, which is not what I wanted to do. The ability to add an email fowarder was not there. The solution is to go into WHM and click “Feature Manager”, then “Edit a feature list”, and select “disabled” from the drop down box. Find the function named “forwarder manager” and check the checkbox, then click the save button. If you don’t have access to WHM then you’ll need to contact your hosting provider and have them do it.

Doctrine 1.2 on duplicate key update

Doctrine 1.2 doesn’t provide a way to do “on duplicate key update” query unless you do raw sql. However, they do provide a “replace” method that will get the job done. Your table will need a unique key or unique index on multiple columns for this to work, just like on duplicate key update. The different is that replace will delete the existing record and then insert a new one if the key is already found, so this might cause trouble if the table has an auto increment key.

Here is an example on how to use doctrine’s replace method

$obj = new Obj();
$obj->content_uuid = $content_uuid;
$obj->file_id = $fileId;
$obj->sort_order = $sortOrder;