Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Apr 2007 19:29:23 -0400 (EDT)
From:      Greg Larkin <glarkin@sourcehosting.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        glarkin@sourcehosting.net, rafan@FreeBSD.org
Subject:   ports/111295: [Maintainer update] www/cakephp: Add support for PHP CGI mode
Message-ID:  <200704052329.l35NTNai035721@ports.entropy.prv>
Resent-Message-ID: <200704052340.l35Ne501065127@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         111295
>Category:       ports
>Synopsis:       [Maintainer update] www/cakephp: Add support for PHP CGI mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 05 23:40:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Greg Larkin
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
SourceHosting.net, LLC
>Environment:
System: FreeBSD ports.entropy.prv 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May  7 04:32:43 UTC
>Description:

The initial version of this port required the PHP Apache module to function.
This update provides the ability to run CakePHP with the PHP CGI binary. The
PHP CGI URL location can be set with the WITH_PHP_CGI knob (default:
/cgi-bin/php-cgi).

The appropriate config file is copied into the Apache Includes directory
based on whether the PHP CGI or module is used and if the installation is
for a development or production system.

Added file(s):
- files/cakephp-development-cgi.conf.in
- files/cakephp-production-cgi.conf.in

Port maintainer (glarkin@sourcehosting.net) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- cakephp-1.1.13.4450_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/www/cakephp.orig/Makefile /usr/ports/www/cakephp/Makefile
--- /usr/ports/www/cakephp.orig/Makefile	Wed Mar 21 14:57:22 2007
+++ /usr/ports/www/cakephp/Makefile	Thu Apr  5 19:19:00 2007
@@ -7,6 +7,7 @@
 
 PORTNAME=	cakephp
 PORTVERSION=	1.1.13.4450
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	http://cakeforge.org/frs/download.php/326/
 DISTNAME=	cake_${PORTVERSION}
@@ -24,10 +25,9 @@
 
 NO_BUILD=	yes
 USE_PHP=	pcre session
-WANT_PHP_MOD=	yes
+WANT_PHP_WEB=	yes
 
 SUB_FILES=	pkg-message
-SUB_LIST=	DATADIR=${DATADIR}
 
 WRKSRC=		${WRKDIR}/cake_${DISTVERSION}
 
@@ -42,13 +42,30 @@
 
 .include <bsd.port.pre.mk>
 
+.if ${PHP_SAPI:Mcgi} == "cgi" && ${PHP_SAPI:Mmod} == ""
+CGI_EXT=	-cgi
+.  if !defined(WITH_PHP_CGI)
+pre-everything::
+PHPCGI=		/cgi-bin/php-cgi
+.  else
+pre-everything::
+	@${TRUE}
+PHPCGI=		${WITH_PHP_CGI}
+.  endif
+SUB_LIST+=	PHPCGI=${PHPCGI}
+.else
+CGI_EXT=
+pre-everything::
+	@${TRUE}
+.endif
+
 DEFAULT_PHP_VER=5
 IGNORE_WITH_PHP=4.0 4.1 4.2 4.3.1
 
 .if defined(WITH_PROD)
-SUB_FILES+=	cakephp-production.conf
+SUB_FILES+=	cakephp-production${CGI_EXT}.conf
 .else
-SUB_FILES+=	cakephp-development.conf
+SUB_FILES+=	cakephp-development${CGI_EXT}.conf
 EXTRA_PATCHES=	${FILESDIR}/development-app-config-core.php.patch
 .endif
 
@@ -108,9 +125,9 @@
 post-install:
 .if exists(${PREFIX}/etc/apache2/Includes)
 .if defined(WITH_PROD)
-	@${CP} ${WRKDIR}/cakephp-production.conf ${PREFIX}/etc/apache2/Includes/cakephp.conf
+	@${CP} ${WRKDIR}/cakephp-production${CGI_EXT}.conf ${PREFIX}/etc/apache2/Includes/cakephp.conf
 .else
-	@${CP} ${WRKDIR}/cakephp-development.conf ${PREFIX}/etc/apache2/Includes/cakephp.conf
+	@${CP} ${WRKDIR}/cakephp-development${CGI_EXT}.conf ${PREFIX}/etc/apache2/Includes/cakephp.conf
 .endif
 .else
 	@${ECHO_MSG} ""
@@ -124,5 +141,17 @@
 	@${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${DOCSDIR}
 .endif
 	@${CAT} ${PKGMESSAGE}
+.if ${CGI_EXT} == "-cgi"
+	@${ECHO_MSG}	""
+	@${ECHO_MSG}	"Your CakePHP installation was configured to use the PHP CGI binary."
+	@${ECHO_MSG}	"The PHP CGI binary is expected to be referenced by the URL:"
+	@${ECHO_MSG}	""
+	@${ECHO_MSG}	"	${PHPCGI}"
+	@${ECHO_MSG}	""
+	@${ECHO_MSG}	"If this is incorrect, reinstall the port with the WANT_PHP_CGI knob"
+	@${ECHO_MSG}	"set to the correct URL."
+
+.endif
+	@${ECHO_MSG}	"*********************************************************************"
 
 .include <bsd.port.post.mk>
diff -ruN --exclude=CVS /usr/ports/www/cakephp.orig/files/cakephp-development-cgi.conf.in /usr/ports/www/cakephp/files/cakephp-development-cgi.conf.in
--- /usr/ports/www/cakephp.orig/files/cakephp-development-cgi.conf.in	Wed Dec 31 19:00:00 1969
+++ /usr/ports/www/cakephp/files/cakephp-development-cgi.conf.in	Thu Apr  5 18:10:41 2007
@@ -0,0 +1,13 @@
+AddType application/x-httpd-php .php
+AddType application/x-httpd-php-source .phps
+
+Action php-script %%PHPCGI%%
+AddHandler php-script .php
+
+Alias /cakephp %%DATADIR%%
+
+<Location /cakephp>
+    DirectoryIndex index.php
+    Order deny,allow
+    Allow from all
+</Location>
diff -ruN --exclude=CVS /usr/ports/www/cakephp.orig/files/cakephp-production-cgi.conf.in /usr/ports/www/cakephp/files/cakephp-production-cgi.conf.in
--- /usr/ports/www/cakephp.orig/files/cakephp-production-cgi.conf.in	Wed Dec 31 19:00:00 1969
+++ /usr/ports/www/cakephp/files/cakephp-production-cgi.conf.in	Thu Apr  5 18:10:48 2007
@@ -0,0 +1,13 @@
+AddType application/x-httpd-php .php
+AddType application/x-httpd-php-source .phps
+
+Action php-script %%PHPCGI%%         
+AddHandler php-script .php
+ 
+DocumentRoot %%DATADIR%%/app/webroot
+
+<Location />
+    DirectoryIndex index.php
+    Order deny,allow
+    Allow from all
+</Location>
diff -ruN --exclude=CVS /usr/ports/www/cakephp.orig/files/pkg-message.in /usr/ports/www/cakephp/files/pkg-message.in
--- /usr/ports/www/cakephp.orig/files/pkg-message.in	Wed Mar 21 14:57:22 2007
+++ /usr/ports/www/cakephp/files/pkg-message.in	Thu Apr  5 19:00:05 2007
@@ -7,6 +7,5 @@
 Note that you should restart your Apache web server to ensure that
 the CakePHP configuration file is loaded.
 
-Finally, be sure to check %%DATADIR%%/app/config/core.php for
+Be sure to check %%DATADIR%%/app/config/core.php for
 additional framework configuration options.
-*********************************************************************
--- cakephp-1.1.13.4450_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704052329.l35NTNai035721>