Closed tdlm closed 5 years ago
Hey @tdlm! Can you please cd extensions/memcache; git pull; vagrant provision
for me and see if it works okay? I actually removed the template file we had for this the other day: https://github.com/Chassis/memcache/pull/13/files so I think without it it should "just work". Let me know if it doesn't though!
Sidenote: I was working on a new Chassis feature yesterday that automatically detects and installs updates.
There's a typo in the notice there but you can see the general functionality of it. I have to do a little refactoring but I'll ship that later today!
@BronsonQuick That auto-updater looks awesome!
As for your instructions, I ran them, verified I was up to date on the memcache extension and reprovisioned, but the file stayed in place, so the error persisted.
Deleting the chassis/extensions/memcache/local-config.php
file altogether works just fine. Additionally, I cloned the repo just today, so I'm really not sure why the file got created at all given your recent changes (and I confirmed the deleted .pp and .erb files are gone).
Puzzling. I'm thinking I might start over just to see when it gets created.
Ahh right. Thanks for letting me know about that! I'll try creating a new Chassis install with memcache when I get to the office today and see if I can replicate it. If I can't I'll close this issue. If I can I'll fix it up. Thanks for the issue!
This is because both Memcache and Memcached use the same global, but take different input formats. This format is IIRC for Memcache, while Memcached requires the other. Total pain, not sure how well we can resolve it.
This is how we nastily do it:
/**
* If we are PHP 7+ then we are using the memcached extension and dropin, so the
* $memcached_servers array is slightly differently formatted.
*/
if ( class_exists( 'Memcached' ) ) {
$memcached_servers = array( array( "hostname", 11211 ) );
} else {
$memcached_servers = array( "hostname:11211" );
}
In Chassis we install both extensions to allow users to pick what they want, so this won't work.
It would be very useful to add this documentation on the README so that devs can more easily find this. I've struggled with figuring this out more than once.
While setting up Disney Newsroom Chassis instance, we ran across this warning, which disables logging into the back-end.
It seems like the
local-config.php
being generated by Puppet is to blame since the expected format for the$memcached_servers
global is a nested array, like in the current constructor call when the global is not set:Thus, changing the local-config value from a single array to a nested array removes the warning and fixes the issue: