Swapnil Patil
Swapnil Patil

Reputation: 979

Class 'App' not found while running cakephp shell

Below is my shell class

FriendShell.php

require_once 'AppShell.php';

class FriendShell extends AppShell
{
      //code
}

AppShell.php

App::uses('Shell', 'Console');

class AppShell extends Shell {
    public function perform() {
        $this->initialize();
        $this->{array_shift($this->args)}();
    }
}

Reference to issue on

https://github.com/kamisama/Cake-Resque/issues/25

I removed

App::uses('AppShell', 'Console/Command');

and now using

require_once 'AppShell.php';

in FriendShell.php

But problem still remains because AppShell.php using

App::uses('Shell', 'Console');

That's why I am getting error Class 'App' not found when trying to run that shell.

Any help appreciated

Thank you

Upvotes: 0

Views: 2336

Answers (1)

Swapnil Patil
Swapnil Patil

Reputation: 979

Working with

Console/cake 

It is CakeResque plugin and FriendShell.php is a job class therefore whole command is look like this now

Console/cake CakeResque.CakeResque enqueue default Friend "swapnil"

Upvotes: 1

Related Questions