<commit_before><?php
/**
 * =============================================================================
 * Copyright (c) 2010, <NAME>
 * All rights reserved.
 *
 * This file is part of Conductor and is licensed by the Copyright holder under
 * the 3-clause BSD License.  The full text of the license can be found in the
 * LICENSE.txt file included in the root directory of this distribution or at
 * the link below.
 * =============================================================================
 *
 * @license http://www.opensource.org/licenses/bsd-license.php
 * @package conductor
 */
namespace Conductor;

use \Bassoon\Generator;
use \Bassoon\RemoteService;

use \Oboe\Head\Javascript;

/**
 * This class is adds the client side proxy for a Bassoon service to the HEAD
 * element.
 *
 * @author <NAME> <<EMAIL>>
 * @package conductor
 */
class ServiceProxy {

  private $_elm;

  public function __construct($serviceClass) {
    $srvc = new RemoteService($serviceClass);
    $this->_elm = new Javascript($srvc->getProxyWebPath());

    $gen = new Generator($srvc);
    $gen->generate();
  }

  public function getElement() {
    return $this->_elm;
  }
}
<commit_msg>Update tests to run the tests from all libraries and update ServiceProxy to account for recent changes<commit_after><?php
/**
 * =============================================================================
 * Copyright (c) 2010, <NAME>
 * All rights reserved.
 *
 * This file is part of Conductor and is licensed by the Copyright holder under
 * the 3-clause BSD License.  The full text of the license can be found in the
 * LICENSE.txt file included in the root directory of this distribution or at
 * the link below.
 * =============================================================================
 *
 * @license http://www.opensource.org/licenses/bsd-license.php
 * @package conductor
 */
namespace conductor;

use \bassoon\Generator;
use \bassoon\RemoteService;

use \oboe\head\Javascript;

/**
 * This class is adds the client side proxy for a Bassoon service to the HEAD
 * element.
 *
 * @author <NAME> <<EMAIL>>
 * @package conductor
 */
class ServiceProxy {

  private $_elm;

  public function __construct($serviceClass) {
    $docRoot = Conductor::$config['documentRoot'];
    $webRoot = Conductor::$config['webRoot'];
    $webWrite = Conductor::$config['webWritable'];

    $outputPath = $webWrite;

    if (strpos($docRoot, $webWrite) !== false) {
      $webOutputPath str_replace($docRoot, '', $webWrite);
    }
    if ($webRoot != '/') {
      $webOutputPath = $webRoot . $webOutputPath;
    }
    
    $srvc = new RemoteService($serviceClass);

    $gen = new Generator($srvc);
    $pathInfo = $gen->generate($outputPath, $webOutputPath);

    $this->_elm = new Javascript($pathInfo->getProxyWebPath());
  }

  public function getElement() {
    return $this->_elm;
  }
}

{'fraction_non_alphanumeric': 0.21822625698324022, 'fraction_numerical': 0.0034916201117318434, 'mean_word_length': 4.134408602150538, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3701785', 'n_tokens_mistral': 824, 'n_tokens_neox': 771, 'n_words': 252}