Skip to content
Permalink
Browse files

Merge pull request #448 from teiling88/bugfix/fix-journal

JournaldPostfixLogs
  • Loading branch information...
teiling88 committed May 11, 2017
2 parents 63e17eb + e3b1464 commit 6fe44cacce260f5d6df5b3ad5bb2809afaa258ad
@@ -1,6 +1,6 @@
<?php
/***************************************************************************
* Sample settincs.inc.php file for a developer machine
* Sample settings.inc.php file for a developer machine
***************************************************************************/

// installation paths
@@ -21,6 +21,7 @@ public function registerBundles()
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new JMS\TranslationBundle\JMSTranslationBundle(),
new AppBundle\AppBundle(),
new OcBundle\OcBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170510222222 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('INSERT IGNORE INTO sysconfig VALUES (\'syslog_maillog_lastdate\', \'2017-05-01 00:00:01\')');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE field_note');
}
}

This file was deleted.

Oops, something went wrong.
@@ -28,3 +28,9 @@ services:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }

oc.util.dbal_connection:
class: Oc\Util\DbalConnection
oc_bundle.postfix.journal_logs:
class: OcBundle\Postfix\JournalLogs
arguments: ['@oc.util.dbal_connection']
@@ -1,7 +1,6 @@
<?php
/***************************************************************************
*
* Sample settincs.inc.php file for a developer machine
* Sample settings.inc.php file for a developer machine
***************************************************************************/
// installation paths
@@ -1522,7 +1522,7 @@ public function delete()
// email bounce processing
public function addEmailProblem($licenseEmail = false)
{
// mailing_problems is a bit-flag field to remember nondelivered, important mailings
// mailing_problems is a bit-flag field to remember nonDelivered, important mailings
if ($licenseEmail) {
if (!$this->reUser->setValue('mailing_problems', $this->reUser->getValue('mailing_problems') | 1)) {
return false;
@@ -27,6 +27,6 @@ public function __construct($name = null)
{
parent::__construct($name);
$this->rootPath = realpath(__DIR__ . '/../../../');
$this->rootPath = dirname(dirname(dirname(__DIR__))) . '/';
}
}
@@ -13,8 +13,6 @@ class KitchenSinkController extends Controller
*/
public function indexAction()
{
return $this->render('AppBundle:KitchenSinkController:index.html.twig', [
// ...
]);
return $this->render('AppBundle:KitchenSinkController:index.html.twig');
}
}
@@ -0,0 +1,8 @@
<?php
namespace Oc\User;
class UserEntity
{
}
@@ -0,0 +1,8 @@
<?php
namespace Oc\User;
class UserRepository
{
}
@@ -0,0 +1,8 @@
<?php
namespace Oc\User;
class UserService
{
}
@@ -2,8 +2,7 @@
/***************************************************************************
* for license information see doc/license.txt
*
*
* Exact time mesurement
* Exact time measurement
***************************************************************************/
namespace Oc\Util;
@@ -0,0 +1,66 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* small helper class to get a dbal connection or dbal query builder
* to refactor sql methods
***************************************************************************/
namespace Oc\Util;
use Doctrine\DBAL\DriverManager;
use Symfony\Component\Yaml\Yaml;
class DbalConnection
{
/**
* @var \Doctrine\DBAL\Connection
*/
private $connection;
public function __construct()
{
$params['driver'] = 'pdo_mysql';
$parameters = Yaml::parse(file_get_contents(__DIR__ . '/../../../app/config/parameters.yml'));
$parameters = $parameters['parameters'];
if (isset($parameters['database_host'])) {
$params['host'] = $parameters['database_host'];
}
if (isset($parameters['database_port'])) {
$params['port'] = $parameters['database_port'];
}
if (isset($parameters['database_user'])) {
$params['user'] = $parameters['database_user'];
}
if (isset($parameters['database_password'])) {
$params['password'] = $parameters['database_password'];
}
if (isset($parameters['database_name'])) {
$params['dbname'] = $parameters['database_name'];
}
$this->connection = DriverManager::getConnection($params);
}
/**
* @return \Doctrine\DBAL\Connection
*/
public function getConnection()
{
return $this->connection;
}
/**
* @return \Doctrine\DBAL\Query\QueryBuilder,
*/
public function getQueryBuilder()
{
return $this->connection->createQueryBuilder();
}
}
@@ -0,0 +1,44 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
***************************************************************************/
namespace OcBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class JournaldPostfixLogsCommand extends ContainerAwareCommand
{
const COMMAND_NAME = 'postfix:processing-logs';
/**
* @return void
* @throws \Symfony\Component\Console\Exception\InvalidArgumentException
*/
protected function configure()
{
parent::configure();
$this
->setName(self::COMMAND_NAME)
->setDescription('process postfix logs for support');
}
/**
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
*
* @return int|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('process postfix logs');
$journal = $this->getContainer()->get('oc_bundle.postfix.journal_logs');
$journal->processJournalLogs();
$output->writeln('process postfix logs finished');
}
}
@@ -0,0 +1,9 @@
<?php
namespace OcBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class OcBundle extends Bundle
{
}
Oops, something went wrong.

0 comments on commit 6fe44ca

Please sign in to comment.
You can’t perform that action at this time.