Browse Source

moved index.php to root

Keith Newman 10 years ago
parent
commit
73aa745dd2

+ 1 - 1
frameworks/PHP/clancats/deploy/nginx.conf

@@ -24,7 +24,7 @@ http {
 		listen       8080;
 		server_name  localhost;
 
-		root /home/ubuntu/FrameworkBenchmarks/clancats/clancatsapp/public/;
+		root /home/ubuntu/FrameworkBenchmarks/clancats/;
 		index  index.php;
 
 		location / {

+ 32 - 0
frameworks/PHP/clancats/index.php

@@ -0,0 +1,32 @@
+<?php 
+/*
+ *---------------------------------------------------------------
+ * ClanCatsFramework runner
+ *---------------------------------------------------------------
+ *
+ * This file just loads CCF and all needed resources to run the 
+ * php unit tests. PHPUnit is a really elegant way to make sure 
+ * that everything works how it should.
+ *
+ *---------------------------------------------------------------
+ * Require CCF
+ *---------------------------------------------------------------
+ *
+ * load the framework file wich wil initialize CCF. 
+ */
+require_once __DIR__."/clancatsapp/framework.php";
+
+/*
+ * execute the main request
+ * The main request contains the params of the http header
+ */
+$response = CCRequest::uri( CCServer::uri() )
+    ->perform()
+    ->response();
+
+/*
+ * "send" means actaully printing the response.
+ * If the secound parameter is true the response will 
+ * also set headers
+ */
+$response->send( true );

+ 2 - 2
frameworks/PHP/clancats/setup.sh

@@ -3,8 +3,8 @@ export COMPOSER_HOME=${IROOT}/php-composer
 export PHP_FPM=${PHP_HOME}/sbin/php-fpm
 export NGINX_HOME=${IROOT}/nginx
 
-sed -i 's|localhost|'"${DBHOST}"'|g' clancatsapp/public/index.php
-sed -i 's|root .*/FrameworkBenchmarks/clancats/clancatsapp|root '"${TROOT}"'|g' deploy/nginx.conf
+sed -i 's|localhost|'"${DBHOST}"'|g' index.php
+sed -i 's|root .*/FrameworkBenchmarks|root '"${TROOT}"'|g' deploy/nginx.conf
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
 
 $PHP_FPM --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid