Skip to content

Commit

Permalink
Merge pull request #6 from bertrandom/master
Browse files Browse the repository at this point in the history
This will fix an issue where AWSResponse throws notices like Notice: Use of undefined constant STATE_BODY - assumed 'STATE_BODY' in
  • Loading branch information
jmhobbs committed Jul 28, 2011
2 parents 157c66d + f4cc47a commit 43abba9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions AWSTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,20 @@ class AWSResponse {
const STATE_HEADERS = 1;
const STATE_BODY = 2;

protected $state = STATE_EMPTY;
protected $state = self::STATE_EMPTY;

public function line ( $line ) {

switch( $this->state ) {
case STATE_EMPTY:
case self::STATE_EMPTY:
$split = explode( ' ', $line );
$this->code = $split[1];
$this->message = implode( array_slice( $split, 2 ), ' ' );
$this->state = STATE_HEADERS;
$this->state = self::STATE_HEADERS;
break;
case STATE_HEADERS:
case self::STATE_HEADERS:
if( "\r\n" == $line ) {
$this->state = STATE_BODY;
$this->state = self::STATE_BODY;
break;
}

Expand All @@ -241,7 +241,7 @@ public function line ( $line ) {
$key = substr( $line, 0, $pos );
$this->headers[$key] = substr( $line, $pos );
break;
case STATE_BODY:
case self::STATE_BODY:
$this->body .= $line;
break;
}
Expand Down

0 comments on commit 43abba9

Please sign in to comment.