<commit_before><?php
/**
 * Nooku Framework - http://www.nooku.org
 *
 * @copyright	Copyright (C) 2011 - 2013 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		git://git.assembla.com/nooku-framework.git for the canonical source repository
 */

namespace Nooku\Component\Comments;

use Nooku\Library;

/**
 * Comment Controller
 *
 * @author    	<NAME> <http://nooku.assembla.com/profile/johanjanssens>
 * @package     Nooku\Component\Comments
 */
abstract class ControllerComment extends Library\ControllerModel
{ 
    protected function _initialize(Library\ObjectConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'com:activities.controller.behavior.loggable'
            ),
            'model' => 'com:comments.model.comments',
        ));

        //Alias the permission
        $permission       = clone $this->getIdentifier();
        $permission->path = array('controller', 'permission');

        $this->getObject('manager')->registerAlias(
            'com:'.$permission->package.'controller.permission.comment',
            'com:comments.controller.permission.comment'
        );

        parent::_initialize($config);
    }
    
    protected function _actionRender(Library\ControllerContext $context)
    {
        $view = $this->getView();

	    //Alias the view layout
        if($view instanceof Library\ViewTemplate)
	    {
	        $layout = clone $view->getIdentifier();
            $layout->name  = $view->getLayout();

            $alias = clone $layout;
            $alias->package = 'comments';

	        $this->getObject('manager')->registerAlias($layout, $alias);
	    }

        return parent::_actionRender($context);
    }

    public function getRequest()
	{
		$request = parent::getRequest();<commit_msg>Use ControllerContextInterface instead of ControllerContext.<commit_after><?php
/**
 * Nooku Framework - http://www.nooku.org
 *
 * @copyright	Copyright (C) 2011 - 2013 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		git://git.assembla.com/nooku-framework.git for the canonical source repository
 */

namespace Nooku\Component\Comments;

use Nooku\Library;

/**
 * Comment Controller
 *
 * @author    	<NAME> <http://nooku.assembla.com/profile/johanjanssens>
 * @package     Nooku\Component\Comments
 */
abstract class ControllerComment extends Library\ControllerModel
{ 
    protected function _initialize(Library\ObjectConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'com:activities.controller.behavior.loggable'
            ),
            'model' => 'com:comments.model.comments',
        ));

        //Alias the permission
        $permission       = clone $this->getIdentifier();
        $permission->path = array('controller', 'permission');

        $this->getObject('manager')->registerAlias(
            'com:'.$permission->package.'controller.permission.comment',
            'com:comments.controller.permission.comment'
        );

        parent::_initialize($config);
    }
    
    protected function _actionRender(Library\ControllerContextInterface $context)
    {
        $view = $this->getView();

	    //Alias the view layout
        if($view instanceof Library\ViewTemplate)
	    {
	        $layout = clone $view->getIdentifier();
            $layout->name  = $view->getLayout();

            $alias = clone $layout;
            $alias->package = 'comments';

	        $this->getObject('manager')->registerAlias($layout, $alias);
	    }

        return parent::_actionRender($context);
    }

    public function getRequest()
	{
		$request = parent::getRequest();
{'fraction_non_alphanumeric': 0.14054197662061638, 'fraction_numerical': 0.004782146652497344, 'mean_word_length': 2.6482558139534884, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '5818890', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1044, 'n_words': 195}