これで シェルから、tweetscontroller を使うことができる。
CronShell.php
<?php
namespace App\Shell;
use Cake\Console\ConsoleOptionParser;
use Cake\Console\Shell;
use Cake\Log\Log;
use Cake\ORM\TableRegistry;
use App\Controller\TweetsController;
/**
*
*
* Simple console wrapper around Psy\Shell.
* /var/www/html/caba-ageha.com/bin/cake
*/
class CronShell extends Shell
{
public function initialize()
{
parent::initialize();
$this->Tweets = new TweetsController();
}
public function main(){
$this->out($this->Tweets->video());
}
// cron を直接実行
// /opt/remi/php70/root/usr/bin/php -c /etc/opt/remi/php70/php.ini /var/www/html/twitube.jp/bin/cake.php cron
}