Skip to content

Commit

Permalink
#6 migrate Zend_Amf_Server
Browse files Browse the repository at this point in the history
  • Loading branch information
Bui Sy Nguyen committed Apr 30, 2016
1 parent 75c0684 commit 3085ca6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fproject/amf/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Server
*/
public function __construct()
{
TypeLoader::setResourceLoader(new ResourceLoader());
TypeLoader::setResourceLoader(new ResourceLoader(array("Zend_Amf_Parse_Resource" => "amf/parse/resource")));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion fproject/amf/loader/ResourceLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public function getClassPath($name)
*/
public function load($name, $throwExceptions = true)
{
echo "\nLoading resource:.$name";
echo "\nLoading resource:$name";

$name = $this->_formatName($name);
if ($this->isLoaded($name)) {
Expand Down
42 changes: 42 additions & 0 deletions fproject/amf/parse/resource/Stream.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* This class will convert stream resource to string by just reading it
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Resource_Stream
{
/**
* Parse resource into string
*
* @param resource $resource Stream resource
* @return array
*/
public function parse($resource) {
return stream_get_contents($resource);
}
}

0 comments on commit 3085ca6

Please sign in to comment.