evert / SabreAMF

SabreAMF is a AMF encoder/decoder writting in PHP. Supports AMF0 and 3.
http://code.google.com/p/sabreamf/
BSD 3-Clause "New" or "Revised" License
41 stars 21 forks source link

Need help! #7

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello, Im new to SabreAMF and I've got an issue. The issue is error in PHP Fatal error: Uncaught Error: Class 'SabreAMF_Const' not found in C:\xampp\htdocs\AMFTest\index.php:5 Stack trace: #0 {main} thrown in C:\xampp\htdocs\AMFTest\index.php on line 5 Code is example from SabreAMF/examples/client.php `<?php

include 'SabreAMF/Client.php'; //Include the client scripts

$client = new SabreAMF_Client('http://localhost/server.php'); // Set up the client object

$result = $client->sendRequest('myService.myMethod',array('myParameter')); //Send a request to myService.myMethod and send as only parameter 'myParameter'

var_dump($result); //Dump the results

?> `

evert commented 4 years ago

Hi! This is a fairly old project, haven't looked at it in over 10 years. I think the examples might be out of date. You should really install this package with composer so the autoloader is used.

Then you don't need to call include, everything should just load.

Good luck

ghost commented 4 years ago

Thank you for response! Can you teach me how to use composer? I downloaded everything, I also downloaded your library in composer but now I get Fatal error: Uncaught Error: Class 'SabreAMF_Client' not found in C:\xampp\htdocs\AMFTest\index.php:5 Stack trace: #0 {main} thrown in C:\xampp\htdocs\AMFTest\index.php on line 5

evert commented 4 years ago

It sounds like you are not including the composer autoloader, which is important.

I can't really help you beyond that. There should be a lot of resources out there to help you learn it. What's your interest in this old library BTW? AMF isn't really used by anyone anymore as far as I know.

ghost commented 4 years ago

I am including autoloader. I'm looking for working AMF PHP because of the game MovieStarPlanet which uses AMF Requests. I just want to automate things such as logging in, and updating status but I cant find any good AMF libraries for PHP

evert commented 4 years ago

I see. You're unfortunately kind of on your own. I've moved on from this project a very long time ago and don't really have an interest to dive in and see if there's bugs.

I am open to pull requests if you do find problems that are worth fixing. I'm sorry!

ghost commented 4 years ago

No problem. Anyways thanks for your help

ROBERT-MCDOWELL commented 4 years ago

wrong, AMF is used by serious developers and mostly big company projects.

evert commented 4 years ago

Alright, I thought it was a dead format, and most people have moved on to protobuf and CBOR and stuff. People even use it for new projects?