<commit_before><?php
class TestController extends CommunecterController {
  
  protected function beforeAction($action) {
	return parent::beforeAction($action);
  }

  public function actionTest() {
	//var_dump(Link::addMember("551a5c00a1aa146d160041b0", PHType::TYPE_ORGANIZATIONS, 
	  //"5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN, Yii::app()->session["userId"], true));

	/*var_dump(Link::connect("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN, Yii::app()->session["userId"]));
	 
	var_dump(Link::isConnected("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN));

	var_dump(Link::disconnect("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN, Yii::app()->session["userId"]));
	
	var_dump(Link::isConnected("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN));
	*/
	//Rest::Json($res);
	$news=PHDB::find(News::COLLECTION);
	foreach ($news as $key => $data){
		if (is_int($data["created"])){
		echo $data["created"];
		$dateCreated= new MongoDate($data["created"]);
		echo "::".date(DATE_ISO8601, $dateCreated->sec)."</br>";
		$res = PHDB::update(News::COLLECTION,
                            array("_id"=>new MongoId($key)), 
                            array('$set' => array("created" => $dateCreated)));
                      echo "</br>";
                      print_r($res);
                      echo '</br>';
        }
		//echo $data["date"];
		//$dateCreated= new MongoDate($data["date"]);
		//echo "::".date(DATE_ISO8601, $dateCreated->sec)."</br>";
		//$dateDate =  new MongoDate( strtotime($data["date"], '%d/%m/%y') );
	if (@$data["date"]){	
		if (is_int($data["date"])){
			echo $data["date"];
			$dateDate= new MongoDate($data["date"]);
			echo "::".date(DATE_ISO8601, $dateDate->sec)."</br>";
			/*$res = PHDB::update(News::COLLECTION,
	                            array("_id"=>new MongoId($key)), 
	                            array('$set' => array("created" => $dateCreated)));
	                      echo "</br>";
	                      print_r($res);
	                      echo '</br>';<commit_msg>If isset($data["created"])<commit_after><?php
class TestController extends CommunecterController {
  
  protected function beforeAction($action) {
	return parent::beforeAction($action);
  }

  public function actionTest() {
	//var_dump(Link::addMember("551a5c00a1aa146d160041b0", PHType::TYPE_ORGANIZATIONS, 
	  //"5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN, Yii::app()->session["userId"], true));

	/*var_dump(Link::connect("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN, Yii::app()->session["userId"]));
	 
	var_dump(Link::isConnected("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN));

	var_dump(Link::disconnect("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN, Yii::app()->session["userId"]));
	
	var_dump(Link::isConnected("54fed0eca1aa1411180041ae", PHType::TYPE_CITOYEN, 
	  "5374fc91f6b95c9c1b000871", PHType::TYPE_CITOYEN));
	*/
	//Rest::Json($res);
	$news=PHDB::find(News::COLLECTION);
	foreach ($news as $key => $data){
		if (@$data["created"]){	
			if (is_int($data["created"])){
			echo $data["created"];
			$dateCreated= new MongoDate($data["created"]);
			echo "::".date(DATE_ISO8601, $dateCreated->sec)."</br>";
			$res = PHDB::update(News::COLLECTION,
	                            array("_id"=>new MongoId($key)), 
	                            array('$set' => array("created" => $dateCreated)));
	                      echo "</br>";
	                      print_r($res);
	                      echo '</br>';
	        }
        }
		//echo $data["date"];
		//$dateCreated= new MongoDate($data["date"]);
		//echo "::".date(DATE_ISO8601, $dateCreated->sec)."</br>";
		//$dateDate =  new MongoDate( strtotime($data["date"], '%d/%m/%y') );
	if (@$data["date"]){	
		if (is_int($data["date"])){
			echo $data["date"];
			$dateDate= new MongoDate($data["date"]);
			echo "::".date(DATE_ISO8601, $dateDate->sec)."</br>";
			/*$res = PHDB::update(News::COLLECTION,
	                            array("_id"=>new MongoId($key)), 
	                            array('$set' => array("created" => $dateCreated)));
	                      echo "</br>";
	                      print_r($res);
	                      echo '</br>';
{'fraction_non_alphanumeric': 0.19744098830796383, 'fraction_numerical': 0.07500551511140525, 'mean_word_length': 3.44946025515211, 'pattern_counts': {'":': 6, '<': 19, '<?xml version=': 0, '>': 43, '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': '495499', 'n_tokens_mistral': 1913, 'n_tokens_neox': 1589, 'n_words': 208}