Example #1
0
 /**
  * @test
  */
 public function output_parameter_is_passed_to_method()
 {
     $output_file = "/tmp/output.log";
     $output = "This is testing.";
     $MockFunction = new \PHPUnit_Extensions_MockFunction('file_put_contents', $this);
     $MockFunction->expects($this->once())->with($this->equalTo($output_file), $this->equalTo($output), FILE_APPEND)->will($this->returnValue(true));
     $Logger = new \Logger($output_file);
     $Logger->output($output);
 }
Example #2
0
 public function postSend()
 {
     parent::postSend();
     $info = "Gesendet an: " . implode(', ', array_keys($this->all_recipients)) . " von " . $this->From;
     Logger::output('mail.log', $info);
 }
Example #3
0
            $groupBenutzer,
            $groupModerator,
            $groupAdministrator
        ]
    ],
    'ConnGroupRight' => [
         $groupBenutzer => [$permissionBenutzer],
         $groupModerator => [$permissionModerator],
         $groupAdministrator => [$permissionAdministrator],
    ]
];

foreach ($connections as $class => $data) {
    foreach ($data as $lkLeft => $lksRight) {
        foreach ($lksRight as $lkRight) {
            /** @var BaseConnectionObject $connObj */
            $connObj = new $class();
            $connObj->setLkLeft($lkLeft);
            $connObj->setLkRight($lkRight);

            DB::beginTransaction();
            try {
                $connObj->save();
            } catch (base_exception_BaseConnectionObject $e) {
                Logger::output('install.log', $e->getMessage());
            }
            DB::endTransaction();

        }
    }
}
Example #4
0
 public function findSingleConnection($lkLeft, $lkRight)
 {
     $table = DB::table($this->getTable());
     $where = DB::where($table->getColumn('lkLeft'), DB::intTerm($lkLeft));
     $where->addAnd($table->getColumn('lkRight'), DB::intTerm($lkRight));
     $selectStatement = new base_database_statement_Select();
     $selectStatement->setTable($table);
     $selectStatement->setWhere($where);
     $result = $selectStatement->fetchDatabase();
     if (count($result) > 1) {
         Logger::output('BaseConnectionObject.log', "Duplicated entry for '" . get_class($this) . "' with lkLeft '$lkLeft' and lkRight '$lkRight'");
     }
     if (count($result) == 0) {
         return null;
     }
     $this->_setObject($result);
     return $this;
 }
Example #5
0
// Necessary base classes
require 'Logger.php';
require 'Log/Entry.php';
require 'Driver/DriverInterface.php';
// Optional drivers
require 'Driver/Playout/UniversalDriver.php';
require 'Driver/Playout/ClassicalDriver.php';
require 'Driver/Playout/GMLDriver.php';
/**
 *  Environment (PHP 5.6+)
 */
date_default_timezone_set('Europe/Amsterdam');
/**
 * Run
 */
$logger = new Logger($argv);
$logger->registerDriver(new ClassicalDriver());
$logger->registerDriver(new GMLDriver());
$logger->registerDriver(new UniversalDriver());
$logger->run();
/**
 *  Optional filtering
 */
// $logger->filter(function (Entry $entry) {
//     return !empty($entry->itemid);
// });
/**
 *  Output
 */
$logger->output();
Example #6
0
<?php

require_once 'Logger.php';
require_once 'Item.php';
require_once 'Document.php';
require_once 'DB.php';
require_once 'Parser.php';
$db = new DB();
$parser = new Parser();
$parser->saveItems($db);
Logger::output($parser->toString());
Example #7
0
    /**
     *
     */
    public function execute()
    {
        ob_start();
        if ($this->isExecuteable() === true) {
            try {
                $this->executeRequest();
            } catch (Exception $e) {
//                $this->msg = $e->getMessage();
                Logger::output('protocol.log', $e->getMessage(). $this->msg);
            }
        }
//        $obGetContents = ob_get_contents();
//        if (!empty($obGetContents)) {
//            $this->msg .= ' ' . $obGetContents;
//        }
        ob_clean();
        $this->response();
    }