/** * Check which folder caches are not clean */ protected function getDirty() { $purgeData = new PurgeData(); $jobs = $purgeData->getJobs(); $dirty = array(); foreach ($jobs as $key => $job) { if ($job['group'] == 'folders' && $job['count'] > 0) { $dirty[] = $key; } } return $dirty; }
/** * @param InputInterface $input * @param OutputInterface $output * @return int|void */ protected function execute(InputInterface $input, OutputInterface $output) { $this->detectContao($output, true); if (!$this->initContao()) { return; } $purgeData = new PurgeData(); $jobs = $purgeData->getJobs(); $grouped = array('tables' => array(), 'files' => array(), 'custom' => array()); foreach ($jobs as $key => $job) { $grouped[$job['group']][$key] = $job; } foreach ($grouped as $groupKey => $jobs) { $table = array(); foreach ($jobs as $key => $job) { $table[] = array($key, ucwords(str_replace('Purge the ', '', $job['title'])), $job['count'], $job['size']); } $this->writeSection($output, ucfirst($groupKey)); $this->getHelper('table')->setHeaders(array('code', 'title', 'count', 'size'))->renderByFormat($output, $table, $input->getOption('format')); } }