<commit_before><?php


namespace frontend\controllers;


use common\models\Redirects;
use common\models\SitePages;
use yii\web\Controller;
use Yii;
use yii\web\Response;


class AssetController extends AppController {


  function actionIndex($asset) {

    $extension = ['.txt', '.json'];

    $response = $this->getAssetBlob($asset);

    if ($response == FALSE) {
      $response = $this->getAssetBlob(strtolower($asset));
    }

    if ($response == FALSE) {
      $response = $this->getAssetBlob(strtoupper($asset));
    }

    if ($response == FALSE) {
      foreach ($extension as $ext) {
        $response = $this->getAssetBlob($asset . $ext);
        if ($response != FALSE) {
          break;
        }
      }
    }


    if ($response == FALSE) {
      foreach ($extension as $ext) {
        $response = $this->getAssetBlob(strtolower($asset . $ext));
        if ($response != FALSE) {
          break;
        }
      }
    }

    if ($response == FALSE) {
      foreach ($extension as $ext) {
        $response = $this->getAssetBlob(strtoupper($asset) . $ext);
        if ($response != FALSE) {
          break;
        }
      }
    }


    $finfo = new \finfo(FILEINFO_MIME);
    header('Content-Type: '.$finfo->buffer($response));

    echo $response;


  }


  function getAssetBlob($asset) {
    return file_get_contents('https://ccnsme.blob.core.windows.net:443/lykke/' . $asset);
  }

}<commit_msg>bag fix asset img<commit_after><?php


namespace frontend\controllers;


use common\models\Redirects;
use common\models\SitePages;
use yii\web\Controller;
use Yii;
use yii\web\Response;


class AssetController extends AppController {


  function actionIndex($asset) {

    $extension = ['.txt', '.json'];

    $response = $this->getAssetBlob($asset);

    if ($response == FALSE) {
      $response = $this->getAssetBlob(strtolower($asset));
    }

    if ($response == FALSE) {
      $response = $this->getAssetBlob(strtoupper($asset));
    }

    if ($response == FALSE) {
      foreach ($extension as $ext) {
        $response = $this->getAssetBlob($asset . $ext);
        if ($response != FALSE) {
          break;
        }
      }
    }


    if ($response == FALSE) {
      foreach ($extension as $ext) {
        $response = $this->getAssetBlob(strtolower($asset . $ext));
        if ($response != FALSE) {
          break;
        }
      }
    }

    if ($response == FALSE) {
      foreach ($extension as $ext) {
        $response = $this->getAssetBlob(strtoupper($asset) . $ext);
        if ($response != FALSE) {
          break;
        }
      }
    }


    $finfo = new \finfo(FILEINFO_MIME);
    
    $header = Yii::$app->getResponse();
    $header->format = Response::FORMAT_RAW;
    $header->headers->add('Content-Type', $finfo->buffer($response));

    return $response;


  }


  function getAssetBlob($asset) {
    return file_get_contents('https://ccnsme.blob.core.windows.net:443/lykke/' . $asset);
  }

}
{'fraction_non_alphanumeric': 0.16185951815405497, 'fraction_numerical': 0.0020359687818120122, 'mean_word_length': 2.451990632318501, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '4319532', 'n_tokens_mistral': 965, 'n_tokens_neox': 919, 'n_words': 183}