This method is responsible for parsing the request and generating the
response for the CALDAV:free-busy-query REPORT.

@param Xml\Request\FreeBusyQueryReport $report
505834
protected function freeBusyQueryReport(Xml\Request\FreeBusyQueryReport $report)
    {
        $uri = $this->server->getRequestUri();

        $acl = $this->server->getPlugin('acl');
        if ($acl) {
            $acl->checkPrivileges($uri, '{'.self::NS_CALDAV.'}read-free-busy');
        }

        $calendar = $this->server->tree->getNodeForPath($uri);
        if (!$calendar instanceof ICalendar) {
            throw new DAV\Exception\NotImplemented('The free-busy-query REPORT is only implemented on calendars');
        }

        $tzProp = '{'.self::NS_CALDAV.'}calendar-timezone';

        // Figuring out the default timezone for the calendar, for floating
        // times.
        $calendarProps = $this->server->getProperties($uri, [$tzProp]);

        if (isset($calendarProps[$tzProp])) {
            $vtimezoneObj = VObject\Reader::read($calendarProps[$tzProp]);
            $calendarTimeZone = $vtimezoneObj->VTIMEZONE->getTimeZone();
            // Destroy circular references so PHP will garbage collect the object.
            $vtimezoneObj->destroy();
        } else {
            $calendarTimeZone = new DateTimeZone('UTC');
        }

        // Doing a calendar-query first, to make sure we get the most
        // performance.
        $urls = $calendar->calendarQuery([
            'name' => 'VCALENDAR',
            'comp-filters' => [
                [
                    'name' => 'VEVENT',
                    'comp-filters' => [],
                    'prop-filters' => [],
                    'is-not-defined' => false,
                    'time-range' => [
                        'start' => $report->start,
                        'end' => $report->end,
                    ],
                ],
            ],
            'prop-filters' => [],
            'is-not-defined' => false,
            'time-range' => null,
        ]);

        $objects = array_map(function ($url) use ($calendar) {
            $obj = $calendar->getChild($url)->get();

            return $obj;
        }, $urls);

        $generator = new VObject\FreeBusyGenerator();
        $generator->setObjects($objects);
        $generator->setTimeRange($report->start, $report->end);
        $generator->setTimeZone($calendarTimeZone);
        $result = $generator->getResult();
        $result = $result->serialize();

        $this->server->httpResponse->setStatus(200);
        $this->server->httpResponse->setHeader('Content-Type', 'text/calendar');
        $this->server->httpResponse->setHeader('Content-Length', strlen($result));
        $this->server->httpResponse->setBody($result);
    }
188505
public function calendarMultiGetReport($report)
    {
        $needsJson = 'application/calendar+json' === $report->contentType;

        $timeZones = [];
        $propertyList = [];

        $paths = array_map(
            [$this->server, 'calculateUri'],
            $report->hrefs
        );

        foreach ($this->server->getPropertiesForMultiplePaths($paths, $report->properties) as $uri => $objProps) {
            if (($needsJson || $report->expand) && isset($objProps[200]['{'.self::NS_CALDAV.'}calendar-data'])) {
                $vObject = VObject\Reader::read($objProps[200]['{'.self::NS_CALDAV.'}calendar-data']);

                if ($report->expand) {
                    // We're expanding, and for that we need to figure out the
                    // calendar's timezone.
                    list($calendarPath) = Uri\split($uri);
                    if (!isset($timeZones[$calendarPath])) {
                        // Checking the calendar-timezone property.
                        $tzProp = '{'.self::NS_CALDAV.'}calendar-timezone';
                        $tzResult = $this->server->getProperties($calendarPath, [$tzProp]);
                        if (isset($tzResult[$tzProp])) {
                            // This property contains a VCALENDAR with a single
                            // VTIMEZONE.
                            $vtimezoneObj = VObject\Reader::read($tzResult[$tzProp]);
                            $timeZone = $vtimezoneObj->VTIMEZONE->getTimeZone();
                        } else {
                            // Defaulting to UTC.
                            $timeZone = new DateTimeZone('UTC');
                        }
                        $timeZones[$calendarPath] = $timeZone;
                    }

                    $vObject = $vObject->expand($report->expand['start'], $report->expand['end'], $timeZones[$calendarPath]);
                }
                if ($needsJson) {
                    $objProps[200]['{'.self::NS_CALDAV.'}calendar-data'] = json_encode($vObject->jsonSerialize());
                } else {
                    $objProps[200]['{'.self::NS_CALDAV.'}calendar-data'] = $vObject->serialize();
                }
                // Destroy circular references so PHP will garbage collect the
                // object.
                $vObject->destroy();
            }

            $propertyList[] = $objProps;
        }

        $prefer = $this->server->getHTTPPrefer();

        $this->server->httpResponse->setStatus(207);
        $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8');
        $this->server->httpResponse->setHeader('Vary', 'Brief,Prefer');
        $this->server->httpResponse->setBody($this->server->generateMultiStatus($propertyList, 'minimal' === $prefer['return']));
    }
529422
public function onReportGenerate(ReportGeneratorEvent $event)
    {
        if (!$event->checkContext([self::SEGMENT_MEMBERSHIP])) {
            return;
        }

        $qb = $event->getQueryBuilder();
        $qb->leftJoin('l', MAUTIC_TABLE_PREFIX.'lead_utmtags', 'utm', 'l.id = utm.lead_id');

        $event->setQueryBuilder($qb);
    }
479100
public function execute(IDS_Report $data) 
    {
        if (!isset($_SERVER['REQUEST_URI'])) {
            $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'], 1);
            if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']) { 
                $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; 
            } 
        }     	

        foreach ($data as $event) {
            $page = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
            $ip   = $this->ip;
            $ip2  = $this->ip2;
            
            $name   = $event->getName();
            $value  = $event->getValue();
            $impact = $event->getImpact();
            $tags   = implode(', ', $event->getTags());

            $this->statement->bindParam('name', $name);
            $this->statement->bindParam('value', $value);
            $this->statement->bindParam('page', $page);
            $this->statement->bindParam('tags', $tags);
            $this->statement->bindParam('ip', $ip);
            $this->statement->bindParam('ip2', $ip2);
            $this->statement->bindParam('impact', $impact);
            $this->statement->bindParam('origin', $_SERVER['SERVER_ADDR']);

            if (!$this->statement->execute()) {

                $info = $this->statement->errorInfo();
                throw new Exception(
                    $this->statement->errorCode() . ', ' . $info[1] . ', ' . $info[2]
                );
            }
        }

        return true;
    }
872218
def get_report(self, report_id, **params):
        """"""
        response = self._get('v2', 'reports', report_id, data=params)
        return self._make_api_object(response, Report)
924137
public function phploc($report = FALSE)
	{
		// Command for generating reports
		$report_cmd_parts = [
			'vendor/bin/phploc',
			'--count-tests',
			'--log-csv=build/logs/phploc.csv',
			'--log-xml=build/logs/phploc.xml',
			'src',
			'tests'
		];

		// Command for generating direct output
		$normal_cmd_parts = [
			'vendor/bin/phploc',
			'--count-tests',
			'src',
			'tests'
		];

		$cmd_parts = ($report) ? $report_cmd_parts : $normal_cmd_parts;

		$this->_run($cmd_parts);
	}
491137
public void appendReport (StringBuilder report, long now, long sinceLast, boolean reset)
    {
        PresentsConMgrStats stats = getStats();
        long eventCount = stats.eventCount - _lastStats.eventCount;
        int connects = stats.connects - _lastStats.connects;
        int disconnects = stats.disconnects - _lastStats.disconnects;
        int closes = stats.closes - _lastStats.closes;
        long bytesIn = stats.bytesIn - _lastStats.bytesIn;
        long bytesOut = stats.bytesOut - _lastStats.bytesOut;
        long msgsIn = stats.msgsIn - _lastStats.msgsIn;
        long msgsOut = stats.msgsOut - _lastStats.msgsOut;
        if (reset) {
            _lastStats = stats;
        }

        // make sure we don't div0 if this method somehow gets called twice in
        // the same millisecond
        sinceLast = Math.max(sinceLast, 1L);

        report.append("* presents.net.ConnectionManager:\n");
        report.append("- Network connections: ");
        report.append(stats.connectionCount).append(" connections, ");
        report.append(stats.handlerCount).append(" handlers\n");
        report.append("- Network activity: ");
        report.append(eventCount).append(" events, ");
        report.append(connects).append(" connects, ");
        report.append(disconnects).append(" disconnects, ");
        report.append(closes).append(" closes\n");
        report.append("- Network input: ");
        report.append(bytesIn).append(" bytes, ");
        report.append(msgsIn).append(" msgs, ");
        report.append(msgsIn*1000/sinceLast).append(" mps, ");
        long avgIn = (msgsIn == 0) ? 0 : (bytesIn/msgsIn);
        report.append(avgIn).append(" avg size, ");
        report.append(bytesIn*1000/sinceLast).append(" bps\n");
        report.append("- Network output: ");
        report.append(bytesOut).append(" bytes, ");
        report.append(msgsOut).append(" msgs, ");
        report.append(msgsOut*1000/sinceLast).append(" mps, ");
        long avgOut = (msgsOut == 0) ? 0 : (bytesOut/msgsOut);
        report.append(avgOut).append(" avg size, ");
        report.append(bytesOut*1000/sinceLast).append(" bps\n");
    }
362976
private IntuitMessage prepareReport(String reportName) throws FMSException {
		IntuitMessage intuitMessage = new IntuitMessage();
		RequestElements requestElements = intuitMessage.getRequestElements();

		//set the request params
		Map<String, String> requestParameters = requestElements.getRequestParameters();
			requestParameters.put(RequestElements.REQ_PARAM_METHOD_TYPE, MethodType.GET.toString());

        if (getReport_date() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_REPORT_DT, getReport_date());
        }
			if (getStart_date() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_START_DT, getStart_date());
			}
			if (getEnd_date() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_END_DT, getEnd_date());
			}
			if (getDate_macro() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_DT_MACRO, getDate_macro());
			}
        if (getPast_due() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_PAST_DUE, getPast_due());
        }
        if (getStart_duedate() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_START_DUE_DT, getStart_duedate());
        }
        if (getEnd_duedate() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_END_DUE_DT, getEnd_duedate());
        }
        if (getDuedate_macro() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_DUE_DT_MACRO, getDuedate_macro());
        }

			if (getAccounting_method() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_ACC_METHOD, getAccounting_method());
			}
        if (getAccount() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_ACCOUNT, getAccount());
        }
        if (getSource_account() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_SOURCE_ACCOUNT, getSource_account());
        }
        if (getAccount_type() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_ACCOUNT_TYPE, getAccount_type());
        }
        if (getSource_account_type() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_SOURCE_ACCOUNT_TYPE, getSource_account_type());
        }

			if (getSummarize_column_by() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_SUM_COL_BY, getSummarize_column_by());
			}
			if (getCustomer() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_CUSTOMER, getCustomer());
			}
			if (getVendor() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_VENDOR, getVendor());
			}
			if (getItem() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_ITEM, getItem());
			}
			if (getClassid() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_CLASS, getClassid());
			}
        if (getAppaid() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_APPAID, getAppaid());
        }
			if (getDepartment() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_DEPARTMENT, getDepartment());
			}
			if (getQzurl() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_QZURL, getQzurl());
			}
			if (getAging_period() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_AGING_PERIOD, getAging_period());
			}
        if (getAging_method() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_AGING_METHOD, getAging_method());
        }
			if (getNum_periods() != null)
			{
				requestParameters.put(RequestElements.REPORT_PARAM_NUM_PERIOD, getNum_periods());
			}
        if (getTerm() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_TERM, getTerm());
        }
        if (getColumns() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_COLUMNS, getColumns());
        }
        if (getSort_by() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_SORT_BY, getSort_by());
        }
        if (getSort_order() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_SORT_ORDER, getSort_order());
        }
        if (getGroup_by() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_GROUP_BY, getGroup_by());
        }

        if (getCreatedate_macro() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_CREATE_DT_MACRO, getCreatedate_macro());
        }
        if (getEnd_createdate() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_END_CREATED_DT, getEnd_createdate());
        }
        if (getStart_createdate() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_START_CREATED_DT, getStart_createdate());
        }
        if (getModdate_macro() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_MOD_DT_MACRO, getModdate_macro());
        }
        if (getEnd_moddate() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_END_MOD_DT, getEnd_moddate());
        }
        if (getStart_moddate() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_START_MOD_DT, getStart_moddate());
        }
        if (getPayment_method() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_PAYMENT_METHOD, getPayment_method());
        }
        if (getName() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_NAME, getName());
        }
        if (getTransaction_type() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_TRANSACTION_TYPE, getTransaction_type());
        }
        if (getCleared() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_CLEARED, getCleared());
        }
        if (getArpaid() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_ARPAID, getArpaid());
        }
        if (getPrinted() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_PRINTED, getPrinted());
        }
        if (getBoth_amount() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_BOTH_AMT, getBoth_amount());
        }
        if (getMemo() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_MEMO, getMemo());
        }
        if (getDoc_num() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_DOC_NUM, getDoc_num());
        }
        if (getJournal_code() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_JOURNAL_CODE, getJournal_code());
        }
        if (getEmployee() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_EMPLOYEE, getEmployee());
        }
        if (getAgency_id() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_AGENCY_ID, getAgency_id());
        }
        if (getCustom1() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_CUSTOM1, getCustom1());
        }
        if (getCustom2() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_CUSTOM2, getCustom2());
        }
        if (getCustom3() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_CUSTOM3, getCustom3());
        }
        if (getShipvia() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_SHIPVIA, getShipvia());
        }
        if (getAccount_status() != null)
        {
            requestParameters.put(RequestElements.REPORT_PARAM_ACCOUNT_STATUS, getAccount_status());
        }

			
			requestElements.setAction(OperationType.REPORTS.toString() + "/" + reportName);
			requestElements.setContext(context);

		return intuitMessage;
	}
531116
@Override
    public void visit(JunitXmlReport report) {

        int testsPassed = report.getTests() - report.getFailures() - report.getErrors();

        Map<String, Pair<Integer, CodeQualityMetricStatus>> metricsMap = new HashMap<>();
        metricsMap.put(TOTAL_NO_OF_TESTS, Pair.of(report.getTests(), CodeQualityMetricStatus.Ok));
        metricsMap.put(TEST_FAILURES, Pair.of(report.getFailures(), report.getFailures() > 0 ? CodeQualityMetricStatus.Warning : CodeQualityMetricStatus.Ok));
        metricsMap.put(TEST_ERRORS, Pair.of(report.getErrors(), report.getErrors() > 0 ? CodeQualityMetricStatus.Alert : CodeQualityMetricStatus.Ok));
        metricsMap.put(TEST_SUCCESS_DENSITY, Pair.of(testsPassed, CodeQualityMetricStatus.Ok));

        if (null != report.getTimestamp()) {
            long timestamp = Math.max(quality.getTimestamp(), report.getTimestamp().toGregorianCalendar().getTimeInMillis());
            quality.setTimestamp(timestamp);
        }
        quality.setType(CodeQualityType.StaticAnalysis);

        // finally produce the result
        this.sumMetrics(metricsMap);

    }
425423
private void sendReport(@NonNull File report, boolean onlySendSilentReports) {
        if (enabled) {
            schedulerStarter.scheduleReports(report, onlySendSilentReports);
        } else {
            ACRA.log.w(LOG_TAG, "Would be sending reports, but ACRA is disabled");
        }
    }
1003313
protected function processDatabaseOptions (Report $report)
    {
        // NOTE: Check whether database connection details have been set
        if (false === $this->getDatabase('name') && false === $report->getDatabase('name')) {
            return '';
        }

        // NOTE: Initialize $value for each command option testing the individual 
        //       report values for emptiness and defaulting to controlling object
        $database = '';

        $value = empty($report->getDatabase('host')) ? $this->getDatabase('host') : $report->getDatabase('host');
        $database .= empty($value) ? '' : "-H $value ";

        $value = empty($report->getDatabase('user')) ? $this->getDatabase('user') : $report->getDatabase('user');
        $database .= empty($value) ? '' : "-u $value ";

        $value = empty($report->getDatabase('pass')) ? $this->getDatabase('pass') : $report->getDatabase('pass');
        $database .= empty($value) ? '' : "-p $value ";

        $value = empty($report->getDatabase('name')) ? $this->getDatabase('name') : $report->getDatabase('name');
        $database .= empty($value) ? '' : "-n $value ";

        $value = empty($report->getDatabase('port')) ? $this->getDatabase('port') : $report->getDatabase('port');
        $database .= empty($value) ? '' : "--db-port $value ";

        // JDBC options
        $value = empty($report->getDatabase('url')) ? $this->getDatabase('url') : $report->getDatabase('url');
        $database .= empty($value) ? '' : "--db-url $value";

        $value = empty($report->getDatabase('dir')) ? $this->getDatabase('dir') : $report->getDatabase('dir');
        $database .= empty($value) ? '' : "--jdbc-dir $value ";

        $value = empty($report->getDatabase('class')) ? $this->getDatabase('class') : $report->getDatabase('class');
        $database .= empty($value) ? '' : "--db-driver $value ";

        // Oracle SID
        $value = empty($report->getDatabase('sid')) ? $this->getDatabase('sid') : $report->getDatabase('sid');
        $database .= empty($value) ? '' : "--db-sid $value ";

        return $database;
    }
1347437
public function report(Exception $exception)
    {
        $enableEmailExceptions = config('exceptions.emailExceptionEnabled');

        if ($enableEmailExceptions === '') {
            $enableEmailExceptions = config('exceptions.emailExceptionEnabledDefault');
        }

        if ($enableEmailExceptions) {
            if ($this->shouldReport($exception)) {
                $this->sendEmail($exception);
            }
        }

        parent::report($exception);
    }
731595
public function execute(IDS_Report $data) 
    {
    	// make sure request uri is set right on IIS
        if (!isset($_SERVER['REQUEST_URI'])) {
            $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'], 1);
            if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']) { 
                $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; 
            } 
        } 
        
        // make sure server address is set right on IIS
        if (isset($_SERVER['LOCAL_ADDR'])) {
            $_SERVER['SERVER_ADDR'] = $_SERVER['LOCAL_ADDR'];
        } 
    	
        foreach ($this->loggers as $logger) {
            $logger->execute($data);
        }
    }
28662
protected static function processTableFormat($reportMetadata, $report, $reportColumns)
    {
        $finalReport = $report;
        if (empty($reportMetadata['dimension'])) {
            $simpleReportMetrics = $report->getFirstRow();
            if ($simpleReportMetrics) {
                $finalReport = new Simple();
                foreach ($simpleReportMetrics->getColumns() as $metricId => $metric) {
                    $newRow = new Row();
                    $newRow->addColumn("label", $reportColumns[$metricId]);
                    $newRow->addColumn("value", $metric);
                    $finalReport->addRow($newRow);
                }
            }

            $reportColumns = array(
                'label' => Piwik::translate('General_Name'),
                'value' => Piwik::translate('General_Value'),
            );
        }

        return array(
            $finalReport,
            $reportColumns,
        );
    }
171841
public function updateTaskReport($taskId, $report)
    {
        if ($this->getPersistence()->has($taskId)) {
            $this->getPersistence()->setReport($taskId, $report);
        }
        return $this;
    }
246187
public function savePid($pid, JobReportInterface $report)
    {
        $report->setPid($pid);
        $this->reportManager->add($report, true);
    }
20354
public function addressbookMultiGetReport($report)
    {
        $contentType = $report->contentType;
        $version = $report->version;
        if ($version) {
            $contentType .= '; version='.$version;
        }

        $vcardType = $this->negotiateVCard(
            $contentType
        );

        $propertyList = [];
        $paths = array_map(
            [$this->server, 'calculateUri'],
            $report->hrefs
        );
        foreach ($this->server->getPropertiesForMultiplePaths($paths, $report->properties) as $props) {
            if (isset($props['200']['{'.self::NS_CARDDAV.'}address-data'])) {
                $props['200']['{'.self::NS_CARDDAV.'}address-data'] = $this->convertVCard(
                    $props[200]['{'.self::NS_CARDDAV.'}address-data'],
                    $vcardType
                );
            }
            $propertyList[] = $props;
        }

        $prefer = $this->server->getHTTPPrefer();

        $this->server->httpResponse->setStatus(207);
        $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8');
        $this->server->httpResponse->setHeader('Vary', 'Brief,Prefer');
        $this->server->httpResponse->setBody($this->server->generateMultiStatus($propertyList, 'minimal' === $prefer['return']));
    }