title: Codeigniter get_instance function from external script
body: <p>I am calling from the shell a php file that is not in the Codeigniter application folder and so I need an instance of the application and I have used</p>
  
  <pre><code>&lt;?php 
  
  const BASEPATH = "/"; 
  require './system/core/Controller.php';
  
  $CI =&amp; CI_Controller::get_instance();
  var_dump($CI-&gt;load-&gt;helper('url'));
  </code></pre>
  
  <p>but I get error:</p>
  
  <pre><code>PHP Notice:  Trying to get property 'load' of non-object
  </code></pre>