<commit_before><?
if (file_exists_in_path("outlet/Outlet.php")) {
  include_once("outlet/Outlet.php");
}
/**
 * class OrmManager
 * Singleton object for fetching ORM model information
 * @package Framework
 * @subpackage ORM
 */
class OrmManager {
  protected static $instance;
  public static function singleton($args=NULL) { $name = __CLASS__; if (!self::$instance) { self::$instance = new $name($args); } return self::$instance; }
  public $outlet;

  function __construct($locations=NULL) {
    $dbdir = any($locations['tmp'], 'tmp');
    if (class_exists("Outlet")) {
      Outlet::init(array(
        'connection' => array(
          'type' => 'datamanager',
        ),
        'classes' => array(
        ),
      ));
      $this->outlet =& Outlet::getInstance();
    }
  }

  function GetModels() {
    $models = array();
    //$cfg = ConfigManager::singleton();
    //if ($modeldir = opendir($cfg->locations["config"] . "/model")) {
    if ($modeldir = opendir("./config/model")) {
      while ($file = readdir($modeldir)) {
        if (preg_match("/(.*?)\.model$/", $file, $m)) {
          $models[] = $m[1];
        }
      }
    }
    sort($models);
    return $models;
  }
  static function LoadModel($model) {
    if (isset($this) && $this instanceOf OrmManager)
      $me = $this;
    else
      $me = self::singleton();
    if (!$me->outlet) return;
    $models = explode(",", $model);
    //print_pre($models);
    foreach ($models as $model) {<commit_msg>respect config dir in ORM manager<commit_after><?
if (file_exists_in_path("outlet/Outlet.php")) {
  include_once("outlet/Outlet.php");
}
/**
 * class OrmManager
 * Singleton object for fetching ORM model information
 * @package Framework
 * @subpackage ORM
 */
class OrmManager {
  protected static $instance;
  public static function singleton($args=NULL) { $name = __CLASS__; if (!self::$instance) { self::$instance = new $name($args); } return self::$instance; }
  public $outlet;

  function __construct($locations=NULL) {
    $dbdir = any($locations['tmp'], 'tmp');
    if (class_exists("Outlet")) {
      Outlet::init(array(
        'connection' => array(
          'type' => 'datamanager',
        ),
        'classes' => array(
        ),
      ));
      $this->outlet =& Outlet::getInstance();
    }
  }

  function GetModels() {
    $models = array();
    $cfg = ConfigManager::singleton();
    if ($modeldir = opendir($cfg->locations["config"] . "/model")) {
      while ($file = readdir($modeldir)) {
        if (preg_match("/(.*?)\.model$/", $file, $m)) {
          $models[] = $m[1];
        }
      }
    }
    sort($models);
    return $models;
  }
  static function LoadModel($model) {
    if (isset($this) && $this instanceOf OrmManager)
      $me = $this;
    else
      $me = self::singleton();
    if (!$me->outlet) return;
    $models = explode(",", $model);
    //print_pre($models);
    foreach ($models as $model) {
{'fraction_non_alphanumeric': 0.18674905595605903, 'fraction_numerical': 0.0006865774116031583, 'mean_word_length': 2.948509485094851, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '6932106', 'n_tokens_mistral': 948, 'n_tokens_neox': 939, 'n_words': 206}