<commit_before><?php
defined('EUA_VERSION') or die('Access denied');
/**
 * This is the Controller for the app "events".
 *
 * @package apps/events
 * @author <NAME> <<EMAIL>>
 * @version 0.1.0-dev-11-12-2015
 */

class EventsController extends Controller {
  var $default_module = 'index';

  var $access = array(
    'create'         => 1,
    'create_confirm' => 1
  );

 function detail(array $params) {

   if (isset($params[0])) {
     $event_id = $params[0];
     // Récupérer l'evenement lié depuis le model
     $data = $this->model->getEvent($event_id);

     if (!empty($data['date_debut']) && $data['date_debut'] != '0000-00-00 00:00:00') {
       $date_debut_timestamp = strtotime($data['date_debut']);
       $data['date_debut'] = date('D. d F Y', $date_debut_timestamp);
       $data['heure_debut'] = date('H:i', $date_debut_timestamp);
     } else {
       $data['date_debut'] = null;
       $data['heure_debut'] = null;
     }

     if (!empty($data['date_fin']) && $data['date_fin'] != '0000-00-00 00:00:00') {
       $date_fin_timestamp = strtotime($data['date_fin']);
       $data['date_fin'] = date('D. d F Y', $date_fin_timestamp);
       $data['heure_fin'] = date('H:i', $date_fin_timestamp);
     } else {
       $data['date_fin'] = null;
       $data['heure_fin'] = null;
     }

     // Retourner les infos récupérées
     return $data;
   }

 }

 function create() {<commit_msg>Use strftime() instead of date()<commit_after><?php
defined('EUA_VERSION') or die('Access denied');
/**
 * This is the Controller for the app "events".
 *
 * @package apps/events
 * @author <NAME> <<EMAIL>>
 * @version 0.1.0-dev-11-12-2015
 */

class EventsController extends Controller {
  var $default_module = 'index';

  var $access = array(
    'create'         => 1,
    'create_confirm' => 1
  );

 function detail(array $params) {

   if (isset($params[0])) {
     $event_id = $params[0];
     // Récupérer l'evenement lié depuis le model
     $data = $this->model->getEvent($event_id);

     if (!empty($data['date_debut']) && $data['date_debut'] != '0000-00-00 00:00:00') {
       $date_debut_timestamp = strtotime($data['date_debut']);
       $data['date_debut'] = strftime('%a. %d %b. %Y', $date_debut_timestamp);
       $data['heure_debut'] = strftime('%H:%M', $date_debut_timestamp);
     } else {
       $data['date_debut'] = null;
       $data['heure_debut'] = null;
     }

     if (!empty($data['date_fin']) && $data['date_fin'] != '0000-00-00 00:00:00') {
       $date_fin_timestamp = strtotime($data['date_fin']);
       $data['date_fin'] = strftime('%a. %d %b. %Y', $date_fin_timestamp);
       $data['heure_fin'] = strftime('%H:%M', $date_fin_timestamp);
     } else {
       $data['date_fin'] = null;
       $data['heure_fin'] = null;
     }

     // Retourner les infos récupérées
     return $data;
   }

 }

 function create() {
{'fraction_non_alphanumeric': 0.19237495627841902, 'fraction_numerical': 0.030080447708989155, 'mean_word_length': 3.224519940915805, 'pattern_counts': {'":': 0, '<': 11, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2456774', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1021, 'n_words': 202}