julien731 / WP-Dismissible-Notices-Handler

A simple library to handle dismissible admin notices for WordPress
GNU General Public License v3.0
46 stars 11 forks source link

Composer dependency #2

Closed s3rgiosan closed 8 years ago

s3rgiosan commented 8 years ago

Hi,

How I can use your library as a composer managed dependency on a project?

I've installed it with the command composer require julien731/wp-dismissible-notices-handler=dev-master but when I try to use the dnh_register_notice function I get a PHP Fatal error: Call to undefined function dnh_register_notice().

What I'm doing wrong?

Regards

julien731 commented 8 years ago

Hi @s3rgiosan ,

After you required the library as a Composer package, how do you load it? Do you use the Composer autoloader or are you loading it manually?

s3rgiosan commented 8 years ago

Hi @julien731, I'm using the composer autoloader.

The autoload_classmap.php and the autoload_files.php doesn't have any reference to your files or classes.

julien731 commented 8 years ago

Hey @s3rgiosan sorry about that. The library was indeed not autoloaded. I just pushed an update that fixes it. I didn't test it though, feedback welcome ;)

s3rgiosan commented 8 years ago

Hi @julien731, thanks for the update.

I've made the exact same change on my fork a week ago and i've been using it like that without any issues.