Файл: onlinepoisk.wm-scripts.ru/services.php
Строк: 45
<?php
$app['view'] = function () use($app) {
return new ArtView($app);
};
$app['conf'] = function () {
return ArtConfig::getInstance();
};
$app['user'] = function() {
return new ArtUser;
};
class Reg {
private static $reg = array();
public static function set( $key, $value ) {
self::$reg[$key] = $value;
}
public static function get( $key ) {
return self::$reg[$key];
}
}
Reg::set('app', $app);
Reg::set('seo', $app['conf']->getOptions('seo'));
require_once ROOT . '/vendor/AR/ActiveRecord.php';
ActiveRecordConfig::initialize(function($cfg) use ($app) {
$cfg->set_model_directory( ROOT . '/model');
$cfg->set_connections(array(
'production' => $app['conf']->getOption('db', 'dsn')
));
$cfg->set_default_connection('production');
});
require_once ROOT . '/vendor/Art/SearchMusic.php';
$api_key = $app['conf']->getOptions('app')['api_key'];
$app['searchmusic'] = new SearchMusicCore($api_key);