Command/SyncDocumentsCommand.php
author ymh <ymh.work@gmail.com>
Sun, 27 Nov 2011 23:48:40 +0100
changeset 45 e25a00a6f9e1
parent 42 0e57c730bb18
child 57 186c4121c7b3
permissions -rwxr-xr-x
Correct syntax error.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/*
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * This file is part of the WikiTagBundle package.
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * (c) IRI <http://www.iri.centrepompidou.fr/>
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 *
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * For the full copyright and license information, please view the LICENSE
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * file that was distributed with this source code.
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 */
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
namespace IRI\Bundle\WikiTagBundle\Command;
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
34
21fab44f46fe add event on tag changed
ymh <ymh.work@gmail.com>
parents: 27
diff changeset
    13
use IRI\Bundle\WikiTagBundle\Event\WikiTagEvents;
21fab44f46fe add event on tag changed
ymh <ymh.work@gmail.com>
parents: 27
diff changeset
    14
use IRI\Bundle\WikiTagBundle\Event\DocumentTagEvent;
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
use Doctrine\ORM\Query;
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
use Symfony\Component\Console\Input\InputArgument;
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
use Symfony\Component\Console\Input\InputInterface;
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
use Symfony\Component\Console\Input\InputOption;
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
use Symfony\Component\Console\Output\OutputInterface;
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    21
/**
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    22
 *
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    23
 * This class implement a command to synchronize the wikita document table and index to the host application documents.
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    24
 * options :
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    25
 * - tags: Synchronize the tag string of the wikitag documents, otherwise, synchronize the document themselves (default not set).
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    26
 *     The tags string is the concatenation (with comma) of all tag's label of a wikita document. It allows the indexation of the tags.
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    27
 * - clear: Clear the wikitag documents. (default not set)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    28
 * - all: if set, process all objects, if not process only those that need it. (default not set)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    29
 *     - --tags not set : if --all is set, recreate a wikitag document for all host document (you may have to run the commant with the clear option first),
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    30
 *         otherwise create only the missing wikitag document.
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    31
 *     - --tags set: if --all is set, recalculate the tags string for all document, otherwise, only calculate the tag string wher it is null.
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    32
 *     - --clear: if --all is set, delete all wikitag documents, otherwise clear only those not linked to a host document.
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    33
 * - force: force document deletion (default not set)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    34
 *
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    35
 * @author ymh
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    36
 *
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    37
 */
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    38
class SyncDocumentsCommand extends ProgressContainerAwareCommand
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
{
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
    protected function configure()
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
    {
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
        parent::configure();
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
        
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
        $this
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
            ->setName('wikitag:sync-doc')
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
            ->setDescription('Synchronize and index document class')
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    47
            ->addOption('force', 'f', InputOption::VALUE_NONE, "Force document deletion")
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
    48
            ->addOption('tags', 't', InputOption::VALUE_NONE, "update tags")
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    49
            ->addOption('clear', 'c', InputOption::VALUE_NONE, "Clear documents")
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    50
            ->addOption('all', 'a', InputOption::VALUE_NONE, "clear all docs");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    51
        
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
    }
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    53
    
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    54
    private function execute_tags(InputInterface $input, OutputInterface $output)
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
    {
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
        $doctrine = $this->getContainer()->get('doctrine');
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
        
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
        $docrep = $doctrine->getRepository('WikiTagBundle:Document');
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    59
        $all = $input->getOption('all');
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
        
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    61
        if($all)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    62
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    63
            $docquery = $doctrine->getEntityManager()->createQuery("SELECT doc from WikiTagBundle:Document doc");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    64
            $doccountquery = $doctrine->getEntityManager()->createQuery("SELECT COUNT(doc.id) from WikiTagBundle:Document doc");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    65
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    66
        else
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    67
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    68
            $docquery = $doctrine->getEntityManager()->createQuery("SELECT doc from WikiTagBundle:Document doc WHERE doc.tagsStr IS NULL");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    69
            $doccountquery = $doctrine->getEntityManager()->createQuery("SELECT COUNT(doc.id) from WikiTagBundle:Document doc WHERE doc.tagsStr IS NULL");
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
        }
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
        
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    72
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    73
        $total = $doccountquery->getSingleScalarResult();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    74
        $done = 0;
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    75
        $iterable = $docquery->iterate();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    76
        $todetach = array();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    77
        while (($row = $iterable->next()) !== false) {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    78
            $done++;
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    79
            $memory = ((($done%10)==0)?" - mem: ".strval(memory_get_usage(true)):"");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    80
            $doc = $row[0];
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    81
            $todetach[] = $doc;
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    82
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    83
            $this->showProgress($output, $done, $total, "id : ".$doc->getId()."%$memory", 50);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    84
            $docrep->updateTagsStr($doc);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    85
            //dispatch event
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    86
            $event_dispatcher = $this->getContainer()->get('event_dispatcher');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    87
            $event = new DocumentTagEvent($doc);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    88
            $event_dispatcher->dispatch(WikiTagEvents::onTagChanged, $event);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    89
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    90
            if($done%10 == 0)
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
    91
            {
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    92
                $doctrine->getEntityManager()->flush();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    93
                foreach($todetach as $obj)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    94
                {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    95
                    $doctrine->getEntityManager()->detach($obj);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    96
                }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    97
                $todetach = array();
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
    98
            }
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
    99
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   100
        $doctrine->getEntityManager()->flush();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   101
        $doctrine->getEntityManager()->clear();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   102
    }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   103
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   104
    private function execute_clear(InputInterface $input, OutputInterface $output)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   105
    {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   106
        $class = $this->getContainer()->getParameter('wiki_tag.document_class');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   107
        $doctrine = $this->getContainer()->get('doctrine');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   108
        $all = $input->getOption('all');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   109
        $force = $input->getOption('force');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   110
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   111
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   112
        if($all)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   113
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   114
            // delete all documents
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   115
            $query_str = "DELETE WikiTagBundle:Document wtdoc";
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   116
            $count_query_str = "SELECT COUNT(wtdoc.id) FROM WikiTagBundle:Document wtdoc";
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   117
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   118
        else
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   119
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   120
            // delete only wikitag document that have no conterpart
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   121
            $query_str = "DELETE WikiTagBundle:Document wtdoc WHERE wtdoc.externalId IS NULL OR wtdoc.externalId NOT IN (SELECT doc FROM $class doc)";
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   122
            $count_query_str = "SELECT COUNT(wtdoc.id) FROM WikiTagBundle:Document wtdoc WHERE wtdoc.externalId IS NULL OR wtdoc.externalId NOT IN (SELECT doc FROM $class doc)";
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   123
        }
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   124
        
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   125
        $count_query = $doctrine->getEntityManager()->createQuery($count_query_str);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   126
        $total = $count_query->getSingleScalarResult();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   127
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   128
        if($total === 0)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   129
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   130
            $output->writeln("No wikitag document to delete. Exit.");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   131
            return;
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   132
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   133
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   134
        $output->writeln("$total wikitag document(s) to delete.");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   135
        if(!$force && $input->isInteractive())
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   136
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   137
            $dialog = $this->getHelper('dialog');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   138
            if (!$dialog->askConfirmation($output, '<question>Confirm deletion? (y/N) : </question>', false)) {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   139
                return;
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   140
            }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   141
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   142
               
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   143
        $req = $doctrine->getEntityManager()->createQuery($query_str);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   144
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   145
        $nb_deleted = $req->getResult();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   146
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   147
        $output->writeln("$nb_deleted wikitag document(s) deleted.");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   148
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   149
        $doctrine->getEntityManager()->flush();
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   150
    
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   151
    }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   152
    
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   153
    private function execute_docs(InputInterface $input, OutputInterface $output)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   154
    {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   155
        $all = $input->getOption('all');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   156
        $doctrine = $this->getContainer()->get('doctrine');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   157
        $docrep = $doctrine->getRepository('WikiTagBundle:Document');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   158
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   159
        if($all)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   160
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   161
            $docquery = $doctrine->getEntityManager()->createQuery("SELECT doc FROM $class doc");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   162
            $doccountquery = $doctrine->getEntityManager()->createQuery("SELECT count(doc.id) FROM $class doc");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   163
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   164
        else
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   165
        {
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   166
            $docquery = $doctrine->getEntityManager()->createQuery("SELECT doc FROM $class doc WHERE doc.id not in (SELECT wtdoc FROM WikiTagBundle:Document wtdoc)");
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   167
            $doccountquery = $doctrine->getEntityManager()->createQuery("SELECT count(doc.id) FROM $class doc WHERE doc.id not in (SELECT wtdoc FROM WikiTagBundle:Document wtdoc)");
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   168
        }
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   169
        $total = $doccountquery->getSingleScalarResult();
24
cd389bf882f1 Some small corrections
ymh <ymh.work@gmail.com>
parents: 23
diff changeset
   170
        $done = 0;
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   171
        $iterable = $docquery->iterate();
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   172
        while (($row = $iterable->next()) !== false) {
24
cd389bf882f1 Some small corrections
ymh <ymh.work@gmail.com>
parents: 23
diff changeset
   173
            $done++;
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   174
            $doc = $row[0];
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   175
            $memory = ((($done%10)==0)?" - mem: ".strval(memory_get_usage(true)):"");
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   176
            $this->showProgress($output, $done, $total, "id : ".$doc->getId()."%$memory", 50);
23
b435f8055cb4 improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents: 6
diff changeset
   177
            $docrep->writeDocument($doc, $this->getContainer()->getParameter('wiki_tag.document_id_column'), $this->getContainer()->getParameter('wiki_tag.fields'));
27
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   178
            if($done%10 == 0)
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   179
            {
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   180
                $doctrine->getEntityManager()->flush();
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   181
                $doctrine->getEntityManager()->clear();
8551d844b4f3 Correct memory problem
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
   182
            }
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
        }
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
        $doctrine->getEntityManager()->flush();
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   185
        $doctrine->getEntityManager()->clear();
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
        
42
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   187
    }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   188
    
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   189
    
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   190
    protected function execute(InputInterface $input, OutputInterface $output)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   191
    {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   192
        $clear = $input->getOption('clear');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   193
        $tags = $input->getOption('tags');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   194
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   195
     
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   196
        $class = $this->getContainer()->getParameter('wiki_tag.document_class');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   197
        $doctrine = $this->getContainer()->get('doctrine');
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   198
        $rep = $doctrine->getRepository($class);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   199
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   200
        if(is_null($rep))
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   201
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   202
            $output->writeln("$class does not have a repository : exiting.");
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   203
            return ;
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   204
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   205
        
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   206
        if($tags)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   207
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   208
            $this->execute_tags($input, $output);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   209
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   210
        elseif($clear)
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   211
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   212
            $this->execute_clear($input, $output);
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   213
        }
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   214
        else
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   215
        {
0e57c730bb18 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents: 34
diff changeset
   216
            $this->execute_docs($input, $output);
6
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
        }
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
    }
2dcfef6e75c3 add command to sync documents
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
}
h`5CC;ì2JyCP{MEP~xd 0eXxįпU{:!l5V[ul6 ?^2 !, d=T>*%02WBPR/|?:A`X0{Uj`Z2E-%ZUy*ʰU|  460dUY U,c:zG#D8#]W5X6ʫ:qr;!<64;GaʮCa60ypbSpCE;C!J a!|֑sU a+z^1zC!D2`kx(#*$VCR0`iInPTW TC!/ 8^7Uhh6uU}}b Ujc VU 2eU_ʰ=}RdODQ'{ 0`C*40` UZ0` 0`VUhh`  診ʇ#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