<commit_before><?php

/**
 * @file
 * 
 * Mention services.
 * 
 * @package core
 * @copyright <NAME> 2013
 * @license The MIT License (see LICENCE.txt), other licenses available.
 * @author <NAME> <<EMAIL>>
 * @link http://www.marcus-povey.co.uk
 */

namespace pingback2hook\mention {
    
    use pingback2hook\core\Page as Page;
    use pingback2hook\xml\XmlParser as XmlParser;
    use pingback2hook\core\Input as Input;
    use pingback2hook\endpoints\Endpoint as Endpoint;
    use pingback2hook\templates\Template as Template;
    
    class Pingback extends Mention {
        
        public function init() {
            
            Page::create('pingback', function($page, $subpages){
                
                Input::set('_vt', 'xml');
                
                if ($endpoint = Endpoint::get($subpages[0])) {
                
                    if ($xml = XmlParser::unserialise(Input::getPOST()))
                    {
                        // Get source and target url
                        
                        
                    
                        
                        
                        // Do we have a source and target URL?
                        if ($source_url && $target_url) {

                            // Check we haven't already got this one registered.
                            if (self::isTargetRegistered($source_url, $target_url))
                                throw new AlreadyRegisteredException("Target $target_url has already been registered.");
                        
                            // Check whether target is in source url
                            if (!$details = self::checkSourceUrl($source_url, $target_url))
                                throw new NoLinkFoundException("$target_url not found in $source_url");
                        
                            // Append configuration details
                            $details['endpoint'] = $subpages[0];
                 <commit_msg>Extracting source and target from pingback (oops)<commit_after><?php

/**
 * @file
 * 
 * Mention services.
 * 
 * @package core
 * @copyright <NAME> 2013
 * @license The MIT License (see LICENCE.txt), other licenses available.
 * @author <NAME> <<EMAIL>>
 * @link http://www.marcus-povey.co.uk
 */

namespace pingback2hook\mention {
    
    use pingback2hook\core\Page as Page;
    use pingback2hook\xml\XmlParser as XmlParser;
    use pingback2hook\core\Input as Input;
    use pingback2hook\endpoints\Endpoint as Endpoint;
    use pingback2hook\templates\Template as Template;
    
    class Pingback extends Mention {
        
        public function init() {
            
            Page::create('pingback', function($page, $subpages){
                
                Input::set('_vt', 'xml');
                
                if ($endpoint = Endpoint::get($subpages[0])) {
                
                    if ($xml = XmlParser::unserialise(Input::getPOST()))
                    {
                        // Get source and target url
                        $source_url = $xml->children[1]->children[0]->children[0]->children[0]->content; 
                        $target_url = $xml->children[1]->children[1]->children[0]->children[0]->content; 
                        
                        // Do we have a source and target URL?
                        if ($source_url && $target_url) {

                            // Check we haven't already got this one registered.
                            if (self::isTargetRegistered($source_url, $target_url))
                                throw new AlreadyRegisteredException("Target $target_url has already been registered.");
                        
                            // Check whether target is in source url
                            if (!$details = self::checkSourceUrl($source_url, $target_url))
                                throw new NoLinkFoundException("$target_url not found in $source_url");
                        
                            // Append configuration details
                            $details['endpoint'] = $subpages[0];
                 
{'fraction_non_alphanumeric': 0.0974433188615533, 'fraction_numerical': 0.007718282682103232, 'mean_word_length': 1.365658870507701, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, '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': '1559742', 'n_tokens_mistral': 1038, 'n_tokens_neox': 974, 'n_words': 252}