<commit_before><?php

namespace Biopen\SaasBundle\Helper;

class SaasHelper
{
   // GoGoCarto can be use as a SAAS. in this case, each subdomain map a projet
   // project1.gog.carto, project2.gogo.carto etc...
   // by default, the projet code is "gogocarto_default"
   public function getCurrentProjectCode()
   {
      $dbName = "gogocarto_default";
      $host = $_SERVER["HTTP_HOST"];
      if ($host)
      {
         $exploded = explode('.', $host);
         $subdomain = $exploded[0];
         if (count($exploded) >= 3 && !in_array($subdomain, ['dev', 'test', 'demo', 'carto', 'carto-dev', 'www'])) $dbName = $subdomain;
      }
      return $dbName;
   }

   // return the Url to the actual public folder (the web/ folder)
   public function getPublicFolderUrl()
   {
      if (isset($_SERVER["HHTTP_ORIGIN"])) $url = $_SERVER["HHTTP_ORIGIN"];
      else
      {
         $url = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["HTTP_HOST"];
         if (strpos($url, 'localhost') !== false) $url .= explode('/app',$_SERVER["SCRIPT_NAME"])[0]; // ugly fix to support localhost !
      }
         
      return $url;
   }
}
<commit_msg>Fixes typo<commit_after><?php

namespace Biopen\SaasBundle\Helper;

class SaasHelper
{
   // GoGoCarto can be use as a SAAS. in this case, each subdomain map a projet
   // project1.gog.carto, project2.gogo.carto etc...
   // by default, the projet code is "gogocarto_default"
   public function getCurrentProjectCode()
   {
      $dbName = "gogocarto_default";
      $host = $_SERVER["HTTP_HOST"];
      if ($host)
      {
         $exploded = explode('.', $host);
         $subdomain = $exploded[0];
         if (count($exploded) >= 3 && !in_array($subdomain, ['dev', 'test', 'demo', 'carto', 'carto-dev', 'www'])) $dbName = $subdomain;
      }
      return $dbName;
   }

   // return the Url to the actual public folder (the web/ folder)
   public function getPublicFolderUrl()
   {
      if (isset($_SERVER["HTTP_ORIGIN"])) $url = $_SERVER["HTTP_ORIGIN"];
      else
      {
         $url = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["HTTP_HOST"];
         if (strpos($url, 'localhost') !== false) $url .= explode('/app',$_SERVER["SCRIPT_NAME"])[0]; // ugly fix to support localhost !
      }
         
      return $url;
   }
}

{'fraction_non_alphanumeric': 0.16498464238701185, 'fraction_numerical': 0.004387889425186486, 'mean_word_length': 2.7133550488599347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5889994', 'n_tokens_mistral': 762, 'n_tokens_neox': 763, 'n_words': 187}