forked from Grenw/oplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservices.php
45 lines (35 loc) · 1002 Bytes
/
services.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
$app['view'] = function () use($app) {
return new Art\View($app);
};
$app['conf'] = function () {
return Art\Config::getInstance();
};
$app['user'] = function() {
return new Art\User;
};
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';
ActiveRecord\Config::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/OpenPlayer.php';
$vkconf = $app['conf']->getOptions('vk');
$app['openplayer'] = new OpenPlayer\Core(
$vkconf['appId'],
$vkconf['userId']
);