[imp] IMAP ACLs [PATCH]

Chuck Hagenbuch chuck at horde.org
Tue Feb 4 16:58:55 PST 2003


Quoting Nick Loman <nick at loman.net>:

> They do different things. A string in double quotes will have certain
> control characters expanded (namely those starting with a \, like your \W
> whereas a string in single quotes won't.

*sigh*

Chris, I was going to let it pass, but I pasted your *exact* code block and
just fixed the spacing. You had two arguments to addslashes().

Nick, \W is not a control character as far as PHP is concerned. It's a
regexp metacharacter. Pasted from Horde's PHP Shell:

PHP Code:

var_dump(preg_match('/\W/', 'foo bar', $regs));
var_dump($regs);

var_dump(preg_match("/\W/", 'foo bar', $regs));
var_dump($regs);

Result:

int(1)
array(1) {
  [0]=>
  string(1) " "
}
int(1)
array(1) {
  [0]=>
  string(1) " "
}

Chris, here are just a few pieces of docs/CODING_STANDARDS that are
relevant. Note that all of this was a big mess in the imp/lib/ACL code, as well:

------------------
[3] Function Calls
==================

Functions should be called with no spaces between the function name,
the opening parenthesis, and the first parameter; spaces between commas
and each parameter, and no space between the last parameter, the
closing parenthesis, and the semicolon. Here's an example:

  $var = foo($bar, $baz, $quux);

As displayed above, there should be one space on either side of an
equals sign used to assign the return value of a function to a
variable. In the case of a block of related assignments, more space
may be inserted to promote readability:

  $short         = foo($bar);
  $long_variable = foo($baz);


------------------------
[4] Function Definitions
========================

Function declaractions follow the "one true brace" convention:

  function fooFunction($arg1, $arg2 = '')
  {
      if (condition) {
          statement;
      }
      return $val;
  }

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
must ... find ... acorns ... *thud*


More information about the imp mailing list