You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpnamespaceIlluminate\Cache;
useMemcache;
useRuntimeException;
classMemcacheConnector {
/** * Create a new Memcached connection. * * @param array $servers * @return Memcache */publicfunctionconnect(array$servers)
{
$memcache = $this->getMemcache();
// For each server in the array, we'll just extract the configuration and add// the server to the Memcache connection. Once we have added all of these// servers we'll verify the connection is successful and return it back.foreach ($serversas$server)
{
$memcache->addServer($server['host'], $server['port'], $server['weight']);
}
if ($memcache->getVersion() === false)
{
thrownewRuntimeException("Could not establish Memcache connection.");
}
return$memcache;
}
/** * Get a new Memcache instance. * * @return Memcached */protectedfunctiongetMemcache()
{
returnnewMemcache;
}
}
php_memcached.dll扩展在windows下暂时找不到安装方式,原因
所以laravel下使用memcache扩展并修改相关的系统文件。原文地址, 防止以后访问不了,这边也记录下。
打包下载
手工修改:
'driver' => 'memcache',
The text was updated successfully, but these errors were encountered: