title: Symfony - load custom global functions
body: <p>I have a file with some functions (polyfills for some extensions) without namespace that should be loaded and accessible globally.</p>
  
  <p>Question is where to put this file (now it in "/src/AppBundle" dir) and how to load it in Symfony? Maybe some best practice or something.</p>
  
  <p>File exmaple:</p>
  
  <pre><code>&lt;?php
  
  // functions.php
  
  define('CONSTANT_NAME', 'constant_value');
  
  function doSomething()
  {
  }
  </code></pre>
  
  <p>Updated: also some functions should be loaded (in a separated file) only in "dev" environment. Maybe add "include_once" in app_dev.php?</p>