Re: Cakephp App::import() broken

2011-02-11 Thread LunarDraco
You might want to remove your closing ?> tag in the imported file(s).
It is not needed in a pure php file (those that DON't mix php and
html) which does not have any raw/html text to be displayed. And it
will ensure you have no problem with a trailing whitespace. Which I
think is probably the #1 problem for the error headers already sent.

Aslo run the whitespace task in the shell from DebugKit. I used to
always be surprised by what it found. And finally realized various
editors diffs, merge tools etc were the cause. Cant live without some
of those tools and I can't control the other developers working on the
project, so just remove the closing ?> in the files. PHP has never
required it. And it is a best practice on many php based app sites to
leave the closing ?> off.

You'll notice most(probably all) of the cakephp core for 1.3 like
core.php, bootstrap.php etc. has taken on this form or best practice
as well.

On Feb 10, 1:29 pm, Ryan Schmidt  wrote:
> On Feb 10, 2011, at 12:04, RLR wrote:
>
> > On Feb 10, 2011, at 11:48, RLR wrote:
>
> >> As soon as I put the following line in app_controller the Auth
> >> component and redirecting breaks with the following errors:
>
> >> App::import('Vendor', 'DateCalc', array('file' => 'date_calc.php'));
>
> >> Error in browser:
> >> Cannot modify header information - headers already sent by (output
> >> started at path-to-my-app/app/vendors/date_calc.php:1
>
> > As soon as I take the App:Import statement out everything works
>
> Then there is something about the file you're importing -- or one of the 
> files that file is importing -- that's causing this. If it's not something 
> deliberately being echo'd out, then perhaps whitespace before opening  tag or after closing ?> tag?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp App::import() broken

2011-02-10 Thread Ryan Schmidt

On Feb 10, 2011, at 12:04, RLR wrote:

> On Feb 10, 2011, at 11:48, RLR wrote:
> 
>> As soon as I put the following line in app_controller the Auth
>> component and redirecting breaks with the following errors:
>> 
>> App::import('Vendor', 'DateCalc', array('file' => 'date_calc.php'));
>> 
>> Error in browser:
>> Cannot modify header information - headers already sent by (output
>> started at path-to-my-app/app/vendors/date_calc.php:1
> 
> As soon as I take the App:Import statement out everything works

Then there is something about the file you're importing -- or one of the files 
that file is importing -- that's causing this. If it's not something 
deliberately being echo'd out, then perhaps whitespace before opening  tag?



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp App::import() broken

2011-02-10 Thread RLR
As soon as I take the App:Import statement out everything works.I
suspect it has to do with php 5.3.
I have a machine running 5.2.x and this does not happen. The debugger
shows this:

'level', 'error', 'code', 'helpID', 'description', 'file',
'path', 'line', 'context'
);
echo $_this->_output($data);
$status =   "Location: http://code.dreimorgen-beta.com/users/login";

Debugger::handleError() - CORE/cake/libs/debugger.php, line 306
header - [internal], line ??
Controller::header() - CORE/cake/libs/controller/controller.php, line
746
Controller::redirect() - CORE/cake/libs/controller/controller.php,
line 725
AuthComponent::startup() - CORE/cake/libs/controller/components/
auth.php, line 394
Component::triggerCallback() - CORE/cake/libs/controller/
component.php, line 186
Controller::startupProcess() - CORE/cake/libs/controller/
controller.php, line 527
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 187
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
[main] - APP/webroot/index.php, line 83

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp App::import() broken

2011-02-10 Thread Jeremy Burns | Class Outfit
I wasn't necessarily referring to that file - is there something else doing an 
echo? Unless, of course, the problem goes away if you remove that content.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 17:55, RLR wrote:

> I thought that was the problem to... the file only contains:
> 
>$str = "hello world";
> ?>
> 
> no echo, no trailing return or whitespace.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp App::import() broken

2011-02-10 Thread RLR
I thought that was the problem to... the file only contains:



no echo, no trailing return or whitespace.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp App::import() broken

2011-02-10 Thread Jeremy Burns | Class Outfit
Looks like a file in your vendor files is echoing something to screen before 
the main output starts - this is an HTML error.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 17:48, RLR wrote:

> Sorry for the broken post. I prematurely hit return.
> 
> 
> I am struggling with a strange bug regarding cakephp´s App::import
> function.
> 
> cakephp version 1.3.6
> php 5.3
> 
> I have a working cake app. Auth login and redirecting to home page
> works fine.
> As soon as I put the following line in app_controller the Auth
> component and redirecting breaks with the following errors:
> 
> App::import('Vendor', 'DateCalc', array('file' => 'date_calc.php'));
> 
> Error in browser:
> Cannot modify header information - headers already sent by (output
> started at path-to-my-app/app/vendors/date_calc.php:1
> 
> I have tested this with a simple file only containing something like:
>$str = "hello world";
> ?>
> 
> 
> Can someone confirm this on php 5.3 ?
> 
> Thanks!
> 
> Ronald
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp App::import() broken

2011-02-10 Thread RLR
Sorry for the broken post. I prematurely hit return.


I am struggling with a strange bug regarding cakephp´s App::import
function.

cakephp version 1.3.6
php 5.3

I have a working cake app. Auth login and redirecting to home page
works fine.
As soon as I put the following line in app_controller the Auth
component and redirecting breaks with the following errors:

App::import('Vendor', 'DateCalc', array('file' => 'date_calc.php'));

Error in browser:
Cannot modify header information - headers already sent by (output
started at path-to-my-app/app/vendors/date_calc.php:1

I have tested this with a simple file only containing something like:



Can someone confirm this on php 5.3 ?

Thanks!

Ronald

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cakephp App::import() broken

2011-02-10 Thread RLR
I am struggling with a strange bug regarding cakephp´s App::import
function.

cakephp version 1.3.6
php 5.3

I have a working cake app. Auth login and redirecting to home page
works fine.

As soon as I


App::import('Vendor', 'DateCalc', array('file' => 'date_calc.php'));

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cakephp App::import() broken

2011-02-10 Thread RLR
I am struggling with a strange bug regarding cakephp´s App::import
function.

cakephp version 1.3.6
php 5.3

I have a working cake app. Auth login and redirecting to home page
works fine.

As soon as I


App::import('Vendor', 'DateCalc', array('file' => 'date_calc.php'));

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php