[development] Guidance on OS X dev setup

Nik Derewianka nikstar at gmail.com
Wed Apr 29 03:39:28 UTC 2009


Hi all,

Relatively new to drupal + php, but not to programming and would like  
a bit of recommendation in tools to use on OSX for drupal development.

Tools - Textmate/Coda etc or more full blown eclipse, other ??
Recommended ways to debug drupal so that i can see how things work.
Is CVS the only revision control system in use for drupal ?  Any plans  
for a modern CVS/DCVS any time soon ?

Slightly more specific to Services + AMFPHP (yes i will be checking  
out g.d.o soon):

With flex the uid property on a serialised object is reserved for  
flex's tracking of objects so it inevitably clobbers the uid  
properties being returned by the various user objects in drupal.   
Currently the amfphp module gets around this by doing:

/*
  * ugly! ugly! ugly!
  * we need to use a method call wrapper here to convert all 'uid'  
values in the result
  * to 'userid'.  this is because flex uses the property 'uid' in  
objects and will overwrite
  * anything we send with its own value.
  */
function amfphp_method_call($method_name, $args) {

   // convert all userid to uid
   $args = amfphp_fix_uid($args, 0);

   $result = services_method_call($method_name, $args);

   // convert all uid to userid
   $result = amfphp_fix_uid($result);

   return $result;
}

/*
  * ugly! ugly! ugly!
  */
function amfphp_fix_uid($data, $direction = 1) {
   $uid    = 's:3:"uid";';
   $userid = 's:6:"userid";';

   $from = ($direction) ? $uid : $userid;
   $to   = (!$direction) ? $uid : $userid;

   $data = serialize($data);
   $data = str_replace($from, $to, $data);
   $data = unserialize($data);

   return $data;
}

Ideally, it would be better to expose a duplicate property of userid  
in user/node/etc classes instead of the huge refactoring task of  
changing uid to userid etc,  but understandably this may not be the  
ideal solution.  Can anyone recommend a possibly different approach  
than the one taken above ?? (And apologies if this has been already  
discussed elsewhere, kindly point me to it so that i can read up on it).

Thanks,
Nik


More information about the development mailing list