<commit_before><?php
/**
 * This file is part of OXID Console.
 *
 * OXID Console is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * OXID Console is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with OXID Console.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author    OXID Professional services
 * @link      http://www.oxid-esales.com
 * @copyright (C) OXID eSales AG 2003-2014
 */

/**
 * Console Update command
 *
 * Runs OXID Console Update manager
 */
class ConsoleUpdateCommand extends oxConsoleCommand
{

    /**
     * {@inheritdoc}
     */
    public function configure()
    {
        $this->setName( 'console:update' );
        $this->setDescription( 'Update your console application' );
    }

    /**
     * {@inheritdoc}
     */
    public function help( oxIOutput $oOutput )
    {
        $oOutput->writeLn( 'Usage: console:update' );
        $oOutput->writeLn();
        $oOutput->writeLn( 'This command runs an update manager of OXID Console' );
    }

    /**
     * {@inheritdoc}
     */
    public function execute( oxIOutput $oOutput )
    {
        oxRegistry::get( 'oxConsoleUpdateManager' )->run( $oOutput );

        $aCommands = $this->getConsoleApplication()->getLoadedCommands();
        if ( isset( $aCommands['cache:clear'] ) ) {
            $aCommands['cache:clear']->execute( $oOutput );
        }
    }
}<commit_msg>Set console applicatio and input for calling cache:clear command in console:update command<commit_after><?php
/**
 * This file is part of OXID Console.
 *
 * OXID Console is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * OXID Console is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with OXID Console.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author    OXID Professional services
 * @link      http://www.oxid-esales.com
 * @copyright (C) OXID eSales AG 2003-2014
 */

/**
 * Console Update command
 *
 * Runs OXID Console Update manager
 */
class ConsoleUpdateCommand extends oxConsoleCommand
{

    /**
     * {@inheritdoc}
     */
    public function configure()
    {
        $this->setName( 'console:update' );
        $this->setDescription( 'Update your console application' );
    }

    /**
     * {@inheritdoc}
     */
    public function help( oxIOutput $oOutput )
    {
        $oOutput->writeLn( 'Usage: console:update' );
        $oOutput->writeLn();
        $oOutput->writeLn( 'This command runs an update manager of OXID Console' );
    }

    /**
     * {@inheritdoc}
     */
    public function execute( oxIOutput $oOutput )
    {
        oxRegistry::get( 'oxConsoleUpdateManager' )->run( $oOutput );

        // Executing cache:clear command
        // TODO: Refactor this place because it looks nasty
        $aCommands = $this->getConsoleApplication()->getLoadedCommands();
        if ( isset( $aCommands['cache:clear'] ) ) {
            $oCommand = $aCommands['cache:clear'];
            $oCommand->setConsoleApplication( $this->getConsoleApplication() );
            $oCommand->setInput( $this->getInput() );
            $oCommand->execute( $oOutput );
        }
    }
}
{'fraction_non_alphanumeric': 0.11141920846987648, 'fraction_numerical': 0.004537433829089992, 'mean_word_length': 2.8227360308285165, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '412620', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1100, 'n_words': 386}