<commit_before><?php
/**
 * Created by PhpStorm.
 * User: mathi
 * Date: 12.04.2017
 * Time: 17:07
 */

namespace BergclubPlugin\Export;


use BergclubPlugin\MVC\Helpers;
use BergclubPlugin\MVC\Models\Option;
use BergclubPlugin\MVC\Models\User;

class Download
{
    private function hasDownload(){
        return
            isset($_GET['page']) && $_GET['page'] == 'bergclubplugin-export-controllers-maincontroller' && isset($_GET['download'])
            && ($_GET['download'] == 'addresses' || $_GET['download'] == 'shipping' || $_GET['download'] == 'members' || $_GET['download'] == 'contributions' || $_GET['download'] == 'touren' || $_GET['download'] == 'calendar');
    }

    public function detectDownload(){
        if($this->hasDownload()){
            if($_GET['download'] == "calendar" || $this->checkRights()) {
                $method = "download" . Helpers::snakeToCamelCase($_GET['download'], true);
                if (method_exists($this, $method)) {
                    $this->$method();
                }
            }
        }
    }

    private function downloadAddresses(){
        $this->downloadExcel('Versandliste Komplett', $this->dataAddresses('adresses'));
    }

    private function downloadShipping(){
        $this->downloadExcel('Versandliste Programm', $this->dataAddresses('program_shipment'));<commit_msg>Update donwload<commit_after><?php
/**
 * Created by PhpStorm.
 * User: mathi
 * Date: 12.04.2017
 * Time: 17:07
 */

namespace BergclubPlugin\Export;


use BergclubPlugin\MVC\Helpers;
use BergclubPlugin\MVC\Models\Option;
use BergclubPlugin\MVC\Models\User;

class Download
{
    private function hasDownload(){
        return
            isset($_GET['page']) && $_GET['page'] == 'bergclubplugin-export-controllers-maincontroller' && isset($_GET['download'])
            && ($_GET['download'] == 'addresses' || $_GET['download'] == 'shipping' || $_GET['download'] == 'members' || $_GET['download'] == 'contributions' || $_GET['download'] == 'touren' || $_GET['download'] == 'calendar');
    }

    public function detectDownload(){
        if($this->hasDownload()){
            if($_GET['download'] == "calendar" || $this->checkRights()) {
                $method = "download" . Helpers::snakeToCamelCase($_GET['download'], true);
                if (method_exists($this, $method)) {
                    set_time_limit (0);
                    $this->$method();
                }
            }
        }
    }

    private function downloadAddresses(){
        $this->downloadExcel('Versandliste Komplett', $this->dataAddresses('adresses'));
    }

    private function downloadShipping(){
        $this->downloadExcel('Versandliste Programm', $this->dataAddresses('program_shipment'));
{'fraction_non_alphanumeric': 0.17825768667642752, 'fraction_numerical': 0.009150805270863836, 'mean_word_length': 3.1036036036036037, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3315386', 'n_tokens_mistral': 821, 'n_tokens_neox': 783, 'n_words': 136}