Exports log messages to a specific destination.
Child classes must implement this method.
@throws \yii\base\Exception
433314
public function export()
    {
        $path = $this->module->dataPath;
        FileHelper::createDirectory($path, $this->module->dirMode);

        $summary = $this->collectSummary();
        $dataFile = "$path/{$this->tag}.data";
        $data = [];
        $exceptions = [];
        foreach ($this->module->panels as $id => $panel) {
            try {
                $data[$id] = serialize($panel->save());
            } catch (\Exception $exception) {
                $exceptions[$id] = new FlattenException($exception);
            }
        }
        $data['summary'] = $summary;
        $data['exceptions'] = $exceptions;

        file_put_contents($dataFile, serialize($data));
        if ($this->module->fileMode !== null) {
            @chmod($dataFile, $this->module->fileMode);
        }

        $indexFile = "$path/index.data";
        $this->updateIndexFile($indexFile, $summary);
    }
532212
protected function _logTraffic() {
        if ('testing' !== APPLICATION_ENV) {
            $lastRequest = $this->_client->getLastRequest();
            $lastResponse = $this->_client->getLastResponse();
            $filename = date('Y-m-d').'-gofilex.log';
            $logMessage  = "\n";
            $logMessage .= '[REQUEST]'."\n";
            $logMessage .= $lastRequest."\n\n";
            $logMessage .= '[RESPONSE]'."\n";
            $logMessage .= $lastResponse."\n\n";

            dump($filename, $logMessage);
        }
    }
930917
protected function output()
    {
        // first get content to local var
        $content = $this->getContentRaw();

        // iterate log content
        foreach ($content as $logEntry) {
            // Get color
            $color = $this->getColorByType($logEntry['type']);

            // Show the message
            pre(
                $logEntry['time'].' '.
                '['.$logEntry['type'].'] '.
                $logEntry['fingerprint'].' '.
                $logEntry['message'].
                $this->getLineSeparator(),
                false,
                $color
            );
        }

        // So we can clear the existing log
        $this->clear();
    }
165199
public function export()
    {
        if ($this->config == null) {
            throw new LogicException('Context must be set before export the service.');
        }

        if ($this->dispatcher == null) {
            throw new LogicException('Dispatcher must be set before export the service.');
        }

        $this->dispatcher->exportInvoker(
            $this->getInvoker()
        );
    }
57281
public function actionSend()
    {
        $model = new MessageSendForm();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['index']);
        }
        return $this->render('send', ['model' => $model]);
    }
743463
public function export()
    {
        // Check if value is cached and set array to cached version
        if (Cache::has(config('laravel-localization.caches.key'))) {
            $this->strings = Cache::get(config('laravel-localization.caches.key'));

            return $this;
        }

        foreach (config('laravel-localization.paths.lang_dirs') as $dir) {
            try {

                // Collect language files and build array with translations
                $files = $this->findLanguageFiles($dir);

                // Parse translations and create final array
                array_walk($files['lang'], [$this, 'parseLangFiles'], $dir);
                array_walk($files['vendor'], [$this, 'parseVendorFiles'], $dir);
                array_walk($files['json'], [$this, 'parseJsonFiles'], $dir);
            } catch (\Exception $exception) {
                \Log::critical('Can\'t read lang directory '.$dir.', error: '.$exception->getMessage());
            }
        }

        // Trigger event for final translated array
        event(new LaravelLocalizationExported($this->strings));

        // If timeout > 0 save array to cache
        if (config('laravel-localization.caches.timeout', 0) > 0) {
            Cache::store(config('laravel-localization.caches.driver', 'file'))
                 ->put(
                     config('laravel-localization.caches.key', 'localization.array'),
                     $this->strings,
                     config('laravel-localization.caches.timeout', 60)
                 );
        }

        return $this;
    }
556618
public function export()
    {
        return array(
            self::COLUMNS => $this->getArrayCopy(),
            self::METADATA => $this->metadata,
            self::DATATABLE_ASSOCIATED => $this->subtableId,
        );
    }
872601
public function logAction()
    {
        $flashMessenger = $this->getServiceLocator()->get('MelisCoreFlashMessenger');
        
        $success = $this->params()->fromRoute('success', $this->params()->fromQuery('success', ''));
        $title   = $this->params()->fromRoute('textTitle', $this->params()->fromQuery('textTitle', ''));
        $message = $this->params()->fromRoute('textMessage', $this->params()->fromQuery('textMessage', ''));
        $typeCode = $this->params()->fromRoute('typeCode', $this->params()->fromQuery('typeCode', ''));
        $itemId = $this->params()->fromRoute('itemId', $this->params()->fromQuery('itemId', ''));
    
        $img = $success == 1 ? $flashMessenger::INFO : $flashMessenger::WARNING;
    
        $flashMessenger->addToFlashMessenger($title, $message, $img);
        
        $logSrv = $this->getServiceLocator()->get('MelisCoreLogService');
        $logSrv->saveLog($title, $message, $success, $typeCode, $itemId);
    }
567528
protected function createOutgoingMessage()
    {
        $message = new OutgoingMessage($this->container['view']);

        //If a from address is set, pass it along to the message class.
        if (isset($this->from)) {
            $message->from($this->from);
        }

        return $message;
    }
1223048
public function export()
    {
        if (!$this->isXmlHttpRequest()) {
            throw new \Exception('Only ajax call allowed.');
        }

        if (!$this->hasRequestParameter(self::PARAMETER_DELIVERY_CLASS_URI) && !$this->hasRequestParameter(self::PARAMETER_DELIVERY_URI)) {
            throw new \common_Exception('Parameter "'. self::PARAMETER_DELIVERY_CLASS_URI .'" or "'. self::PARAMETER_DELIVERY_URI .'" missing');
        }

        $resourceUri = $this->hasRequestParameter(self::PARAMETER_DELIVERY_URI)
            ? \tao_helpers_Uri::decode($this->getRequestParameter(self::PARAMETER_DELIVERY_URI))
            : \tao_helpers_Uri::decode($this->getRequestParameter(self::PARAMETER_DELIVERY_CLASS_URI));

        /** @var ResultsExporter $exporter */
        $exporter = $this->propagate(new ResultsExporter($resourceUri, ResultsService::singleton()));

        return $this->returnTaskJson($exporter->createExportTask());
    }
928816
public function exportAction()
    {
        $request = $this->getRequest();
        if (!$request->isPost()) {
            $this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
        }

        $orderIds = $this->getRequest()->getPost('order_ids', array());

        try {
            // Build the CSV and retrieve its path
            $filePath = Mage::getModel('australia/shipping_carrier_eparcel_export_csv')->exportOrders($orderIds);

            // Download the file
            $this->_prepareDownloadResponse(basename($filePath), file_get_contents($filePath));
        } catch (Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
            $this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
        }
    }
777069
public function Export() {
      $this->Permission('Garden.Export'); // This permission doesn't exist, so only users with Admin == '1' will succeed.

      set_time_limit(60*2);
      $Ex = new ExportModel();
      $Ex->PDO(Gdn::Database()->Connection());
      $Ex->Prefix = Gdn::Database()->DatabasePrefix;

      /// 2. Do the export. ///
      $Ex->UseCompression = TRUE;
      $Ex->BeginExport(PATH_ROOT.DS.'uploads'.DS.'export '.date('Y-m-d His').'.txt.gz', 'Vanilla 2.0');

      $Ex->ExportTable('User', 'select * from :_User'); // ":_" will be replace by database prefix
      $Ex->ExportTable('Role', 'select * from :_Role');
      $Ex->ExportTable('UserRole', 'select * from :_UserRole');

      $Ex->ExportTable('Category', 'select * from :_Category');
      $Ex->ExportTable('Discussion', 'select * from :_Discussion');
      $Ex->ExportTable('Comment', 'select * from :_Comment');

      $Ex->ExportTable('Conversation', 'select * from :_Conversation');
      $Ex->ExportTable('UserConversation', 'select * from :_UserConversation');
      $Ex->ExportTable('ConversationMessage', 'select * from :_ConversationMessage');

      $Ex->EndExport();
   }
454336
public function export()
    {
        $rows = [];
        foreach ($this->messages as $message) {
            list($text, $level, $category, $timestamp) = $message;
            if (!is_string($text)) {
                // exceptions may not be serializable if in the call stack somewhere is a Closure
                if ($text instanceof \Throwable || $text instanceof \Exception) {
                    $text = (string) $text;
                } else {
                    $text = VarDumper::export($text);
                }
            }
            $rows[] = [
                'level' => $level,
                'category' => $category,
                'log_time' => $timestamp,
                'prefix' => $this->getMessagePrefix($message),
                'message' => $text,
            ];
        }

        $this->db->getCollection($this->logCollection)->batchInsert($rows);
    }
365869
public function exportTrackAction()
    {
        if ($this->exportTrackSnippets) {
            $params = $this->_processParameters($this->exportTrackParameters);

            $this->addSnippets($this->exportTrackSnippets, $params);
        }
    }
1000774
public function logException($exception)
    {
        if (!$this->inExceptionHandler)
        {
            Yii::$app->bugsnag->notifyException($exception);
        }

        try
        {
            Yii::error("Caught exception " . get_class($exception) . ": " . (string)$exception, BugsnagComponent::IGNORED_LOG_CATEGORY);
        }
        catch (\Exception $e) {}
    }
887548
public function exportAction()
    {
        $cwd = getcwd();
        if (substr($cwd, -3) === 'web') {
            chdir($cwd . DIRECTORY_SEPARATOR . '..');
        }

        $output = ['error' => false];

        if ($this->get('ongr_translations.command.export')->run(new ArrayInput([]), new NullOutput()) != 0) {
            $output['error'] = true;
        }

        return new JsonResponse($output);
    }
896356
private function initializeLogFile()
    {
        $this->log = $this->dir.'/builds.log';

        if (!file_exists($this->log)) {
            $data = array(
                'last_update' => null,
                'projects'    => array(),
            );

            file_put_contents($this->log, serialize($data));
        }
    }