public function headers() {
    $headers = array();
    $readers = array();
    $writers = array();

    // Create the rule strings. We need two copies, one for READ and
    // one for WRITE.
    foreach ($this->rules as $rule) {
      // We generate read and write rules separately so that the
      // generation logic has a chance to respond to the differences
      // allowances for READ and WRITE ACLs.
      if (self::READ & $rule['mask']) {
        $ruleStr = $this->ruleToString(self::READ, $rule);
        if (!empty($ruleStr)) {
          $readers[] = $ruleStr;
        }
      }
      if (self::WRITE & $rule['mask']) {
        $ruleStr = $this->ruleToString(self::WRITE, $rule);
        if (!empty($ruleStr)) {
          $writers[] = $ruleStr;
        }
      }
    }

    // Create the HTTP headers.
    if (!empty($readers)) {
      $headers[self::HEADER_READ] = implode(',', $readers);
    }
    if (!empty($writers)) {
      $headers[self::HEADER_WRITE] = implode(',', $writers);
    }

    return $headers;
  }
public function headers() {
    $headers = array();
    $readers = array();
    $writers = array();

    // Create the rule strings. We need two copies, one for READ and
    // one for WRITE.
    foreach ($this->rules as $rule) {
      // We generate read and write rules separately so that the
      // generation logic has a chance to respond to the differences
      // allowances for READ and WRITE ACLs.
      if (self::READ & $rule['mask']) {
        $ruleStr = $this->ruleToString(self::READ, $rule);
        if (!empty($ruleStr)) {
          $readers[] = $ruleStr;
        }
      }
      if (self::WRITE & $rule['mask']) {
        $ruleStr = $this->ruleToString(self::WRITE, $rule);
        if (!empty($ruleStr)) {
          $writers[] = $ruleStr;
        }
      }
    }

    // Create the HTTP headers.
    if (!empty($readers)) {
      $headers[self::HEADER_READ] = implode(',', $readers);
    }
    if (!empty($writers)) {
      $headers[self::HEADER_WRITE] = implode(',', $writers);
    }

    return $headers;
  }
public function headers ( ) { $ headers = array ( ) ; $ readers = array ( ) ; $ writers = array ( ) ; // Create the rule strings. We need two copies, one for READ and // one for WRITE. foreach ( $ this -> rules as $ rule ) { // We generate read and write rules separately so that the // generation logic has a chance to respond to the differences // allowances for READ and WRITE ACLs. if ( self :: READ & $ rule [ 'mask' ] ) { $ ruleStr = $ this -> ruleToString ( self :: READ , $ rule ) ; if ( ! empty ( $ ruleStr ) ) { $ readers [ ] = $ ruleStr ; } } if ( self :: WRITE & $ rule [ 'mask' ] ) { $ ruleStr = $ this -> ruleToString ( self :: WRITE , $ rule ) ; if ( ! empty ( $ ruleStr ) ) { $ writers [ ] = $ ruleStr ; } } } // Create the HTTP headers. if ( ! empty ( $ readers ) ) { $ headers [ self :: HEADER_READ ] = implode ( ',' , $ readers ) ; } if ( ! empty ( $ writers ) ) { $ headers [ self :: HEADER_WRITE ] = implode ( ',' , $ writers ) ; } return $ headers ; }
Generate HTTP headers for this ACL.

If this is called on an empty object, an empty set of headers is
returned.
Generate HTTP headers for this ACL .