1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* AppserverIo\SingleApp\Core\SimpleContainer |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Tim Wagner <[email protected]> |
15
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
17
|
|
|
* @link https://github.com/appserver-io/single-app |
18
|
|
|
* @link http://www.appserver.io |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\SingleApp\Core; |
22
|
|
|
|
23
|
|
|
use AppserverIo\Appserver\Core\GenericContainer; |
24
|
|
|
use AppserverIo\Appserver\Core\Api\Node\ParamNode; |
25
|
|
|
use AppserverIo\Appserver\Core\Api\Node\ServerNodeInterface; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Container implementation for a simple single app scenario. |
29
|
|
|
* |
30
|
|
|
* @author Tim Wagner <[email protected]> |
31
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
32
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
33
|
|
|
* @link https://github.com/appserver-io/single-app |
34
|
|
|
* @link http://www.appserver.io |
35
|
|
|
*/ |
36
|
|
|
class SimpleContainer extends GenericContainer |
37
|
|
|
{ |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Return's the prepared server node configuration. |
41
|
|
|
* |
42
|
|
|
* @param \AppserverIo\Appserver\Core\Api\Node\ServerNodeInterface $serverNode The server node |
43
|
|
|
* |
44
|
|
|
* @return \AppserverIo\Appserver\Core\ServerNodeConfiguration The server node configuration |
45
|
|
|
*/ |
46
|
|
|
protected function getServerNodeConfiguration(ServerNodeInterface $serverNode) |
47
|
|
|
{ |
48
|
|
|
|
49
|
|
|
// override the document root |
50
|
|
|
$serverNode->setParam('documentRoot', ParamNode::TYPE_STRING, getcwd()); |
51
|
|
|
|
52
|
|
|
// add the server node configuration |
53
|
|
|
return parent::getServerNodeConfiguration($serverNode); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* (non-PHPdoc) |
58
|
|
|
* |
59
|
|
|
* @return string The application base directory for this container |
60
|
|
|
* @see \AppserverIo\Appserver\Core\Api\ContainerService::getAppBase() |
61
|
|
|
*/ |
62
|
|
|
public function getAppBase() |
63
|
|
|
{ |
64
|
|
|
return dirname(getcwd()); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|