title: PHP Fatal error: Class 'SmartySecurity' not found
body: <p>Been pulling my hair for 2 hours on this Smarty 2.6 to Smarty 3.1 upgrade task for that old website.  The reason is that the host is now PHP 7 only.  No more PHP 5.  I thought it would be a 1 hour deal, but it's quickly turning into a nightmare.  I remember using Smarty back in 2005 and I've never used it ever again, but today, nearly 15 years later, this monstrosity of a template engine is haunting me back!</p>
  
  <p>Here's the init PHP file's contents:</p>
  
  <pre><code>&lt;?php
  
  #Load Smarty library
  #require_once("php/Smarty-2.6.26/libs/Smarty.class.php");
  #require_once("php/smarty-3.1.34/libs/Smarty.class.php");
  require_once("php/smarty-3.1.34/libs/SmartyBC.class.php");
  require_once("php/smarty-3.1.34/libs/sysplugins/smarty_security.php");
  
  class class_init extends SmartyBC {
  
      function __construct(){
          #Init
          parent::__construct();
  
          #Directories
          $this-&gt;template_dir = "skin/".SKIN."/public/";
          $this-&gt;compile_dir  = "skin/".SKIN."/compile/";
          $this-&gt;config_dir   = "skin/".SKIN."/config/";
          $this-&gt;cache_dir    = "skin/".SKIN."/cache/";
  
          #Caching
          $this-&gt;caching          = (boolean)SMARTY_CACHING;
          $this-&gt;cache_lifetime   = (int)SMARTY_CACHE_LIFETIME;
          $this-&gt;debugging        = true;
      }
  
      function is_cached($str_tpl, $cache_id = NULL, $compile_id = NULL){
          return $this-&gt;isCached($str_tpl, $cache_id, $compile_id);
      }
  }
  
  class MySecurity extends SmartySecurity {
      public $secure_dir = array('/home/lesclownsducarro/public_html/'); 
  
      public function __construct(Smarty $smarty){
          parent::__construct($smarty);
      }
  }
  
  
  ?&gt;
  </code></pre>
  
  <p>Here's the controller file's contents:</p>
  
  <pre><code>require_once("./php/class/init.php");
  $_ENV['class_init'] = new class_init();
  $securityPolicy = new Smarty_Security($_ENV['class_init']);
  $securityPolicy-&gt;php_handling = \Smarty::PHP_ALLOW;
  $_ENV['class_init']-&gt;enableSecurity($securityPolicy);
  </code></pre>
  
  <p>Getting a completely blank page and the error_log simply states:</p>
  
  <pre><code>[30-Dec-2019 22:22:40 UTC] PHP Fatal error:  Class 'SmartySecurity' not found in /home/xxxxx/public_html/php/class/init.php on line 32
  </code></pre>
  
  <p>FOR BACKWARDS COMPATIBILITY, I need to use SmartyBC because the template is including PHP files all over the place.  inb4 yes I know, and this is not my website.</p>
  
  <p>Any ideas ?</p>