chg: dev: reinit project - disable redis module and make the project compatible w/ PHP7.3 #2
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
|
||||
namespace Mine\SeekerBundle\Controller;
|
||||
|
||||
//use CL\Slack\Payload\ChatPostMessagePayload;
|
||||
//use CL\Slack\Payload\UsersListPayload;
|
||||
//use CL\Slack\Transport\ApiClient;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
@@ -12,27 +9,6 @@ class GameController extends Controller
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
// $apiClient = new ApiClient('xoxp-107639806167-107029084564-115427085733-cccaa4f96c89c87ce680c7f22acfd001');
|
||||
//
|
||||
// $usersListPayload = new UsersListPayload();
|
||||
// $usersList = $apiClient->send($usersListPayload);
|
||||
//
|
||||
// dump($usersList);
|
||||
//
|
||||
// $payload = new ChatPostMessagePayload();
|
||||
// $payload->setChannel('#general');
|
||||
// $payload->setAsUser(true);
|
||||
// $payload->setText('Hello world!');
|
||||
|
||||
// $response = $apiClient->send($payload);
|
||||
|
||||
// if ($response->isOk()) {
|
||||
// dump('bazmeg');
|
||||
// } else {
|
||||
// dump($response->getError());
|
||||
// dump($response->getErrorExplanation());
|
||||
// }
|
||||
|
||||
return $this->render('MineSeekerBundle:Game:index.html.twig');
|
||||
}
|
||||
|
||||
@@ -44,11 +20,6 @@ class GameController extends Controller
|
||||
));
|
||||
}
|
||||
|
||||
public function slackAction(Request $request)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function privacyAction()
|
||||
{
|
||||
return $this->render('MineSeekerBundle:Official:privacy.html.twig');
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace Mine\SeekerBundle\Periodic;
|
||||
|
||||
use Gos\Bundle\WebSocketBundle\Periodic\PdoPeriodicPing;
|
||||
use Gos\Bundle\WebSocketBundle\Periodic\PeriodicInterface;
|
||||
use PDO;
|
||||
|
||||
class MinePeriodic implements PeriodicInterface
|
||||
{
|
||||
|
||||
@@ -10,18 +10,18 @@ doctrine_cache:
|
||||
type: redis
|
||||
alias: gos_web_socket.client_storage.driver.redis
|
||||
|
||||
# SNC
|
||||
snc_redis:
|
||||
clients:
|
||||
cache:
|
||||
type: predis
|
||||
alias: cache
|
||||
dsn: redis://localhost/2
|
||||
logging: "%kernel.debug%"
|
||||
options:
|
||||
profile: 2.2
|
||||
connection_timeout: 10
|
||||
read_write_timeout: 30
|
||||
## SNC
|
||||
#snc_redis:
|
||||
# clients:
|
||||
# cache:
|
||||
# type: predis
|
||||
# alias: cache
|
||||
# dsn: redis://localhost/2
|
||||
# logging: "%kernel.debug%"
|
||||
# options:
|
||||
# profile: 2.2
|
||||
# connection_timeout: 10
|
||||
# read_write_timeout: 30
|
||||
|
||||
# Web Socket Configuration
|
||||
gos_web_socket:
|
||||
@@ -33,10 +33,10 @@ gos_web_socket:
|
||||
- "@MineSeekerBundle/Resources/config/pubsub/routing.yml"
|
||||
client:
|
||||
firewall: secured_area
|
||||
session_handler: "@session.handler.pdo"
|
||||
storage:
|
||||
driver: "@gos_web_socket.client_storage.driver.predis"
|
||||
ttl: 28800 #(optionally) time to live if you use redis driver
|
||||
prefix: client #(optionally) prefix if you use redis driver, create key "client:1" instead key "1"
|
||||
# session_handler: "@session.handler.pdo"
|
||||
# storage:
|
||||
# driver: "@gos_web_socket.client_storage.driver.predis"
|
||||
# ttl: 28800 #(optionally) time to live if you use redis driver
|
||||
# prefix: client #(optionally) prefix if you use redis driver, create key "client:1" instead key "1"
|
||||
periodic:
|
||||
- "@mineseeker.periodic"
|
||||
|
||||
@@ -1,46 +1,33 @@
|
||||
services:
|
||||
pdo:
|
||||
class: PDO
|
||||
arguments:
|
||||
dsn: "mysql:host=%database_host%;dbname=%database_name%"
|
||||
user: "%database_user%"
|
||||
passwd: "%database_password%"
|
||||
calls:
|
||||
- [ setAttribute, [3, 2] ] # \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION
|
||||
|
||||
session.handler.pdo:
|
||||
class: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
|
||||
public: false
|
||||
arguments: ["@pdo", {lock_mode: 0}]
|
||||
|
||||
# config.yml --> gos_web_socket > storage > client > driver
|
||||
gos_web_socket.client_storage.driver.predis:
|
||||
class: Gos\Bundle\WebSocketBundle\Client\Driver\PredisDriver
|
||||
arguments:
|
||||
- "@snc_redis.cache"
|
||||
# gos_web_socket.client_storage.driver.predis:
|
||||
# class: Gos\Bundle\WebSocketBundle\Client\Driver\PredisDriver
|
||||
# arguments:
|
||||
# - "@snc_redis.cache"
|
||||
|
||||
mineseeker.periodic:
|
||||
class: Mine\SeekerBundle\Periodic\MinePeriodic
|
||||
tags:
|
||||
- { name: gos_web_socket.periodic }
|
||||
arguments:
|
||||
ping: '@gos_web_socket.pdo.periodic_ping'
|
||||
- '@gos_web_socket.pdo.periodic_ping'
|
||||
|
||||
mineseeker.topic_sample_service:
|
||||
class: Mine\SeekerBundle\Topic\MineseekerTopic
|
||||
tags:
|
||||
- { name: gos_web_socket.topic }
|
||||
arguments:
|
||||
clientManipulator: "@gos_web_socket.websocket.client_manipulator"
|
||||
doctrine: '@doctrine.orm.entity_manager'
|
||||
requestStack: '@request_stack'
|
||||
- "@gos_web_socket.websocket.client_manipulator"
|
||||
- '@doctrine.orm.entity_manager'
|
||||
- '@request_stack'
|
||||
|
||||
mineseeker.rpc_sample_service:
|
||||
class: Mine\SeekerBundle\Rpc\MineseekerRpc
|
||||
tags:
|
||||
- { name: gos_web_socket.rpc }
|
||||
arguments:
|
||||
doctrine: '@doctrine.orm.entity_manager'
|
||||
- '@doctrine.orm.entity_manager'
|
||||
- '@logger'
|
||||
|
||||
gos_web_socket_server.client_event.listener:
|
||||
class: Mine\SeekerBundle\EventListener\MineseekerClientEventListener
|
||||
|
||||
@@ -332,7 +332,7 @@ class MineSeeker extends React.Component {
|
||||
/** Create Websocket w/ Bahnhof.js */
|
||||
let websocket = WS.connect(
|
||||
this.state.env === 'dev'
|
||||
? "ws://mine.dev:6450"
|
||||
? "ws://localhost:6450"
|
||||
// : (this.state.ssl === 'true' ? "wss" : "ws") + "://" + window.location.hostname + ":6450/"
|
||||
: (this.state.ssl === 'true' ? "wss" : "ws") + "://www.mineseeker.ninja:6450/"
|
||||
);
|
||||
|
||||
@@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManager;
|
||||
use Mine\SeekerBundle\Entity\Grid;
|
||||
use Mine\SeekerBundle\Entity\GridRow;
|
||||
use Mine\SeekerBundle\Entity\PlayedGame;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use Gos\Bundle\WebSocketBundle\RPC\RpcInterface;
|
||||
use Gos\Bundle\WebSocketBundle\Router\WampRequest;
|
||||
@@ -18,13 +19,16 @@ class MineseekerRpc implements RpcInterface
|
||||
|
||||
protected $grid;
|
||||
|
||||
private $logger;
|
||||
|
||||
/**
|
||||
* MineseekerRpc constructor.
|
||||
* @param EntityManager $entityManager
|
||||
*/
|
||||
public function __construct(EntityManager $entityManager)
|
||||
public function __construct(EntityManager $entityManager, LoggerInterface $logger)
|
||||
{
|
||||
$this->em = $entityManager;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,6 +49,7 @@ class MineseekerRpc implements RpcInterface
|
||||
*/
|
||||
public function startGame(ConnectionInterface $connection, WampRequest $request, array $params)
|
||||
{
|
||||
$this->reConnect($params);
|
||||
return $this->saveGrid($params);
|
||||
}
|
||||
|
||||
@@ -170,7 +175,7 @@ class MineseekerRpc implements RpcInterface
|
||||
$connection->connect();
|
||||
}
|
||||
} catch(PDOException $ex) {
|
||||
throw PDOException::class;
|
||||
$this->logger->error($ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user