Skip to content

Commit

Permalink
#6 migrate Autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
Bui Sy Nguyen committed May 2, 2016
1 parent 2ada650 commit 70ff280
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions fproject/amf/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
use fproject\amf\auth\AuthResult;

/**
* An AMF gateway server implementation to allow the connection of the Adobe Flash Player to
* Zend Framework
* An AMF gateway server implementation to allow the connection of the Adobe Flash Player/Adobe AIR to PHP server sites
*
* @todo Make the reflection methods cache and autoload.
*/
Expand Down
4 changes: 2 additions & 2 deletions fproject/amf/loader/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class Autoloader
* @var array Supported namespaces 'Zend' and 'ZendX' by default.
*/
protected $_namespaces = array(
'Zend_' => true,
'ZendX_' => true,
//'Zend_' => true,
//'ZendX_' => true,
);

/**
Expand Down
2 changes: 1 addition & 1 deletion fproject/amf/parse/AbstractParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractParser
* @param array $params
* @throws \fproject\amf\AmfException
*/
protected function throwZendException($message, $params=[])
protected function throwAmfException($message, $params=[])
{
for($i=0; $i<count($params); $i++)
{
Expand Down
10 changes: 5 additions & 5 deletions fproject/amf/parse/Amf3Deserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function readTypeMarker($typeMarker = null)
return $this->readVector($typeMarker);
//case Constants::AMF3_DICTIONARY:
default:
$this->throwZendException('Unsupported type marker: {0}',[$typeMarker]);
$this->throwAmfException('Unsupported type marker: {0}',[$typeMarker]);
return 0;//To avoid PHP warning
}
}
Expand Down Expand Up @@ -176,7 +176,7 @@ public function readString()
// reference string
$stringReference = $stringReference >> 1;
if ($stringReference >= count($this->_referenceStrings)) {
$this->throwZendException('Undefined string reference: {0}',[$stringReference]);
$this->throwAmfException('Undefined string reference: {0}',[$stringReference]);
}
// reference string found
return $this->_referenceStrings[$stringReference];
Expand Down Expand Up @@ -295,7 +295,7 @@ public function readVector($type)
return $this->readObjectVector($len, $fixed);
default:
// Unknown vector type tag {type}
$this->throwZendException('Undefined vector type: {0}',[$type]);
$this->throwAmfException('Undefined vector type: {0}',[$type]);
}

return $this->readNumericVector($len, $fixed, $eltSize, $numberFormat);
Expand Down Expand Up @@ -496,7 +496,7 @@ protected function createObjectInstance($className)
else
{
//user defined typed object
$this->throwZendException('Typed object not found: {0}',[$className]);
$this->throwAmfException('Typed object not found: {0}',[$className]);
}
}
return ['object' => $returnObject, 'className' => $className];
Expand Down Expand Up @@ -556,7 +556,7 @@ private function getReferenceObject($refMarker)
if (($refMarker & 0x01) == 0) {
$refMarker = $refMarker >> 1;
if ($refMarker>=count($this->_referenceObjects)) {
$this->throwZendException('Undefined object reference: {0}',[$refMarker]);
$this->throwAmfException('Undefined object reference: {0}',[$refMarker]);
}
return $this->_referenceObjects[$refMarker];
}
Expand Down
2 changes: 1 addition & 1 deletion fproject/amf/parse/Amf3Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public function writeVector(&$array, $markerType, $vectorInfo)
return $this->writeObjectVector($array, $len, $vectorInfo['elementType']);
default:
// Unknown vector type tag {type}
$this->throwZendException('Undefined vector type: {0}',[$markerType]);
$this->throwAmfException('Undefined vector type: {0}',[$markerType]);
}

$this->writeNumericVector($array, $len, $numberFormat);
Expand Down
2 changes: 1 addition & 1 deletion fproject/amf/parse/InputStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* InputStream is used to iterate at a binary level through the AMF request.
*
* InputStream extends BinaryStream as eventually BinaryStream could be placed
* outside of Zend_Amf in order to allow other packages to use the class.
* outside of PHP AMF in order to allow other packages to use the class.
*
*/
class InputStream extends BinaryStream
Expand Down
2 changes: 1 addition & 1 deletion fproject/amf/parse/OutputStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Iterate at a binary level through the AMF response
*
* OutputStream extends BinaryStream as eventually BinaryStream could be placed
* outside of Zend_Amf in order to allow other packages to use the class.
* outside of PHP AMF in order to allow other packages to use the class.
*
*/
class OutputStream extends BinaryStream
Expand Down

0 comments on commit 70ff280

Please sign in to comment.