Mini Shell

Direktori : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/wp-includes/Text/Diff/
Upload File :
Current File : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/wp-includes/Text/Diff/Renderer.php

<?php
/**
 * A class to render Diffs in different formats.
 *
 * This class renders the diff in classic diff format. It is intended that
 * this class be customized via inheritance, to obtain fancier outputs.
 *
 * Copyright 2004-2010 The Horde Project (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (LGPL). If you did
 * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
 *
 * @package Text_Diff
 */
class Text_Diff_Renderer {

    /**
     * Number of leading context "lines" to preserve.
     *
     * This should be left at zero for this class, but subclasses may want to
     * set this to other values.
     */
    var $_leading_context_lines = 0;

    /**
     * Number of trailing context "lines" to preserve.
     *
     * This should be left at zero for this class, but subclasses may want to
     * set this to other values.
     */
    var $_trailing_context_lines = 0;

    /**
     * Constructor.
     */
    function __construct( $params = array() )
    {
        foreach ($params as $param => $value) {
            $v = '_' . $param;
            if (isset($this->$v)) {
                $this->$v = $value;
            }
        }
    }

	/**
	 * PHP4 constructor.
	 */
	public function Text_Diff_Renderer( $params = array() ) {
		self::__construct( $params );
	}

    /**
     * Get any renderer parameters.
     *
     * @return array  All parameters of this renderer object.
     */
    function getParams()
    {
        $params = array();
        foreach (get_object_vars($this) as $k => $v) {
            if ($k[0] == '_') {
                $params[substr($k, 1)] = $v;
            }
        }

        return $params;
    }

    /**
     * Renders a diff.
     *
     * @param Text_Diff $diff  A Text_Diff object.
     *
     * @return string  The formatted output.
     */
    function render($diff)
    {
        $xi = $yi = 1;
        $block = false;
        $context = array();

        $nlead = $this->_leading_context_lines;
        $ntrail = $this->_trailing_context_lines;

        $output = $this->_startDiff();

        $diffs = $diff->getDiff();
        foreach ($diffs as $i => $edit) {
            /* If these are unchanged (copied) lines, and we want to keep
             * leading or trailing context lines, extract them from the copy
             * block. */
            if (is_a($edit, 'Text_Diff_Op_copy')) {
                /* Do we have any diff blocks yet? */
                if (is_array($block)) {
                    /* How many lines to keep as context from the copy
                     * block. */
                    $keep = $i == count($diffs) - 1 ? $ntrail : $nlead + $ntrail;
                    if (count($edit->orig) <= $keep) {
                        /* We have less lines in the block than we want for
                         * context => keep the whole block. */
                        $block[] = $edit;
                    } else {
                        if ($ntrail) {
                            /* Create a new block with as many lines as we need
                             * for the trailing context. */
                            $context = array_slice($edit->orig, 0, $ntrail);
                            $block[] = new Text_Diff_Op_copy($context);
                        }
                        /* @todo */
                        $output .= $this->_block($x0, $ntrail + $xi - $x0,
                                                 $y0, $ntrail + $yi - $y0,
                                                 $block);
                        $block = false;
                    }
                }
                /* Keep the copy block as the context for the next block. */
                $context = $edit->orig;
            } else {
                /* Don't we have any diff blocks yet? */
                if (!is_array($block)) {
                    /* Extract context lines from the preceding copy block. */
                    $context = array_slice($context, count($context) - $nlead);
                    $x0 = $xi - count($context);
                    $y0 = $yi - count($context);
                    $block = array();
                    if ($context) {
                        $block[] = new Text_Diff_Op_copy($context);
                    }
                }
                $block[] = $edit;
            }

            if ($edit->orig) {
                $xi += count($edit->orig);
            }
            if ($edit->final) {
                $yi += count($edit->final);
            }
        }

        if (is_array($block)) {
            $output .= $this->_block($x0, $xi - $x0,
                                     $y0, $yi - $y0,
                                     $block);
        }

        return $output . $this->_endDiff();
    }

    function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
    {
        $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));

        foreach ($edits as $edit) {
            switch (strtolower(get_class($edit))) {
            case 'text_diff_op_copy':
                $output .= $this->_context($edit->orig);
                break;

            case 'text_diff_op_add':
                $output .= $this->_added($edit->final);
                break;

            case 'text_diff_op_delete':
                $output .= $this->_deleted($edit->orig);
                break;

            case 'text_diff_op_change':
                $output .= $this->_changed($edit->orig, $edit->final);
                break;
            }
        }

        return $output . $this->_endBlock();
    }

    function _startDiff()
    {
        return '';
    }

    function _endDiff()
    {
        return '';
    }

    function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
    {
        if ($xlen > 1) {
            $xbeg .= ',' . ($xbeg + $xlen - 1);
        }
        if ($ylen > 1) {
            $ybeg .= ',' . ($ybeg + $ylen - 1);
        }

        // this matches the GNU Diff behaviour
        if ($xlen && !$ylen) {
            $ybeg--;
        } elseif (!$xlen) {
            $xbeg--;
        }

        return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
    }

    function _startBlock($header)
    {
        return $header . "\n";
    }

    function _endBlock()
    {
        return '';
    }

    function _lines($lines, $prefix = ' ')
    {
        return $prefix . implode("\n$prefix", $lines) . "\n";
    }

    function _context($lines)
    {
        return $this->_lines($lines, '  ');
    }

    function _added($lines)
    {
        return $this->_lines($lines, '> ');
    }

    function _deleted($lines)
    {
        return $this->_lines($lines, '< ');
    }

    function _changed($orig, $final)
    {
        return $this->_deleted($orig) . "---\n" . $this->_added($final);
    }

}
December 29, 2020 – Base de données MCPV "Prestataires"

Day: December 29, 2020

Building up to orgasm (even if it doesn’t actually happen) can

31 Greatest Clitoral Vibrators In 2025, According To Specialists Palm vibrators are named for the fact that they fit into, yep, the palm of your hand. Most have a slightly curved form that allows them to rest in your vulva hands-free when you’re mendacity down, Wright says. Since they have a larger surface area than…

Read More

Finally, there are Bondage merchandise that may enhance

27 Finest Intercourse Toy Shops Per Evaluations The Place To Buy Intercourse Toys Online Its mix of rumbly and buzzy sensations made it open for various customers, whereas the big selection of 7 patterns and a pair of intensity settings made it easy to customise the expertise with or with out the mobile app. The…

Read More

Replica Hermès baggage have zero resale worth and can’t be

Duplicate Hermes Birkin 25cm Baggage When purchasing for duplicate Hermès luggage you possibly can expect to cope with sellers that are primarily situated in Asia. These sellers have a variety of experience and you want to goal to shop with the ones which have been crafting reproduction Hermès handbags for years. Below you will see…

Read More

For years, the marketing strategy behind this look has been

The Under $150 Hermès Mini Kelly Bag Dupe I Like The Steve Madden sandals nonetheless wouldn’t have white stitching replica hermes replica bags hermes wallets, but the colour match and other particulars do their part to make this a fantastic possibility. As the Hermès Oran sandal is certainly one of the most iconic styles on…

Read More

While I love Goyard’s chic leather-based tote bags and trendy

Do You Have Got To Buy Reproduction Designer Handbags? Professionals And Cons Asian Magnificence replica bags replica bags, Kpop, & Journey While the Neverfull offers model status, these budget-friendly options present a classy and practical selection anyone can afford. The checkered print is so lovely especially on these roomy totes. Choose respected sellers, and check…

Read More

This includes Gucci designer dupes or Louis Vuitton designer

Best Gucci Loafer Mule Dupes: Chic Alternatives Under $150 They are generally durable yeezy slide, high-quality and a great option for well-built shoes at an affordable price point. As promised, I’m now excited to reveal the best DHgate sellers that I discovered for replica shoes, based on my extensive research and evaluation. If the pair…

Read More

With real glans and exquisite veining

Realistic Dildos Lifelike Dildos Shop Realistic Dildos Online This is a manual lifelike silicone dildo with a suction cup. There’s an 8-inch insertable length with balls on end for bouncing and sitting. Fully waterproof , it is super easy to clean and can be used anywhere. With real glans and exquisite veining, it has a…

Read More

With such a diverse selection

Казино JoyCasino играть онлайн бесплатно, официальный сайт, скачать клиент Additionally, your data security is guaranteed through their use of SSL encryption technology coupled with PCI-compliant payment methods. So don’t wait any longer – sign up now at Casino Joy Casino and start winning today! Casino Joy is the destination for players looking for an array…

Read More

“Aneros is a brand whose whole line is designed specifically

Shop Grownup Toys And Sexual Wellness Merchandise Online However, the remote control (image below) was upgraded to a blacked-out shade and a cozy-feeling silicone finish. It felt extra helpful and was significantly simpler to carry within the palm. In addition, the independently positioned buttons had been much simpler to get to, even when multitasking. At…

Read More

Other types of dildos include those designed to be fitted to

Dildo Discover The Right Match At A Great Worth At Sinful Uk Adult games are also a good way to interrupt the ice with a brand new associate and for times when sex turns into boring between the two of you. Your preferences and play fashion will assist decide the proper form, dimension Heart Eyelid…

Read More