我正在尝试在PHP和mySQL中创建线程消息传递系统。我的消息表如下
SELECT `es_id`, `es_fid`, `es_tid`, `es_subject`, `es_message`, `es_onstamp`, `es_msg_read`, `es_f_del`, `es_t_del`, `threadid` FROM `esb2b_messages`
Run Code Online (Sandbox Code Playgroud)
在这张桌子
es_id = primary key for the table.
es_fid = This field store the from user id.
es_tid = This field store the to user id.
es_subject = This field store the subject of message.
es_message = This field store the body of message.
es_onstamp = This field store the time stamp.
es_msg_read = This field store if receiver open the message.
es_f_del = This field …Run Code Online (Sandbox Code Playgroud) 我正在尝试制作开源缓存库.库的目的是提供将变量(可以是对象,可以是数组,可以是任何东西)存储到文件中然后在调用时检索它的方法.(通常那些变量值是大量数据库查询和计算的结果).
该项目的基本目标是实践面向对象的设计原则,称为实体.
如果任何人可以指出我违反固体原则的地方以及如何解决它
我完全理解stackoverflow不是代码编写服务,但是我正在使这个库开源,所以它会使我们的社区受益.
所以这是我的文件结构.
我是UML的新手,所以如果发现任何错误,请忽略
这是类的实现.
高速缓存
namespace library\pingle\cache;
use library\pingle\cache\config\CacheConfigurator;
use library\pingle\cache\file\FileHandler;
/**
* @property CacheReader $cache_reader
* @property CacheWriter $cache_write
*/
Class Cache {
private $config;
private $file_hander;
private $cache_reader;
private $cache_write;
private $cache_directory;
private $cache_kept_days;
private $cache_file_prams;
private $function_name;
private $file_path;
function __construct(CacheConfigurator $config) {
$this->file_hander = new FileHandler();
$this->config = $config;
list($this->cache_directory, $this->function_name, $this->cache_kept_days, $this->cache_file_prams) = $this->config->getConfig();
$this->file_path = $this->generateFileName($this->cache_file_prams);
}
public function read() {
if (is_null($this->cache_reader)) {
$this->cache_reader = new CacheReader($this->file_hander);
}
return $this->cache_reader->readCache($this->file_path); …Run Code Online (Sandbox Code Playgroud) 您好,在此实例中,数据库安全组对所有入站流量(所有端口 - 所有源)开放。
我还可以在 mysql 工作台或 Datagrip 中很好地连接到数据库,这肯定会使用 jdbc 连接字符串。
2019-05-21 14:12:03 INFO CatalogClient:651 - Got connection 'tem-sas-main' info from Catalog with url: jdbc:mysql://my-database-example:3306/sas_tem_central
2019-05-21 14:12:03 INFO CatalogClient:684 - JDBC configuration for connection tem-sas-main: JDBCConfiguration(url=jdbc:mysql://my-database-example:3306/sas_tem_central, hostname=my-database-example, port=3306, databaseVendor=mysql, databaseVersion=null, connectionName=tem-sas-main, path=sas_tem_central, subnetId=subnet-0717c4db096e84393, availabilityZone=eu-west-1a, securityGroups=[sg-074b074ebc51c2315], enforceSSL=false)
2019-05-21 14:12:03 INFO JdbcConnection:42 - Starting connecter. driver com.mysql.jdbc.Driver@7e5d9a50
2019-05-21 14:12:03 INFO JdbcConnection:60 - Attempting to connect with SSL host matching: jdbc:mysql://my-database-example:3306/sas_tem_central
2019-05-21 14:14:15 INFO JdbcConnection:69 - SSL connection to data store using host matching …Run Code Online (Sandbox Code Playgroud)