title: using components in Cakephp 2+ Shell
body: <p>I am trying to implement a task using the cakephp shell for my application. The task involves running a long running process (hence the need to use the shell).</p>
  
  <p>The function requires me to use a function inside a Component called CommonComponent</p>
  
  <p>Unfortunately whenever i try to include the component i get the following error
  PHP Fatal error:  Class 'Component' not found in /var/www/nginx-test/app/Controller/Component/CommonComponent.php</p>
  
  <p>Here is the CronShell Class which is being called</p>
  
  <pre><code>class CronShell extends AppShell {
     public function main() {
          $this-&gt;out('Hello world.');      
  //  $this-&gt;out(phpinfo());
      }
       public function test()
      {
           $this-&gt;out('Before Import'); 
          App::import('Component', 'Common');
          $this-&gt;out('Import complete');
          // $this-&gt;Common=ClassRegistry::init('CommonComponent');
          $this-&gt;Common =new CommonComponent();
          $this-&gt;out('Initialization complete');
          $this-&gt;Common-&gt;testCron();
           $this-&gt;out('FunctionCall complete');
          //$this-&gt;Common-&gt;saveCacheEntry("name","value");
      }
      }
  </code></pre>
  
  <p>The CommonComponent class is stored as app/Controller/Component/CommonComponent.php and is as follows</p>
  
  <pre><code> class CommonComponent extends Component
  {
   function testCron()
      {    
       $this-&gt;out('Hello world from Component.');
      }
   }
  </code></pre>
  
  <p>Any ideas?</p>