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

Changing Class names to customers needs #27

Closed
torstenhoegel opened this issue Jun 23, 2019 · 13 comments
Closed

Changing Class names to customers needs #27

torstenhoegel opened this issue Jun 23, 2019 · 13 comments

Comments

@torstenhoegel
Copy link

Hey there,

I have the extended license and wanted to change the class names (MailWizzApi_{NAME}) to something different.

I used Sublimes Replace function but it seems to break everything because it tells me:

MacBook-Pro:examples torstenhogel$ php lists.php

Fatal error: Uncaught Error: Class 'GoMailApi_Config' not found in /Users/torstenhogel/Library/CloudStorage/iCloud Drive/Documents/gomail-php-sdk/examples/setup.php:23
Stack trace:
#0 /Users/torstenhogel/Library/CloudStorage/iCloud Drive/Documents/gomail-php-sdk/examples/lists.php(11): require_once()
#1 {main}
  thrown in /Users/torstenhogel/Library/CloudStorage/iCloud Drive/Documents/gomail-php-sdk/examples/setup.php on line 23

I've also tried running cleanups via composer like cache e.g. but it didn't work.

Do you have any idea why this happens?

@twisted1919
Copy link
Owner

You have to replace the name in the source code as well, that is, the files you get when you download the library from here, all of them.

@torstenhoegel
Copy link
Author

So I have renamed all mailwizzapi_ to mynameapi_ that's including the whole downloaded project, if you mean those files from this repository ...

Or do you mean smth different?

@twisted1919
Copy link
Owner

That's what i meant, but also file names, ok?

@torstenhoegel
Copy link
Author

Yes I did ... thou the error says that the function doesn't exist it does ... could that be connected to an autoloader issue?

@twisted1919
Copy link
Owner

@ONIXTurtle - if you have installed from composer, you have to also modify the composer.json file in the autoload section and then recreate the composer files to autoload your class by dumping the new autoloader with composer dump-autoload

@torstenhoegel
Copy link
Author

It tells me the following:
Generated autoload files containing 0 classes
That's strange because it should be generating it ...

@torstenhoegel
Copy link
Author

?

@twisted1919
Copy link
Owner

Can you place the code in a repository so we can take a look? Or somewhere to download it?

@torstenhoegel
Copy link
Author

torstenhoegel commented Jul 12, 2019

absolutely here it is: https://github.com/ONIXTurtle/gomail-php-sdk-test

@twisted1919
Copy link
Owner

twisted1919 commented Jul 15, 2019

Here's your issue: https://github.com/Go-On-Network/gomail-php-sdk/blob/master/composer.json#L18 most likely.

So replace MailWizzApi_ with your naming everywhere.

@torstenhoegel
Copy link
Author

Doesn't work I'm getting the error on the rep above: https://github.com/ONIXTurtle/gomail-php-sdk-test

that it can't find the class:

MacBook-Pro:examples torstenhogel$ php countries.php

Fatal error: Uncaught Error: Class 'GoMailApi_Config' not found in /path/test/examples/setup.php:23
Stack trace:
#0 /path/test/examples/countries.php(11): require_once()
#1 {main}
  thrown in /path/test/examples/setup.php on line 23

@twisted1919
Copy link
Owner

@torstenhoegel
Copy link
Author

Awesome that fixed it ;)

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