<commit_before><?php
// Jivoo
// Copyright (c) 2015 <NAME> (http://nielssp.dk)
// Licensed under the MIT license.
// See the LICENSE file or http://opensource.org/licenses/MIT for more information.
namespace Jivoo\Core\Units;

use Jivoo\Core\UnitBase;
use Jivoo\Core\App;
use Jivoo\Core\Store\Document;
use Jivoo\Vendor\ComposerPackageReader;
use Jivoo\Vendor\VendorLoader;
use Jivoo\Vendor\VendorCommand;

/**
 * Initializes the third-party library loading system.
 */
class VendorUnit extends UnitBase {
  /**
   * {@inheritdoc}
   */
  public function run(App $app, Document $config) {
    $app->m->vendor = new VendorLoader($app);
    $vendor = $this->p('app/../vendor');
    if (is_dir($vendor))
      $app->m->vendor->addPath($vendor, new ComposerPackageReader());
    $vendor = $this->p('share/vendor');
    if (is_dir($vendor))
      $app->m->vendor->addPath($vendor, new ComposerPackageReader());
    
    $app->m->addProperty('vendor', $app->m->vendor);
    
    $this->m->lazy('shell')->addCommand('vendor', new VendorCommand($app));
  }
}<commit_msg>Move repo code to vendor installer.<commit_after><?php
// Jivoo
// Copyright (c) 2015 <NAME> (http://nielssp.dk)
// Licensed under the MIT license.
// See the LICENSE file or http://opensource.org/licenses/MIT for more information.
namespace Jivoo\Core\Units;

use Jivoo\Core\UnitBase;
use Jivoo\Core\App;
use Jivoo\Core\Store\Document;
use Jivoo\Vendor\ComposerPackageReader;
use Jivoo\Vendor\VendorLoader;
use Jivoo\Vendor\VendorCommand;
use Jivoo\Vendor\VendorInstaller;
use Jivoo\Vendor\LocalRepository;

/**
 * Initializes the third-party library loading system.
 */
class VendorUnit extends UnitBase {
  /**
   * {@inheritdoc}
   */
  public function run(App $app, Document $config) {
    $app->m->vendor = new VendorLoader($app);
    $vendor = $this->p('app/../vendor');
    if (is_dir($vendor))
      $app->m->vendor->addPath($vendor, new ComposerPackageReader());
    $vendor = $this->p('share/vendor');
    if (is_dir($vendor))
      $app->m->vendor->addPath($vendor, new ComposerPackageReader());
    
    $app->m->addProperty('vendor', $app->m->vendor);

    $app->m->vendorInstaller = new VendorInstaller($app);
    $app->m->vendorInstaller->addRepository('share', new LocalRepository($this->app, $this->p('share/vendor')));
    
    $this->m->lazy('shell')->addCommand('vendor', new VendorCommand($app));
  }
}
{'fraction_non_alphanumeric': 0.1760268231349539, 'fraction_numerical': 0.003352891869237217, 'mean_word_length': 4.0358649789029535, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3057327', 'n_tokens_mistral': 811, 'n_tokens_neox': 803, 'n_words': 164}