Ah, maybe it's an issue with cake 1.1? in 1.2, I have no problem
When I get home tonight, I'll play around with both 1.1 and 1.2, see if I
can replicate the issue you're experiencing
What is your environment? Apache (version)? PHP (version)?
On 6/25/07, chanh.ong <[EMAIL PROTECTED]> wrote:
>
> This is a stock Cake cake_1.1.15.5144 with no hack others than disbble
> of mod_rewrite and these changes below:
>
> in webroot/index.php
> if (!defined('ROOT')) {
> define('ROOT', dirname(__FILE__) . DS . 'cake_1.1.15.5144');
> }
> if (!defined('APP_DIR')) {
> define('APP_DIR', 'app');
> }
> if (!defined('CAKE_CORE_INCLUDE_PATH')) {
> define('CAKE_CORE_INCLUDE_PATH', ROOT);
> }
> etc...
>
> And here is what I got in the header.
> <link rel="icon" href="/favicon.ico" type="image/x-icon" />
> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
> <link rel="stylesheet" type="text/css" href="/css/cake.generic.css" /
> ></head>
>
> The $this->webroot does not return the correct result!
>
> That is the problem that I am having and many others too!
>
> On Jun 25, 1:59 pm, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
> > This is from my webroot's index.php, maybe it'll help you.
> >
> > /**
> > * These defines should only be edited if you have cake installed in
> > * a directory layout other than the way it is distributed.
> > * Each define has a commented line of code that explains what you would
> > change.
> > */
> > if (!defined('ROOT')) {
> > //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP
> > DIRECTORY IS LOCATED. DO NOT ADD A TRAILING DIRECTORY SEPARATOR');
> > //You should also use the DS define to separate your
> > directories
> > define('ROOT', dirname(__FILE__) . DS . 'base');
> > }
> > if (!defined('APP_DIR')) {
> > define('APP_DIR', 'app');
> > //define('APP_DIR',
> basename(dirname(dirname(__FILE__))));
> > }
> > /**
> > * This only needs to be changed if the cake installed libs are located
> > * outside of the distributed directory structure.
> > */
> > if (!defined('CAKE_CORE_INCLUDE_PATH')) {
> > //define ('CAKE_CORE_INCLUDE_PATH', 'FULL PATH TO
> DIRECTORY
> > WHERE CAKE CORE IS INSTALLED. DO NOT ADD A TRAILING DIRECTORY
> SEPARATOR');
> > //You should also use the DS define to separate your
> > directories
> > define('CAKE_CORE_INCLUDE_PATH', ROOT);
> > }
> >
> > On 6/25/07, Jonathan Langevin <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > fyi, my structure is:
> >
> > > /
> > > /base
> > > /base/cake
> > > /base/app
> >
> > > I moved /base/app/webroot/* to /, so my webroot is the site root
> >
> > > With mod_rewrite, it works great.
> > > Without mod_rewrite, it works great.
> >
> > > Sounds like you misconfigured something, because I have a non-standard
> > > setup, still functions.
> >
> > > On 6/25/07, chanh.ong < [EMAIL PROTECTED]> wrote:
> >
> > > > What's wrong with this Google Group today! I lost my posts!
> >
> > > > Here is one last time I will try to post this!
> >
> > > > In displatcher.php on line 388:
> > > > Replace this:
> > > > $htaccess =
> > > > preg_replace('/(?:'.APP_DIR.'\\/(.*)|index\\.php(.*))/
> > > > i', '', $webroot).APP_DIR.'/'.$webrootDirName.'/';
> >
> > > > With these lines:
> > > > if (preg_match("/".APP_DIR."/i", BASE_URL)) {
> > > > $htaccess =
> > > > preg_replace('/(?:'.APP_DIR.'\\/(.*)|index\\.php(.*))/
> > > > i', '', $webroot).APP_DIR.'/'.$webrootDirName.'/';
> > > > } else {
> > > > $htaccess =
> > > > preg_replace('/(?:\\/(.*)|index\\.php(.*))/i', '',
> > > > $webroot).'/'.$webrootDirName.'/';
> > > > }
> >
> > > > With these there is no need to hack html.php and it will work
> whether
> > > > your webroot in app or its content is on the same level as app like
> in
> > > > my case.
> >
> > > > On Jun 25, 9:05 am, "chanh.ong" < [EMAIL PROTECTED]> wrote:
> > > > > in dispatcher.php on line 387:
> > > > > $webroot = setUri();
> > > > > // $htaccess =
> > > > preg_replace('/(?:'.APP_DIR.'\\/(.*)|index\
> > > > > \.php(.*))/i', '', $webroot).APP_DIR.'/'.$webrootDirName.'/';
> > > > > $htaccess =
> "/".$webrootDirName.'/';
> >
> > > > > If I replace line 388 with the line below like above I don't have
> to
> > > > > hack html.php and it return the right path to the css, image,
> icon.
> >
> > > > > <link rel="icon" href="/cakecms/favicon.ico" type="image/x-icon"
> />
> > > > > <link rel="shortcut icon" href="/cakecms/favicon.ico"
> type="image/x-
> > > > > icon" />
> > > > > <link rel="stylesheet" type="text/css" href="/cakecms/css/
> > > > > cake.generic.css" />
> >
> > > > > These are what I got in the header now!
> >
> > > > > It seems that the line 387 and 388 fail to do something right when
> > > > > mod_rewrite is off.
> >
> > > > > On Jun 25, 8:33 am, "chanh.ong" <[EMAIL PROTECTED] > wrote:
> >
> > > > > > My config are: XAMPP and running WXP.
> >
> > > > > > Note: I moved the content of app/webroot into the same level as
> app
> > > > so
> > > > > > now my cake structure will look like this:
> > > > > > H:.
> > > > > > ├───app
> > > > > > │ ├───config
> > > > > > │ │ └───sql
> > > > > > │ ├───controllers
> > > > > > │ │ └───components
> > > > > > │ ├───models
> > > > > > │ ├───plugins
> > > > > > │ ├───tmp
> > > > > > │ │ ├───cache
> > > > > > │ │ │ ├───models
> > > > > > │ │ │ ├───persistent
> > > > > > │ │ │ └───views
> > > > > > │ │ ├───logs
> > > > > > │ │ ├───sessions
> > > > > > │ │ └───tests
> > > > > > │ ├───vendors
> > > > > > │ └───views
> > > > > > │ ├───elements
> > > > > > │ ├───errors
> > > > > > │ ├───helpers
> > > > > > │ ├───layouts
> > > > > > │ └───pages
> > > > > > ├───cake
> > > > > > │ ├───config
> > > > > > │ ├───libs
> > > > > > │ │ ├───controller
> > > > > > │ │ │ └───components
> > > > > > │ │ │ ├───dbacl
> > > > > > │ │ │ │ └───models
> > > > > > │ │ │ └───iniacl
> > > > > > │ │ ├───model
> > > > > > │ │ │ ├───datasources
> > > > > > │ │ │ └───dbo
> > > > > > │ │ └───view
> > > > > > │ │ ├───helpers
> > > > > > │ │ └───templates
> > > > > > │ │ ├───elements
> > > > > > │ │ ├───errors
> > > > > > │ │ ├───layouts
> > > > > > │ │ ├───pages
> > > > > > │ │ └───scaffolds
> > > > > > │ └───scripts
> > > > > > │ └───templates
> > > > > > │ ├───skel
> > > > > > │ │ ├───config
> > > > > > │ │ │ └───sql
> > > > > > │ │ ├───controllers
> > > > > > │ │ │ └───components
> > > > > > │ │ ├───models
> > > > > > │ │ │ └───behaviors
> > > > > > │ │ ├───plugins
> > > > > > │ │ ├───tmp
> > > > > > │ │ │ ├───cache
> > > > > > │ │ │ │ ├───models
> > > > > > │ │ │ │ ├───persistent
> > > > > > │ │ │ │ └───views
> > > > > > │ │ │ ├───logs
> > > > > > │ │ │ ├───sessions
> > > > > > │ │ │ └───tests
> > > > > > │ │ ├───vendors
> > > > > > │ │ ├───views
> > > > > > │ │ │ ├───elements
> > > > > > │ │ │ ├───errors
> > > > > > │ │ │ ├───helpers
> > > > > > │ │ │ ├───layouts
> > > > > > │ │ │ └───pages
> > > > > > │ │ └───webroot
> > > > > > │ │ ├───css
> > > > > > │ │ ├───files
> > > > > > │ │ ├───img
> > > > > > │ │ └───js
> > > > > > │ └───views
> > > > > > ├───css
> > > > > > ├───docs
> > > > > > ├───files
> > > > > > ├───img
> > > > > > ├───js
> > > > > > └───vendors
> >
> > > > > > These are my path setup:
> > > > > > ROOT=H:\dev\htdocs\cakecms
> > > > > > APP_DIR=app
> > > > > > WEBROOT_DIR=cakecms
> > > > > > WWW_ROOT=H:\dev\htdocs\cakecms\cakecms\
> > > > > > CAKE_CORE_INCLUDE_PATH=H:\dev\htdocs\cakecms
> > > > > > CORE_PATH=H:\dev\htdocs\cakecms\
> > > > > > APP_PATH=H:\dev\htdocs\cakecms\app\
> >
> > > > > > Without the hack:
> > > > > > <link rel="icon" href="/cakecms/app/cakecms/favicon.ico"
> > > > type="image/x-
> > > > > > icon" />
> > > > > > <link rel="shortcut icon"
> href="/cakecms/app/cakecms/favicon.ico"
> > > > > > type="image/x-icon" />
> > > > > > <link rel="stylesheet" type="text/css"
> > > > href="/cakecms/app/cakecms/css/
> > > > > > cake.generic.css" /></head>
> >
> > > > > > With the hack:
> > > > > > <link rel="icon" href="/cakecms/app/cakecms/favicon.ico"
> > > > type="image/x-
> > > > > > icon" />
> > > > > > <link rel="shortcut icon"
> href="/cakecms/app/cakecms/favicon.ico"
> > > > > > type="image/x-icon" />
> > > > > > <link rel="stylesheet" type="text/css"
> href="css/cake.generic.css"
> > > > /></
> > > > > > head>
> >
> > > > > > I forgot to mention the $this->webroot return a wrong value too!
> >
> > > > > > I tried my hack with or without mod_rewrite and it works in both
> > > > > > cases. I am having a tough time trying to figure out why
> > > > $this->webroot return a wrong value too! I might have to hack the
> >
> > > > > > dispatcher to fix that! Not sure yet!
> >
> > > > > > Thanks
> >
> > > > > > On Jun 24, 11:11 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > I would recommend you do not go modifying the core like
> this. If
> > > > > > > $this->webroot is being set to an incorrect value this most
> likely
> > > > > > > indicates an error in your setup and configuration - it is
> > > > preferable
> > > > > > > to find this issue and fix it than to make a change like you
> have.
> >
> > > > > > > Can you please give examples of the urls generated before and
> > > > after
> > > > > > > your modification, and any other details about your setup
> (folder
> > > > > > > paths etc).
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---