<commit_before><?php
/**
 * Rend
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://rend.superglobals.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so I can send you a copy immediately.
 *
 * @category    Rend
 * @package     View
 * @copyright   2008 <NAME>
 * @license     http://rend.superglobals.com/license/new-bsd    New BSD License
 * @link        http://rend.superglboals.com/
 * @since       1.0.0
 * @version     $Id$
 */

/**
 * Url helper
 *
 * Extension of the Zend_View_Helper_Url, adding support for full urls.
 *
 * @category    Rend
 * @package     View
 */
class Rend_View_Helper_FullUrl
{

    /**
     * Determine the full URL based on the the url options
     *
     * @param   array       $urlOptions
     * @param   string      $name
     * @param   boolean     $reset
     * @return  string
     */
    public function fullUrl(array $urlOptions = array(), $name = 'default', $reset = false)
    {
        /** Rend_Controller_Front */
        require_once 'Rend/Controller/Front.php';
        $request = Rend_Controller_Front::getInstance()->getRequest();

        if ($this->_isHttps()) {
            $url = 'https://';
        } else {
            $url = 'http://';
        }

        $url .= $request->SERVER_NAME;

        if (($this->_isHttps() && $request->SERVER_PORT != 443) || (!$this->_isHttps() && $request->SERVER_PORT != 80)) {
            $url .= ':' . $request->SERVER_PORT;
        }

        return $url . $this->getView()->url($urlOptions, $name, $reset);
    }

    /**
     * Determine if the request is a SSL request
     *
     * @return  boolean
     */
    private function _isHttps()
    {
        /** Rend_Controller_Front */
        require_once 'Rend/Controller/Front.php';
        return Rend_Controller_Front::getInstance()->getRequest()->isSsl();
    }

}<commit_msg>CS cleanup<commit_after><?php
/**
 * Rend
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://rend.superglobals.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so I can send you a copy immediately.
 *
 * @category    Rend
 * @package     View
 * @copyright   2008 <NAME>
 * @license     http://rend.superglobals.com/license/new-bsd    New BSD License
 * @link        http://rend.superglboals.com/
 * @since       1.0.0
 * @version     $Id$
 */

/**
 * Url helper
 *
 * Extension of the Zend_View_Helper_Url, adding support for full urls.
 *
 * @category    Rend
 * @package     View
 */
class Rend_View_Helper_FullUrl
{

    /**
     * Determine the full URL based on the the url options
     *
     * @param   array       $urlOptions
     * @param   string      $name
     * @param   boolean     $reset
     * @return  string
     */
    public function fullUrl(array $urlOptions = array(), $name = 'default', $reset = false)
    {
        /** Rend_Controller_Front */
        require_once 'Rend/Controller/Front.php';
        $request = Rend_Controller_Front::getInstance()->getRequest();

        if ($this->_isHttps()) {
            $url = 'https://';
        } else {
            $url = 'http://';
        }

        $url .= $request->SERVER_NAME;

        if (($this->_isHttps() && $request->SERVER_PORT != 443) || (!$this->_isHttps() && $request->SERVER_PORT != 80)) {
            $url .= ':' . $request->SERVER_PORT;
        }

        return $url . $this->getView()->url($urlOptions, $name, $reset);
    }

    /**
     * Determine if the request is a SSL request
     *
     * @return  boolean
     */
    private function _isHttps()
    {
        /** Rend_Controller_Front */
        require_once 'Rend/Controller/Front.php';

        return Rend_Controller_Front::getInstance()
                                    ->getRequest()
                                    ->isSsl();
    }

}
{'fraction_non_alphanumeric': 0.13238770685579196, 'fraction_numerical': 0.005673758865248227, 'mean_word_length': 2.1271249076127123, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6071275', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1264, 'n_words': 357}