|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
php equivalent of application cfc
Author: Tom King
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271399
Thanks all - the htacess trickery is worth a punt I feel !
T
On 3 Mar 2007, at 10:45, Peter Boughton wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Peter Boughton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271396
Uh, $50 a month is £308 a year.
The £200 a year Tom asked for is $32 a month.
----- Excess quoted text cut - see Original Post for more -----
Author: Eric Roberts
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271376
$50(USD) a month will get you pretty good CF hosting at a lot of places...
Sunshinetechsolutions.com
Hostnexus.com
Those are 2 good hosts...
Eric
Heh,
Can you 60 gigs a month bandwidth, 25 gigs webspace, with CF for less
than £200 PA?
T
On 2 Mar 2007, at 13:26, Peter Boughton wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Peter Boughton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271363
Um... WTF would you want twenty-five gigs of space for!? :S
It's a possibility. Would probably require going with an unmanaged US-based
server (rather than the managed UK-based one I'm currently looking at.)
And depend on finding a minimum of ten people wanting a similar package.
And it wouldn't be Adobe CF, it'd be Railo (because it's better, faster, and a
lot less money.)
But yeah, certainly a possibility. :)
----- Excess quoted text cut - see Original Post for more -----
Author: Eric Haskins
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271357
I run a shared PHP Hosting company and the .htaccess with prepend is how I
setup phpfusebox sites
Eric
Author: Ryan Stille
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271346
Correct! They wouldn't be very useful if you could only set them for
the server as a whole.
If you set a prepend/append file in your webroot, and want it turned off
in a subdirectory, you can put a .htaccess file in there and set the
auto_prepend_file value to "none" (without quotes I believe) and it will
turn it off.
If you really wanted to emulate the way ColdFusion looks for and
executes Application.cfm you could put some code in your auto prepended
file that looks for Application.php in the same file as the current
script. If its not found, check the parent directory, etc. etc.
-Ryan
Rob Wilkerson wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Kevin Aebig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271341
It's not about access as you can set those values with php_ini(). It's about
where or not the shared host blocks it or not.
!k
You don't need to have access to the php.ini file. You can set those
directives in an .htaccess file. I done this on shared hosting providers.
If you did it in .htaccess the syntax would be:
php_value auto_prepend_file Application.php
php_value auto_append_file onRequestEnd.php
-Ryan
Christopher Jordan wrote:
----- Excess quoted text cut - see Original Post for more -----
though,
----- Excess quoted text cut - see Original Post for more -----
Author: Rob Wilkerson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271331
Cool. I didn't know that. Theoretically, then, you could have a
separate auto_append and auto_prepend file for each web root or even
directory within a webroot, right?
----- Excess quoted text cut - see Original Post for more -----
Author: Ryan Stille
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271321
You don't need to have access to the php.ini file. You can set those
directives in an .htaccess file. I done this on shared hosting providers.
If you did it in .htaccess the syntax would be:
php_value auto_prepend_file Application.php
php_value auto_append_file onRequestEnd.php
-Ryan
Christopher Jordan wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Christopher Jordan
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271318
Probably not, but I didn't read where the original poster said he was
using a shared host. And you're probably right, the shared host probably
has these turned off. I was just trying to show that it *is* possible to
prepend and append files in php. I'm also used to hosting my own. I'm
fortunate enough to work for a small company who is in the business of
hosting for our clients.
Chris
Tom Chiverton wrote:
----- Excess quoted text cut - see Original Post for more -----
--
http://www.cjordan.us
Author: Tom Chiverton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271316
> In fact, here are the two lines I included in my php.ini file (which on
> my fadoracore4 system is located in /etc)
On a typical shared host, you wouldn't be able to set those parameters though,
would you ?
--
Tom Chiverton
Helping to continually transition principle-centered architectures
On: http://thefalken.livejournal.com
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in England and Wales
under registered number OC307980 whose registered office address is at St James's
Court Brown Street Manchester M2 2JF. A list of members is available for
inspection at the registered office. Any reference to a partner in relation to
Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society.
CONFIDENTIALITY
This email is intended only for the use of the addressee named above and may be
confidential or legally privileged. If you are not the addressee you must not
read it and must not use any information contained in nor copy it nor inform any
person other than Halliwells LLP or the addressee of its existence or contents.
If you have received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 8008.
For more information about Halliwells LLP visit www.halliwells.com.
Author: Christopher Jordan
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271315
All the more reason that CF is better than PHP. ;o)
I was of course, assuming that you had control over the server. His pro
level folks said, "there is no automatic way of including a file."
They're just wrong. I didn't say it would be practical, and in a shared
environment you may be right. But their **IS** a way to do it. ;o)
Cheers mate!
Chris
Kevin Aebig wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Kevin Aebig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271314
Most shared hosts disable those entries. In other words, your code is no
longer easily deployed to another server.
His pro level PHP developers will probably agree... =]
!k
In fact, here are the two lines I included in my php.ini file (which on
my fadoracore4 system is located in /etc)
; Automatically add files before or after any PHP document.
auto_prepend_file = application.inc.php
auto_append_file = onrequestend.inc.php
I named the files anything I wanted and I included the .inc to remind me
that they were include files. Then I just named them after their
coldfusion counterparts.
Have fun, and educate your pro level PHP developers. ;o)
Cheers,
Chris
Rob Wilkerson wrote:
----- Excess quoted text cut - see Original Post for more -----
both said there is no automatic way of including a file. Only way is to have
an explicit include call.
>>
>
>
Author: Christopher Jordan
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271312
In fact, here are the two lines I included in my php.ini file (which on
my fadoracore4 system is located in /etc)
; Automatically add files before or after any PHP document.
auto_prepend_file = application.inc.php
auto_append_file = onrequestend.inc.php
I named the files anything I wanted and I included the .inc to remind me
that they were include files. Then I just named them after their
coldfusion counterparts.
Have fun, and educate your pro level PHP developers. ;o)
Cheers,
Chris
Rob Wilkerson wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Christopher Jordan
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271311
Yeah, I've done that too. It's something you have to set up in your
php.ini file. I used it to act like application.cfm (instead of
application.cfc).. it worked like a champ. Hopefully, I won't have to
work on another PHP project for a long time. Viva la ColdFusion! :o)
Cheers,
Chris
Rob Wilkerson wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Kevin Aebig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271308
I'd be more than surprised if every page didn't already have an include... if so
just piggyback it.
Otherwise, an easy solution to find/replace in a bunch of files is to search for
the the
<html>
tag and replace it with
<?php include "blah.php"; ?><html>
That way you don't have to worry about headers before any output as well.
!k
Hi All,
Sorry for the OT:
I'm new to PHP, and am trying to find out if there is the equivalent
of application.cfc onrequest() function:
I.e, I want to be able to do this, without having to put the includes
in every file....:
<cffunction name="onrequest">
<cfargument name="targetpage'' required="yes">
<cfinclude template="header.html">
<cfinclude template="#targetpage#>
<cfinclude template="footer.html">
</cffunction>
Help?
Many thanks
T
Author: Rob Wilkerson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271307
Don't know what to tell them, but I've done it. At least with PHP
4.x. I've included the php.ini doc. Search for "auto_prepend_file".
The second hit describes what it does.
http://de3.php.net/manual/en/ini.core.php
> I just asked two pro level PHP developers I used to work with and they both
said there is no automatic way of including a file. Only way is to have an
explicit include
call.
Author: Andy Matthews
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271304
I just asked two pro level PHP developers I used to work with and they both said
there is no automatic way of including a file. Only way is to have an explicit
include call.
Hi All,
Sorry for the OT:
I'm new to PHP, and am trying to find out if there is the equivalent of
application.cfc onrequest() function:
I.e, I want to be able to do this, without having to put the includes in every
file....:
<cffunction name="onrequest">
<cfargument name="targetpage'' required="yes"> <cfinclude
template="header.html"> <cfinclude template="#targetpage#> <cfinclude
template="footer.html"> </cffunction>
Help?
Many thanks
T
Author: Tom King
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271292
Heh,
Can you 60 gigs a month bandwidth, 25 gigs webspace, with CF for less
than £200 PA?
T
On 2 Mar 2007, at 13:26, Peter Boughton wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Peter Boughton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271288
Ah, interesting... Did you see my survey about potential low-cost CFML hosting?
</cheeky-plug>
:)
----- Excess quoted text cut - see Original Post for more -----
Author: Peter Boughton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271287
Ah, I think that was the thing I was referring to with my Apache comment.
Didn't realise it was actually a php.ini thing.
----- Excess quoted text cut - see Original Post for more -----
Author: Tom King
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271285
hehe, so glad I don't have to deal with this on a regular basis -
thanks for the tips!
T
On 2 Mar 2007, at 14:05, Rob Wilkerson wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Rob Wilkerson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271282
Ugh. :-)
----- Excess quoted text cut - see Original Post for more -----
Author: Randy Johnson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271278
Tom,
Use cfdirectory to read in all the PHP pages, do a cffile="read" on the php
page, do a cffile action="write" to put the <?php
include_once("config.php");?> at the top, then do a cffile action="append"
to put the rest of the PHP script to it.
There you go :-) You still get to use CF during the project :-)
-Randy
----- Excess quoted text cut - see Original Post for more -----
Author: Tom Chiverton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271279
> That could work (as would the related require_once() function), but
> it's maintenance-intensive since it has to be explicitly included on
> every page.
OTTOMH:
find . -name '*.php' -exec cp {} {}.1;cat header.php {}.1 > {} \;
:-)
--
Tom Chiverton
Helping to simultaneously innovate B2C environments
On: http://thefalken.livejournal.com
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in England and Wales
under registered number OC307980 whose registered office address is at St James's
Court Brown Street Manchester M2 2JF. A list of members is available for
inspection at the registered office. Any reference to a partner in relation to
Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society.
CONFIDENTIALITY
This email is intended only for the use of the addressee named above and may be
confidential or legally privileged. If you are not the addressee you must not
read it and must not use any information contained in nor copy it nor inform any
person other than Halliwells LLP or the addressee of its existence or contents.
If you have received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 8008.
For more information about Halliwells LLP visit www.halliwells.com.
Author: Rob Wilkerson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271271
That could work (as would the related require_once() function), but
it's maintenance-intensive since it has to be explicitly included on
every page. Look at the auto_prepend_file directive in php.ini (I
looked it up and I think that's what I was referring to in my earlier
post). If you need something to emulate OnRequestEnd.cfm, try
auto_append_file.
Hope this helps.
----- Excess quoted text cut - see Original Post for more -----
Author: Tom Chiverton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271270
> I.e, I want to be able to do this, without having to put the includes
> in every file....:
Every PHP app I've looked at has an include_once() at the top of each file :-/
--
Tom Chiverton
Helping to augmentatively transition revolutionary segments
On: http://thefalken.livejournal.com
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in England and Wales
under registered number OC307980 whose registered office address is at St James's
Court Brown Street Manchester M2 2JF. A list of members is available for
inspection at the registered office. Any reference to a partner in relation to
Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society.
CONFIDENTIALITY
This email is intended only for the use of the addressee named above and may be
confidential or legally privileged. If you are not the addressee you must not
read it and must not use any information contained in nor copy it nor inform any
person other than Halliwells LLP or the addressee of its existence or contents.
If you have received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 8008.
For more information about Halliwells LLP visit www.halliwells.com.
Author: Rick Root
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271266
> Not my choice, working on a site where they can't afford to move the
> hosting...
> If it was my choice, I'd rewrite the damn thing from scratch in CF
I did a fair amount of PHP work between 6 and 3 years ago.
I usually refuse PHP work now if offered to me. I just don't have the
interest in struggling with things that are so simple in Coldfusion.
Rick
--
> I'm not certified, but I have been told that I'm certifiable...
> Visit http://www.opensourcecf.com today!
Author: Tom King
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271264
That sounds like the sort of thing I'm after...
Will now have to see if I can get to the ini file on shared hosting :(
T
On 2 Mar 2007, at 13:01, Rob Wilkerson wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Tom King
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271263
heheh,
Not my choice, working on a site where they can't afford to move the
hosting...
If it was my choice, I'd rewrite the damn thing from scratch in CF
T
On 2 Mar 2007, at 11:24, Peter Boughton wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Rob Wilkerson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271262
Hey Tom -
It's been a couple of years (like 5), but as of PHP 4, there was a
setting in php.ini that allowed you to define a file that would be
called before every request the way Application.cfm is called. You
have to define it explicitly, but it behaves exactly the same way, in
my experience. That file can include custom functions.
Unfortunately, I can't remember the setting offhand.
----- Excess quoted text cut - see Original Post for more -----
Author: Peter Boughton
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271260
There isn't one.
You can mimic it with Apache stuff - but why bother when its far better to stick
to the glorious CFML and not have to worry about stuff like this.
Perhaps you could say why you want to use PHP, so we can convince you that your
reasons are worthless and you should stay with us. ;)
----- Excess quoted text cut - see Original Post for more -----
Author: Robertson-Ravo, Neil (RX)
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271257
Ask on a PHP list I would say....
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540. It contains information which is
confidential and may also be privileged. It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful. If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910. The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com
Hi All,
Sorry for the OT:
I'm new to PHP, and am trying to find out if there is the equivalent
of application.cfc onrequest() function:
I.e, I want to be able to do this, without having to put the includes
in every file....:
<cffunction name="onrequest">
<cfargument name="targetpage'' required="yes">
<cfinclude template="header.html">
<cfinclude template="#targetpage#>
<cfinclude template="footer.html">
</cffunction>
Help?
Many thanks
T
Author: Tom King
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50563#271256
Hi All,
Sorry for the OT:
I'm new to PHP, and am trying to find out if there is the equivalent
of application.cfc onrequest() function:
I.e, I want to be able to do this, without having to put the includes
in every file....:
<cffunction name="onrequest">
<cfargument name="targetpage'' required="yes">
<cfinclude template="header.html">
<cfinclude template="#targetpage#>
<cfinclude template="footer.html">
</cffunction>
Help?
Many thanks
T
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||