This repository has been archived by the owner on Jul 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bernhard Posselt
committed
Mar 21, 2015
1 parent
35550fe
commit f6bf8ce
Showing
8 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* ownCloud - News | ||
* | ||
* This file is licensed under the Affero General Public License version 3 or | ||
* later. See the COPYING file. | ||
* | ||
* @author Bernhard Posselt <[email protected]> | ||
* @copyright Bernhard Posselt 2015 | ||
*/ | ||
|
||
$newsApp = new OCA\News\AppInfo\Application(); | ||
$newsCmd = $newsApp->getContainer()->query('OCA\News\Command\GenerateSearchIndices'); | ||
|
||
$application->add($newsCmd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* ownCloud - News | ||
* | ||
* This file is licensed under the Affero General Public License version 3 or | ||
* later. See the COPYING file. | ||
* | ||
* @author Bernhard Posselt <[email protected]> | ||
* @copyright Bernhard Posselt 2015 | ||
*/ | ||
|
||
namespace OCA\News\Command; | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Helper\ProgressBar; | ||
|
||
use OCA\News\Service\ItemService; | ||
|
||
|
||
class GenerateSearchIndices extends Command { | ||
|
||
private $service; | ||
|
||
public function __construct(ItemService $service) { | ||
parent::__construct(); | ||
$this->service = $service; | ||
} | ||
|
||
protected function configure() { | ||
$this->setName('news:create-search-indices') | ||
->setDescription('Recreates the search indices for all items'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) { | ||
$output->writeln("\nCreating search indices, this could take a while...\n"); | ||
$progressbar = function ($steps) use ($output) { | ||
return new ProgressBar($output, $steps); | ||
}; | ||
$this->service->generateSearchIndicies($progressbar); | ||
$output->writeln("\n"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters