Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Command;
- use Cake\Command\Command;
- use Cake\Console\Arguments;
- use Cake\Console\ConsoleIo;
- use Cake\Console\ConsoleOptionParser;
- class TicketCommand extends Command
- {
- protected $modelClass = 'Debug';
- public function execute(Arguments $args, ConsoleIo $io)
- {
- $fd = fopen("php://stdin", "r");
- $email_content = "";
- while (!feof($fd)) {
- $email_content .= fread($fd, 1024);
- }
- fclose($fd);
- $data['debug'] = $email_content;
- $debug = $this->Debug->newEmptyEntity();
- $debug = $this->Debug->patchEntity($debug, $data);
- if ($this->Debug->save($debug))
- {
- $io->out('The ticket header has been saved.');
- }else{
- $io->out('The ticket header could not be saved. Please, try again.');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement