Let's not just use file_get_contents() for better compat.#4924
Let's not just use file_get_contents() for better compat.#4924samhotchkiss merged 5 commits intomasterfrom
file_get_contents() for better compat.#4924Conversation
|
This might cause some issues in some cases, as mentioned here:
|
|
Ah, thanks, I hadn't seen that. The function name does explicitly have Also other possible place -- Line 504 in d9f57d6 |
|
Works fine with URLs, images are recognized, even with no extensions. Non images return false, which is correct too. I tested with something like add_action( 'wp_footer', function() {
$ton = new Tonesque( 'http://example.tld/wp-content/uploads/2029/08/image.jpg' );
var_dump( $ton->grab_color() );
} );and it works, you get the array with |
|
Personal opinion: I think we should add another method |
|
It appears that in PHP7, list() must be fed an integer-keyed array. I received the following when loading up Tonesque with a local file path:
I just pushed a commit that should resolve this. Otherwise, everything LGTM and tests good. |
|
LGTM! 🐑 Tested again with Ryu theme and this code and it works fine now add_action( 'wp_footer', function() {
$ton = new Tonesque( 'http://example.tld/wp-content/uploads/2029/08/image.jpg' );
var_dump( $ton->grab_color() );
$ton = new Tonesque( '/Users/joedoe/Sites/joeserver/wp-content/uploads/2029/08/image.jpg' );
var_dump( $ton->grab_color() );
} ); |
No description provided.