Doing the following was easier than creating a new function and hooking into the constructor or before filter.

Create a new static page in called...

/app/views/pages/cakeversion.thtml

In that page put the following lines of code...

<?php
$file = file_get_contents('../../VERSION.txt');
pr($file);
?>

Now access that page via...

http://example.com/pages/cakeversion

Include that one file in all your apps and you are good to go.  Even if the format of the VERSION.txt file changes, as long as the filename does not you are ok.  I have only tested the above on *NIX systems, Linux and BSD.  And you must be able to access the file_get_contents function for local files.  You can possibly just include the file as well.  Haven't tried it, but it will proably work and be more portable.

On 8/9/06, John Zimmerman [gmail] <[EMAIL PROTECTED]> wrote:
creat a function that checks parameters for a special keyword

http://example.com/keyword

That function would be in app_controller.php and in your constructor you just check for the keyword and if it is there call your function.

Your function will then output the contents of the version.txt file to the browser.

I will write something quick and reply back.


On 8/9/06, Martin Wood <[EMAIL PROTECTED]> wrote:

cwsTrummer wrote:
> i need the version number only for customer support. when you have
> installed your app on many servers and you make new versions some of
> the customers use still the old versions. when you know that the
> customer uses an old version of cakephp and there was a bug you can ask
> the customer see what cake version he is using!
>
> @martin wood
> ok i can implement it. but i have to implement it everytime a new cake
> version is coming out

not if you implement it in /app

if you upgrade the cake install it wont blow away your code and when you do a
new project just copy it into the new /app directory :)

of course if they change the format of the VERSION.txt then you might have to
update the code..







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to