File tree 4 files changed +69
-0
lines changed
resources/installTemplates
tests/Webforge/Setup/Installer
4 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ public function getPartsInstaller(OutputInterface $output = NULL) {
196
196
Array (
197
197
new \Webforge \Setup \Installer \CreateCLIPart (),
198
198
new \Webforge \Setup \Installer \CreateBootstrapPart (),
199
+ new \Webforge \Setup \Installer \ApacheConfigurationPart (),
199
200
new \Webforge \Setup \Installer \InstallTestSuitePart (),
200
201
new \Webforge \Setup \Installer \WriteHtaccessPart (),
201
202
new \Webforge \Setup \Installer \PscJSBoilerplatePart (),
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Webforge \Setup \Installer ;
4
+
5
+ use Psc \System \Dir ;
6
+
7
+ class ApacheConfigurationPart extends Part implements \Webforge \Setup \Package \PackageAware {
8
+
9
+ public function __construct () {
10
+ parent ::__construct ('ApacheConfiguration ' );
11
+ }
12
+
13
+ public function installTo (Dir $ target , Installer $ installer ) {
14
+ $ apache2 = $ installer ->createDir ('etc/apache2/ ' );
15
+
16
+ $ installer ->writeTemplate (
17
+ $ installer ->getInstallTemplates ()->getFile ('apache2.template.conf ' ),
18
+ $ apache2 ->getFile ('psc.conf ' ), // @TODO: $(host-configuration[hostname]).conf
19
+ array (
20
+ 'vhostName ' =>$ this ->package ->getSlug (),
21
+ 'root ' =>(string ) $ this ->package ->getRootDirectory ()
22
+ )
23
+ );
24
+ }
25
+ }
26
+ ?>
Original file line number Diff line number Diff line change
1
+ <Virtualhost *:80>
2
+ ServerName %vhostName%.home
3
+ ServerAlias %vhostName%.desktop.ps-webforge.net %vhostName%.laptop.ps-webforge.net
4
+
5
+ DocumentRoot "%root%www"
6
+
7
+ php_value "auto_prepend_file" "%root%bootstrap.php"
8
+
9
+ # Alias /dimg "%root%cache\images"
10
+ # Alias /images "%root%files\images"
11
+
12
+ <Directory "%root%www">
13
+ AllowOverride All
14
+ </Directory>
15
+
16
+ <Directory "%root%www\cms">
17
+ AllowOverride All
18
+ </Directory>
19
+ </Virtualhost>
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Webforge \Setup \Installer ;
4
+
5
+ class ApacheConfigurationPartTest extends \Webforge \Code \Test \InstallerPartTestCase {
6
+
7
+ public function setUp () {
8
+ $ this ->chainClass = 'Webforge \\Setup \\Installer \\ApacheConfigurationPart ' ;
9
+ parent ::setUp ();
10
+
11
+ $ this ->part = new ApacheConfigurationPart ();
12
+ }
13
+
14
+ public function testPartCreatesTheApacheConfigurationConfInEtc () {
15
+ $ macro = $ this ->installer ->dryInstall ($ this ->part , $ this ->target );
16
+
17
+ $ this ->assertArrayEquals (
18
+ array ('/etc/apache2/psc.conf ' ),
19
+ $ this ->getWrittenFiles ($ macro )
20
+ );
21
+ }
22
+ }
23
+ ?>
You can’t perform that action at this time.
0 commit comments