Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems setting up #44

Closed
telescope0606 opened this issue Oct 29, 2014 · 3 comments
Closed

Problems setting up #44

telescope0606 opened this issue Oct 29, 2014 · 3 comments

Comments

@telescope0606
Copy link

Hi. It isn't very clear regarding how to set up the application regarding creation of the handler (or, it may not be working for me). Is it supposed to be:

//initiate API wrapper
$app_key = '54a51ee4f27cbbcb7a771352b980567f';
$login = 'admin';
new OpenSearchServer\Handler(array('key' => $app_key, 'login' => $login ));

Or, am I supposed to not use the term Handler and place something else there?

When I run this, I get the following error:
Class 'OpenSearchServer\Handler' not found

I see there are a number of files in src. Am I supposed to include all of these files?

@AlexandreToyer
Copy link
Member

Hi,

Did you install the client with Composer? If you did it should have generated an autoload file that would include all needed files for you. You need to include this autoload file (vendor/autoload.php, https://getcomposer.org/doc/01-basic-usage.md#autoloading)

If you did not use composer to install this client you will have to write your own autoload process or to include every needed classes in your PHP script (http://php.net/manual/en/language.oop5.autoload.php).

One other thing: if you're writing your script from within a specific namespace you will probably have to write new \OpenSearchServer\Handler (with a front \).

Thank you,
Alexandre

@telescope0606
Copy link
Author

I messed that up. Followed your instructions and it's working fine. Thanks!!!

@AlexandreToyer
Copy link
Member

Great!

Thank you for your feedback.

Alexandre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants