Example #1
0
 /**
  * main method
  *
  * @return void
  * @access public
  */
 public function main()
 {
     if (!$this->args) {
         return $this->help();
     }
     foreach ($this->args as $method) {
         if ($method === '*') {
             foreach ($this->settings as $method => $settings) {
                 $this->out('Looking at ' . $method);
                 list($where, $recursive) = $settings;
                 if ($recursive) {
                     Clear::recursive($where);
                     continue;
                 }
                 Clear::direct($where);
             }
             return;
         }
         if (!isset($this->settings[$method])) {
             return $this->help();
         }
         list($where, $recursive) = $this->settings[$method];
         if (!empty($this->params['appFiles'])) {
             $where = str_replace('_console', '', $where);
         }
         $this->out('Looking at ' . $method);
         if ($recursive) {
             Clear::recursive($where);
             continue;
         }
         Clear::direct($where);
     }
     $this->out(Clear::messages());
 }