Save double times on Configure::write('debug', 2);

2014-11-26 Thread baur79
Hi,

every with code is ok?
but on Configure::write('debug', 2); save double times 

is this bug?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Router::mapResources with Configure::write('Routing.admin', 'admin');

2013-05-07 Thread Palli Kominak
i did it this way (without resourceMap() ):

Router::mapResources('lessons', array('prefix' = '/admin/'));

and then i could call REST on /myApp/admin/lessons/delete/1


On Saturday, August 4, 2012 6:05:30 PM UTC+2, Pelz wrote:

 I'm having the same problem (but with 2.2.1). What I did was this:

 Router::resourceMap(array(array('action' = 'admin_delete', 'method' = 
 'DELETE', 'id' = true)));
 Router::mapResources('CookingUtensils', array('prefix' = '/admin/'));
 Router::parseExtensions('xml');

 but it doesn't work and I get:

 response
 code404/code
 url/MYPROJECTNAME/admin/cooking_utensils/7.xml/url
 namePrivate Action CookingUtensilsController::admin_delete() is not 
 directly accessible./name
 /response

 Does someone know how to do this correctly?

 On Thursday, November 1, 2007 2:04:40 PM UTC+1, slawil wrote:

 Hi,
 I have enable Configure::write('Routing.admin', 'admin'); in core.php

 and add

 Router::mapResources('translators');

 to route.php


 now when i try to send HTTP DELETE request to /admin/translators/1
 I'm getting error:

 Missing Method in TranslatorsController
 You are seeing this error because the action admin_1 is not defined in
 controller TranslatorsController

 i try with
 Router::mapResources('translators',params(prefix=admin/)); but
 without any luck.

 Is it this possible in cake 1.2 pre-beta to use admin routing with
 REST routing ?



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Router::mapResources with Configure::write('Routing.admin', 'admin');

2012-08-05 Thread Pelz
I'm having the same problem (but with 2.2.1). What I did was this:

Router::resourceMap(array(array('action' = 'admin_delete', 'method' = 
'DELETE', 'id' = true)));
Router::mapResources('CookingUtensils', array('prefix' = '/admin/'));
Router::parseExtensions('xml');

but it doesn't work and I get:

response
code404/code
url/MYPROJECTNAME/admin/cooking_utensils/7.xml/url
namePrivate Action CookingUtensilsController::admin_delete() is not 
directly accessible./name
/response

Does someone know how to do this correctly?

On Thursday, November 1, 2007 2:04:40 PM UTC+1, slawil wrote:

 Hi,
 I have enable Configure::write('Routing.admin', 'admin'); in core.php

 and add

 Router::mapResources('translators');

 to route.php


 now when i try to send HTTP DELETE request to /admin/translators/1
 I'm getting error:

 Missing Method in TranslatorsController
 You are seeing this error because the action admin_1 is not defined in
 controller TranslatorsController

 i try with
 Router::mapResources('translators',params(prefix=admin/)); but
 without any luck.

 Is it this possible in cake 1.2 pre-beta to use admin routing with
 REST routing ?



-- 
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: Configure::write('App.baseUrl', env('SCRIPT_NAME')); missing controller

2012-07-14 Thread sb
I have the same problem. I am choosing NOT to use mod_rewrite. I followed 
the instructions in the blog tutorial, but I get missing controllers.
If I don't use mod_rewrite, then I am instructed by the tutorial to delete 
.htaccess. Do I still need to edit the httpd.conf for the overrides?

-sb

On Saturday, June 16, 2012 5:32:28 AM UTC-4, Anooj P wrote:


 1)   Make sure that an .htaccess override is allowed: in your httpd.conf, 
 you should have a section that defines a section for each Directory on your 
 server. Make sure the AllowOverride is set to All for the correct 
 Directory. For security and performance reasons, do *not* set 
 AllowOverride to All in Directory /. Instead, look for the 
 Directoryblock that refers to your actual website directory.

2)  Make sure you are editing the correct httpd.conf rather than a 
 user- or site-specific httpd.conf.
3)Make sure Apache is loading up mod_rewrite correctly! You should see 
 something like LoadModule rewrite_module libexec/httpd/mod_rewrite.so or 
 (for Apache 1.3) AddModule mod_rewrite.c in your httpd.conf.

 you wil get more info here
 http://book.cakephp.org/compare/333/A-Note-on-mod_rewrite/cakephp/cakephp1x


-- 
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: Configure::write('App.baseUrl', env('SCRIPT_NAME')); missing controller

2012-06-16 Thread Anooj P


 1)   Make sure that an .htaccess override is allowed: in your httpd.conf, 
 you should have a section that defines a section for each Directory on your 
 server. Make sure the AllowOverride is set to All for the correct 
 Directory. For security and performance reasons, do *not* set 
 AllowOverride to All in Directory /. Instead, look for the Directoryblock 
 that refers to your actual website directory.

   2)  Make sure you are editing the correct httpd.conf rather than a user- 
or site-specific httpd.conf.
   3)Make sure Apache is loading up mod_rewrite correctly! You should see 
something like LoadModule rewrite_module libexec/httpd/mod_rewrite.so or 
(for Apache 1.3) AddModule mod_rewrite.c in your httpd.conf.

you wil get more info here
http://book.cakephp.org/compare/333/A-Note-on-mod_rewrite/cakephp/cakephp1x

-- 
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


Shells in Cake 1.2: Configure::write(Config.language) not working, in Cake 1.3 it works fine...

2012-05-16 Thread DigitalDude
Hey,

I'm having an issue with the Cake shells in Cake 1.2. I use a shell to
send some status emails, and those emails need to be in a specific
language for each recipient. So I use gettext() to implement that,
which is working very fine in Cake 1.3.

In Cake 1.2, the exact same code does NOT work as expected! I cannot
get the language to change, it's alsways english!

So Configure::write('Config.language', 'ita') does not change
anything, regardless of being in the shell, the email template or in
both.

Does anyone have any clue what I could do to solve this issue?

-- 
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: Shells in Cake 1.2: Configure::write(Config.language) not working, in Cake 1.3 it works fine...

2012-05-16 Thread AD7six


On Wednesday, 16 May 2012 15:27:12 UTC+2, DigitalDude wrote:

 Hey, 

 I'm having an issue with the Cake shells in Cake 1.2. I use a shell to 
 send some status emails, and those emails need to be in a specific 
 language for each recipient. So I use gettext() to implement that, 
 which is working very fine in Cake 1.3. 

 In Cake 1.2


You are downgrading?

AD 

-- 
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: Shells in Cake 1.2: Configure::write(Config.language) not working, in Cake 1.3 it works fine...

2012-05-16 Thread DigitalDude
Hey,

no, but I need to extend an existing application where the owner's
opinion is that a refactoring would be too expensive. I recommended a
refactoring but every client is an individual person with individual
thoughts and fears, and I stopped myself from getting upset about
those things... :)

I figured out why I could not change the language. The app is divided
in Front- and Backend and the shell was stored within the backend
structure, but the locales (po files) with the translations are stored
in the frontend. I moved the shell and the email-template and modified
the shell call of the cronjob, and now everything works fine.

:)

On 16 Mai, 16:26, AD7six andydawso...@gmail.com wrote:
 On Wednesday, 16 May 2012 15:27:12 UTC+2, DigitalDude wrote:

  Hey,

  I'm having an issue with the Cake shells in Cake 1.2. I use a shell to
  send some status emails, and those emails need to be in a specific
  language for each recipient. So I use gettext() to implement that,
  which is working very fine in Cake 1.3.

  In Cake 1.2

 You are downgrading?

 AD

-- 
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


Site wide settings with Configure::write and read

2012-04-11 Thread JonStark
Hello.

I'm currently trying to achieve editable site-wide setting for my website 
with Configure::write and read.

My db had id, name and value (ex: 1, site.name, My site)

I have this function in AppController :

function fetchSettings(){
   //Loading model on the fly
   $this-loadModel('Setting');
   //Fetching All params
   $this-set('settings', $this-Setting-find('all'));
   $name = $setting['Setting']['name'];
   $value = $setting['Setting']['value'];
   foreach($settings as $setting){
  Configure::write($name, $value);
   }
}


This is my setting Model :


?php
class Setting extends AppModel {
public $validate = array(
'name' = array(
'rule' = 'notEmpty'
),
'value' = array(
'rule' = 'notEmpty'
)
);
}


And in my view I use :


Configure::read('site.name')


But it does'nt work... any idea ?

-- 
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: Site wide settings with Configure::write and read

2012-04-11 Thread JonStark
No more luck with :


function fetchSettings(){
   $this-loadModel('Setting');
   $this-set('settings', $this-Setting-find('all'));
   $settingName = $setting['Setting']['name'];
   $settingValue = $setting['Setting']['value'];
   foreach($settings as $setting):
  Configure::write($settingName, $settingValue);
   endforeach;
}


Any idea ?

Le mercredi 11 avril 2012 13:33:07 UTC+2, JonStark a écrit :

 Hello.

 I'm currently trying to achieve editable site-wide setting for my website 
 with Configure::write and read.

 My db had id, name and value (ex: 1, site.name, My site)

 I have this function in AppController :

 function fetchSettings(){
//Loading model on the fly
$this-loadModel('Setting');
//Fetching All params
$this-set('settings', $this-Setting-find('all'));
$name = $setting['Setting']['name'];
$value = $setting['Setting']['value'];
foreach($settings as $setting){
   Configure::write($name, $value);
}
 }


 This is my setting Model :


 ?php
 class Setting extends AppModel {
 public $validate = array(
 'name' = array(
 'rule' = 'notEmpty'
 ),
 'value' = array(
 'rule' = 'notEmpty'
 )
 );
 }


 And in my view I use :


 Configure::read('site.name')


 But it does'nt work... any idea ?


-- 
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: Site wide settings with Configure::write and read

2012-04-11 Thread Dr. Loboto
AppController:
       function beforeFilter() {
              //Loading model on the fly
              $this-loadModel('Setting');
              //Fetching All params
          Configure::write('settings', $this-Setting-
find('list', array ('fields' = array ('Setting.name',
'Setting.value';
       }

Everywhere then:
       Configure.read('settings.my_setting_name');

Changes:
1. Code without reference to unknown variables
2. Code is simpler by utilizing standard Cake features
3. Code is placed into callback so no need to call this method
manually (did you call your method at all?)
4. Settings are saved under general settings key to not mix with
other things may be placed in Configure (remove prefix if you need to
replace standard values such way - like debug)

On 11 апр, 18:33, JonStark jean...@gmail.com wrote:
 Hello.

 I'm currently trying to achieve editable site-wide setting for my website
 with Configure::write and read.

 My db had id, name and value (ex: 1, site.name, My site)

 I have this function in AppController :

 function fetchSettings(){
        //Loading model on the fly
        $this-loadModel('Setting');
        //Fetching All params
        $this-set('settings', $this-Setting-find('all'));
        $name = $setting['Setting']['name'];
        $value = $setting['Setting']['value'];
        foreach($settings as $setting){
           Configure::write($name, $value);
        }
     }

 This is my setting Model :

 ?php
 class Setting extends AppModel {
     public $validate = array(
         'name' = array(
             'rule' = 'notEmpty'
         ),
         'value' = array(
             'rule' = 'notEmpty'
         )
     );

 }

 And in my view I use :

 Configure::read('site.name')

 But it does'nt work... any idea ?

-- 
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


Configure::write('App.baseUrl', env('SCRIPT_NAME')); missing controller

2012-03-01 Thread ukkpower
I have had to move my app to a server that uses zeus server. Whe I add
the rewrite.script I get the access to the controllers but no css or
js.

I then uncommented the line Configure::write('App.baseUrl',
env('SCRIPT_NAME')); in the core.php.

I now get all the css and js but I get missing controllers. I have to
put index.php in the url.

 http://www.mydomain.com/osm/index.php/login

The app is in a directory called osm. Cant see what I am missing. Hope
someone called help as this is driving me mad. Thanks

-- 
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: Any chance to get the $_SERVER variable or Configure::write Settings into a shell?

2011-02-06 Thread parallel32
DD, I just had this same issue and resolved it (for me).

There's a couple ways to solve this.  On my servers (centos 5) the env
variables retrieved from _SERVER are available from the cli but they
are a subset of the ones available from http.  And cronjobs are even
fewer than cli env variables as I have come to find.  So it  really
just all depends on what user crontab runs as.  I like the idea of
setting a php.ini variable to find your environment but if php.ini
changes and sometimes it does with php version updates, this could
break.  I chose to use the HOSTNAME env variable.  You can set this in
your .bash_profile for whichever user crontab runs as.  Or you can set
it globally in /etc/profile.  Or you can just set it in your crontab
entry like so:

*  *  *   *   *   HOSTNAME=dev.domain.com;export
HOSTNAME;/path/to/execute/your/cakeshell/script

You can set any env variable using anyone of those ways.

Hope this helps

-- 
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


Any chance to get the $_SERVER variable or Configure::write Settings into a shell?

2011-02-05 Thread DigitalDude
Hey,

for a specific cronjob I need to determine on which Server I am.
Normally I do this by the bootstrap where the Server Variable is
checked and configurations like

Configure::write('NON_SSL_HOST', 'http://www.domain.com').

But with Configure::read(...) I cannot get these entries from within a
shell. I think that is because Cake is not really running when a shell
is called, and the shell has no idea about the current domain the app
is running on.

Is there any other way to determine this? Should I maybe check the
directory where the shell is in and determine the domain from it?

I need this to specify some data in the shell, so that for example on
the DEV version of my App (not live) emails are sent out to a dev-
email and not to all current users (so I can see if the output is
correct etc. before I deploy my code on the live domain).

Any help would be appreciated :)

Regards,

DD

-- 
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: Any chance to get the $_SERVER variable or Configure::write Settings into a shell?

2011-02-05 Thread ibejohn818

When running a PHP script VIA crontab the _SERVER ENV variables will
not be in scope due to script not running through your http server.

Perhaps you should set a variable in your PHP.ini file on your dev
machine and have your Task check to see if it is on your DEV machine
by doing an ini_get and checking the variable.


On Feb 5, 9:07 am, DigitalDude e.blumsten...@googlemail.com wrote:
 Hey,

 for a specific cronjob I need to determine on which Server I am.
 Normally I do this by the bootstrap where the Server Variable is
 checked and configurations like

 Configure::write('NON_SSL_HOST', 'http://www.domain.com').

 But with Configure::read(...) I cannot get these entries from within a
 shell. I think that is because Cake is not really running when a shell
 is called, and the shell has no idea about the current domain the app
 is running on.

 Is there any other way to determine this? Should I maybe check the
 directory where the shell is in and determine the domain from it?

 I need this to specify some data in the shell, so that for example on
 the DEV version of my App (not live) emails are sent out to a dev-
 email and not to all current users (so I can see if the output is
 correct etc. before I deploy my code on the live domain).

 Any help would be appreciated :)

 Regards,

 DD

-- 
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: Any chance to get the $_SERVER variable or Configure::write Settings into a shell?

2011-02-05 Thread Bram
As of php 5.3, you can use the gethostname() function. Another option
is running the hostname shell command.

-- 
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


Small question about L10n: Configure::write('Config.language', 'de'); doesn't seem to do anything? --psybear

2011-01-24 Thread psybear83
Hey everybody

I'm currently doing l10n for my web. I have browsed through some
articles, and their alltogehter-verdict was:

- Put uses('L10n'); into your AppController.
- Put Configure::write('Config.language', 'de'); into your
bootstrap.php File
- Change the display language by setting the session key which
overrides the configuration setting

So far, so good. Everything seems to work, except the
Configure::write('Config.language', 'de');!

I have 3 languages: german (de), french (fr) and italian (it). And for
some reason the default language always is italian, regardless of the
Configure::write(..) setting! Very strange.

my locale folder looks like so:

locale/
locale/deu/
locale/deu/LC_MESSAGES/
locale/deu/LC_MESSAGES/default.po
locale/fre/
locale/fre/LC_MESSAGES/
locale/fre/LC_MESSAGES/default.po
locale/ita/
locale/ita/LC_MESSAGES/
locale/ita/LC_MESSAGES/default.po

Any ideas?

Thanks, Josh

-- 
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: Small question about L10n: Configure::write('Config.language', 'de'); doesn't seem to do anything? --psybear

2011-01-24 Thread Joshua Muheim
Oh, and it seems uses('L10n'); is also not needed?

On Mon, Jan 24, 2011 at 12:06 PM, psybear83 psybea...@gmail.com wrote:
 Hey everybody

 I'm currently doing l10n for my web. I have browsed through some
 articles, and their alltogehter-verdict was:

 - Put uses('L10n'); into your AppController.
 - Put Configure::write('Config.language', 'de'); into your
 bootstrap.php File
 - Change the display language by setting the session key which
 overrides the configuration setting

 So far, so good. Everything seems to work, except the
 Configure::write('Config.language', 'de');!

 I have 3 languages: german (de), french (fr) and italian (it). And for
 some reason the default language always is italian, regardless of the
 Configure::write(..) setting! Very strange.

 my locale folder looks like so:

 locale/
 locale/deu/
 locale/deu/LC_MESSAGES/
 locale/deu/LC_MESSAGES/default.po
 locale/fre/
 locale/fre/LC_MESSAGES/
 locale/fre/LC_MESSAGES/default.po
 locale/ita/
 locale/ita/LC_MESSAGES/
 locale/ita/LC_MESSAGES/default.po

 Any ideas?

 Thanks, Josh

 --
 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: Small question about L10n: Configure::write('Config.language', 'de'); doesn't seem to do anything? --psybear

2011-01-24 Thread John Andersen
As far as I remember, you should use the same abbreviations in your
configure statements as you have in your language folder name - so
german is not de but deu and so on.
Enjoy,
   John

On 24 Jan., 12:06, psybear83 psybea...@gmail.com wrote:
 Hey everybody

 I'm currently doing l10n for my web. I have browsed through some
 articles, and their alltogehter-verdict was:

 - Put uses('L10n'); into your AppController.
 - Put Configure::write('Config.language', 'de'); into your
 bootstrap.php File
 - Change the display language by setting the session key which
 overrides the configuration setting

 So far, so good. Everything seems to work, except the
 Configure::write('Config.language', 'de');!

 I have 3 languages: german (de), french (fr) and italian (it). And for
 some reason the default language always is italian, regardless of the
 Configure::write(..) setting! Very strange.

 my locale folder looks like so:

 locale/
 locale/deu/
 locale/deu/LC_MESSAGES/
 locale/deu/LC_MESSAGES/default.po
 locale/fre/
 locale/fre/LC_MESSAGES/
 locale/fre/LC_MESSAGES/default.po
 locale/ita/
 locale/ita/LC_MESSAGES/
 locale/ita/LC_MESSAGES/default.po

 Any ideas?

 Thanks, Josh

-- 
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: CORE.PHP - Configure::write('Routing.prefixes', array('admin'));

2010-09-02 Thread Synue Cunioci
Hi Cricket,

Thanks for the help. I'm actually using cake 1.3.3 and this is what I
get when I enable the routinng prefix and have the methods withou the
adimn_ prefix.

Error: The action admin_index is not defined in controller
AdministratorsController

Error: Create AdministratorsController::admin_index() in file: app
\controllers\administrators_controller.php.

?php
class AdministratorsController extends AppController {

var $name = 'Administrators';


function admin_index() {

}

}
?
Notice: If you want to customize this error message, create app\views
\errors\missing_action.ctp.

I really do't get it!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: CORE.PHP - Configure::write('Routing.prefixes', array('admin'));

2010-09-02 Thread Synue Cunioci
This is my controller.

?php
class AdministratorsController extends AppController {
var $name = 'Administrators';
var $helpers = array('Html', 'Form');

/*
FUNCAO CONSTRUCT
*/
function index() {
// se o usuario ja estiver logado
if( $this-Session-check('Administrator') ) {
// redireciona para a area restrita
$this-
redirect(array('controller'='administrators','action'='admin_index','admin'=true));
}
// redireciona para a pagina de login
else $this-
redirect(array('controller'='administrators','action'='admin_login','admin'=true));
}

/*
FUNCAO QUE CONTROLA A ACAO LISTAR
*/
function listar() {
// se o usuario ja estiver logado
if( $this-Session-check('Administrator') ) {
// redireciona para a area restrita
$this-
redirect(array('controller'='administrators','action'='admin_list','admin'=true));
}
// redireciona para a pagina de login
else $this-
redirect(array('controller'='administrators','action'='admin_login','admin'=true));
}

/*
FUNCAO QUE CONTROLA A ACAO EDITAR
*/
function edit($id) {
// se o usuario ja estiver logado
if( $this-Session-check('Administrator') ) {
// recebe o id do admin a ser editado
$this-set('update', $id);
// redireciona para a area restrita

$this-redirect(array('controller'='administrators','action' =
'admin_edit','admin'=true));
//$this-redirect(array('action' = 'admin_edit',
$id),'admin'=true);
}
// redireciona para a pagina de login
else $this-
redirect(array('controller'='administrators','action'='admin_login','admin'=true));
}

/*
FUNCAO RESPONSAVEL PELA EXIBICAO DAS ACOES DOS ADMINISTRADORES
*/
function admin_index() {
// se o usuario ja estiver logado
if($this-Session-check('Administrator')) {
$this-set('administrators', $this-Session-
read('Administrator'));
}
// redireciona para a paginda de login
else $this-
redirect(array('controller'='administrators','action'='admin_index','admin'=true));
}

/*
FUNCAO RESPONSAVEL PELO LOGIN DO ADMINISTRADOR
*/
function admin_login() {
// se o usuario ja estiver logado
if( $this-Session-check('Administrator') ) {
// redireciona para a area restrita
$this-
redirect(array('controller'='administrators','action'='admin_index','admin'=true));
}

//criptografia da senha
//$salt = Configure::read('Security.salt');
//echo md5('qwer1234'.$salt);

// se o formulario de login tiver sido preenchido
if(!empty($this-data)) {
// envia os dados para o model
$this-Administrator-set($this-data);
// se o formulario passar pelas regras de validacao
if($this-Administrator-validates(array('fieldList' =
array('login', 'password' {
// checa a existencia do usuario
$result = 
$this-Administrator-check_administrator_data($this-
data);

if( $result !== FALSE ) {
// atualiza o horario do ultimo login
$this-Administrator-id = 
$result['Administrator']['id'];

$this-Administrator-saveField('last_login',date(Y-m-d
H:i:s));
// salva na sessao

$this-Session-write('Administrator',$result);
$this-Session-setFlash('br /Login 
efetuado com sucesso!br /
br /', 'default', array('class' = 'example_class', 'message'));

$this-redirect(array('controller'='administrators',
array('action' = 'index'),'admin'=true));
}
else $this-Session-setFlash('br /Falha ao 
autenticar o
usuario. Por favor tente novamente!br /br /', 'default',
array('class' = 'example_class', 'error'));
}
else $this-Session-setFlash('br /Falha ao validar o 
login e o
password. Por favor tente novamente!br /br /', 'default',
array('class' = 'example_class', 'error'));
}
}

/*
FUNCAO 

CORE.PHP - Configure::write('Routing.prefixes', array('admin'));

2010-09-01 Thread Synue Cunioci
Hi everybody,

This e-mail might look a little longer but I'm just trying to explain
my doubt clearly... Hope I can get to the end of it...

I've been using CakePHP for one week and since then I've been working
hard to get how things work. Definitely cake makes it easier as you
comprehend it's conventions, components, helpers, methods, etc.

The issue I'm sturggling at the moment has something to do with
Configure::write('Routing.prefixes', array('admin'));. In my app I
have a restricted area and since we start learning cake from the
database and models I've decided to start developing from that so the
data could be inserted in the db as the development flows.

My source of knowledge is cake cookbook, wich is very helpful, but
there's a lot of questions that it is unable to answer.

I figured out (and there's a good chance I might be wrong - hope you
guys are going to correct me if that happens)
that when we enable Configure::write('Routing.prefixes',
array('admin')) and use a
redirect(array('controller'='administrators','action'='admin_index','admin'=true))
cake makes the URLs more friendly for a restricted area and it gives
no access for the methods from outside by putting a admin/ prefix.

In this case I'm must use a admin_ prefix in the methods so it could
work. Since cake don't give access to the methods from URL I thought
should have a index() method that checks the administrators login and
redirects the page.

Up to now I think everything is okay. The issue that I'm facing is
when trying to pass a params tho another method I have an error
because the other method get the params as a empty array.

Here we go:

I have a link on the page like this: administrators/edit/1

The functions with access is as follow and gets the params as 1. It is
responsible for checking the login and redirect to the accessible
method. The cookbook says that I can pass the action as an array with
the params.

function edit($id) {
// if user is logged in
if( $this-Session-check('Administrator') ) {
// redirect to restricted area

$this-redirect(array('controller'='administrators',array('action'
= 'admin_edit', $id),'admin'=true));
}
// or redirect to login page
else $this-
redirect(array('controller'='administrators','action'='admin_login','admin'=true));
}

The method bellow is the one that gets the empty array.
function admin_edit($id) {
// retrive data from the db
$result = $this-Administrator-retrieve_administrator_data($id);
// if it finds the user sets the data for the view
if ($result !== FALSE) {
$this-set('administrador_data', $result);
}
}

Can somebody help me out? I'm really not sure if this is the best
aproach for dealing with Configure::write('Routing.prefixes',
array('admin')); and I can't find wy the method is getting an empty
array.

Hope I'm not bothering with such an stupid question.

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: CORE.PHP - Configure::write('Routing.prefixes', array('admin'));

2010-09-01 Thread cricket
On Tue, Aug 31, 2010 at 9:55 AM, Synue Cunioci srcuni...@gmail.com wrote:
 Hi everybody,

 This e-mail might look a little longer but I'm just trying to explain
 my doubt clearly... Hope I can get to the end of it...

 I've been using CakePHP for one week and since then I've been working
 hard to get how things work. Definitely cake makes it easier as you
 comprehend it's conventions, components, helpers, methods, etc.

 The issue I'm sturggling at the moment has something to do with
 Configure::write('Routing.prefixes', array('admin'));. In my app I
 have a restricted area and since we start learning cake from the
 database and models I've decided to start developing from that so the
 data could be inserted in the db as the development flows.

 My source of knowledge is cake cookbook, wich is very helpful, but
 there's a lot of questions that it is unable to answer.

 I figured out (and there's a good chance I might be wrong - hope you
 guys are going to correct me if that happens)
 that when we enable Configure::write('Routing.prefixes',
 array('admin')) and use a
 redirect(array('controller'='administrators','action'='admin_index','admin'=true))
 cake makes the URLs more friendly for a restricted area and it gives
 no access for the methods from outside by putting a admin/ prefix.


Use array('controller'='administrators','action'='index','admin'=true).
Don't put admin_ in the action name. That's what the Routing prefix
is for.


 In this case I'm must use a admin_ prefix in the methods so it could
 work. Since cake don't give access to the methods from URL I thought
 should have a index() method that checks the administrators login and
 redirects the page.

 Up to now I think everything is okay. The issue that I'm facing is
 when trying to pass a params tho another method I have an error
 because the other method get the params as a empty array.

 Here we go:

 I have a link on the page like this: administrators/edit/1

 The functions with access is as follow and gets the params as 1. It is
 responsible for checking the login and redirect to the accessible
 method. The cookbook says that I can pass the action as an array with
 the params.

 function edit($id) {
        // if user is logged in
        if( $this-Session-check('Administrator') ) {
                // redirect to restricted area
                
 $this-redirect(array('controller'='administrators',array('action'
 = 'admin_edit', $id),'admin'=true));
        }
        // or redirect to login page
        else $this-
redirect(array('controller'='administrators','action'='admin_login','admin'=true));
 }

 The method bellow is the one that gets the empty array.
 function admin_edit($id) {
        // retrive data from the db
        $result = $this-Administrator-retrieve_administrator_data($id);
        // if it finds the user sets the data for the view
        if ($result !== FALSE) {
                $this-set('administrador_data', $result);
        }
 }

What do you mean by it gets the empty array. You're only passing $id
to the method. Or do you mean that $result is empty? If that's the
case, there's not much to say without seeing what that method looks
like.


 Can somebody help me out? I'm really not sure if this is the best
 aproach for dealing with Configure::write('Routing.prefixes',
 array('admin')); and I can't find wy the method is getting an empty
 array.

 Hope I'm not bothering with such an stupid question.

 Thanks!

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 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?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: Issue with Configure::write('debug', '0');

2009-11-29 Thread Walther
You need to clear the CakePHP cache. Delete all the files (not
directories) in app/tmp

On Nov 28, 8:52 am, SugarCRM Geek naveenshurpale...@gmail.com wrote:
 Hello Cakephp Group,
        Am facing a problem with this function
          Configure::write('debug', 0);
 Whenever i install my cakephp in my Production server, i cannot access
 any of my screens. i keep getting an error. but if i change the value
 from 0 to say 3,  then back to 0, then i am able to view all my
 screens. i dont wanna keep doing this all the time. so can u tell me a
 solution for this.
 thank u :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Issue with Configure::write('debug', '0');

2009-11-27 Thread SugarCRM Geek
Hello Cakephp Group,
   Am facing a problem with this function
 Configure::write('debug', 0);
Whenever i install my cakephp in my Production server, i cannot access
any of my screens. i keep getting an error. but if i change the value
from 0 to say 3,  then back to 0, then i am able to view all my
screens. i dont wanna keep doing this all the time. so can u tell me a
solution for this.
thank u :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: need to show debug only if admin - Configure::write('debug', 3); only if admin logged in

2009-05-18 Thread nurvzy

Try reversing it. debug:3 in the core and turn it off beforeRender if
you're NOT admin.


On May 17, 4:41 pm, JamesF usaexportexpe...@gmail.com wrote:
 hello all, i love cakephp's built in table that shows the sql queries
 that are running. my site is now live but i need a way to check under
 the hood without disrupting my users.

 here is what i put in the beforeRender function of my app_controller:

  function beforeRender(){

  if ($this-Auth-user('role') == 'admin'){

  Configure::write('debug', 2);
  } else {
  //
  }

 i have Configure::write('debug', 0) set in my core.php

 now this pulls up that sql table thing at the bottom of the screen but
 it is EMPTY. it says (default) 0 query took ms.

 anyone have a solution?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: need to show debug only if admin - Configure::write('debug', 3); only if admin logged in

2009-05-18 Thread Martin Westin

That might be undesirable since any notices or errors before
beforeRender will be in his output.

@JamesF:
Did you put the if-clause at the top of beforeFilter or at the bottom?
Your if will return false if Auth has not had a chance to do it's
thing. Check that you did NOT put it before Auth initializes.
(you will probably be missing the user table slq in your output in
this case but the rest should be there)



On May 18, 4:53 pm, nurvzy nur...@gmail.com wrote:
 Try reversing it. debug:3 in the core and turn it off beforeRender if
 you're NOT admin.

 On May 17, 4:41 pm, JamesF usaexportexpe...@gmail.com wrote:

  hello all, i love cakephp's built in table that shows the sql queries
  that are running. my site is now live but i need a way to check under
  the hood without disrupting my users.

  here is what i put in the beforeRender function of my app_controller:

   function beforeRender(){

   if ($this-Auth-user('role') == 'admin'){

   Configure::write('debug', 2);
   } else {
   //
   }

  i have Configure::write('debug', 0) set in my core.php

  now this pulls up that sql table thing at the bottom of the screen but
  it is EMPTY. it says (default) 0 query took ms.

  anyone have a solution?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: need to show debug only if admin - Configure::write('debug', 3); only if admin logged in

2009-05-18 Thread JamesF

@Martin

even if i remove the conditional and set Configure::write('debug', 2)
in beforeFilter on its own...still no sql is shown. says
(default) 0 query took ms


On May 18, 12:22 pm, Martin Westin martin.westin...@gmail.com wrote:
 That might be undesirable since any notices or errors before
 beforeRender will be in his output.

 @JamesF:
 Did you put the if-clause at the top of beforeFilter or at the bottom?
 Your if will return false if Auth has not had a chance to do it's
 thing. Check that you did NOT put it before Auth initializes.
 (you will probably be missing the user table slq in your output in
 this case but the rest should be there)

 On May 18, 4:53 pm, nurvzy nur...@gmail.com wrote:

  Try reversing it. debug:3 in the core and turn it off beforeRender if
  you're NOT admin.

  On May 17, 4:41 pm, JamesF usaexportexpe...@gmail.com wrote:

   hello all, i love cakephp's built in table that shows the sql queries
   that are running. my site is now live but i need a way to check under
   the hood without disrupting my users.

   here is what i put in the beforeRender function of my app_controller:

    function beforeRender(){

    if ($this-Auth-user('role') == 'admin'){

    Configure::write('debug', 2);
    } else {
    //
    }

   i have Configure::write('debug', 0) set in my core.php

   now this pulls up that sql table thing at the bottom of the screen but
   it is EMPTY. it says (default) 0 query took ms.

   anyone have a solution?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: need to show debug only if admin - Configure::write('debug', 3); only if admin logged in

2009-05-18 Thread JamesF

i think what this issue is coming down to is me working off an alias
of my live site and keeping that in debug modethis is probably for
the best since my site is live now and i shouldn't be mucking around
while people are using it.

On May 18, 2:51 pm, JamesF usaexportexpe...@gmail.com wrote:
 @Martin

 even if i remove the conditional and set Configure::write('debug', 2)
 in beforeFilter on its own...still no sql is shown. says
 (default) 0 query took ms

 On May 18, 12:22 pm, Martin Westin martin.westin...@gmail.com wrote:

  That might be undesirable since any notices or errors before
  beforeRender will be in his output.

  @JamesF:
  Did you put the if-clause at the top of beforeFilter or at the bottom?
  Your if will return false if Auth has not had a chance to do it's
  thing. Check that you did NOT put it before Auth initializes.
  (you will probably be missing the user table slq in your output in
  this case but the rest should be there)

  On May 18, 4:53 pm, nurvzy nur...@gmail.com wrote:

   Try reversing it. debug:3 in the core and turn it off beforeRender if
   you're NOT admin.

   On May 17, 4:41 pm, JamesF usaexportexpe...@gmail.com wrote:

hello all, i love cakephp's built in table that shows the sql queries
that are running. my site is now live but i need a way to check under
the hood without disrupting my users.

here is what i put in the beforeRender function of my app_controller:

 function beforeRender(){

 if ($this-Auth-user('role') == 'admin'){

 Configure::write('debug', 2);
 } else {
 //
 }

i have Configure::write('debug', 0) set in my core.php

now this pulls up that sql table thing at the bottom of the screen but
it is EMPTY. it says (default) 0 query took ms.

anyone have a solution?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



need to show debug only if admin - Configure::write('debug', 3); only if admin logged in

2009-05-17 Thread JamesF

hello all, i love cakephp's built in table that shows the sql queries
that are running. my site is now live but i need a way to check under
the hood without disrupting my users.

here is what i put in the beforeRender function of my app_controller:

function beforeRender(){

  if ($this-Auth-user('role') == 'admin'){

Configure::write('debug', 2);
  } else {
 //
  }

i have Configure::write('debug', 0) set in my core.php

now this pulls up that sql table thing at the bottom of the screen but
it is EMPTY. it says (default) 0 query took ms.

anyone have a solution?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: need to show debug only if admin - Configure::write('debug', 3); only if admin logged in

2009-05-17 Thread brian

That's because you have it in beforeRender(). By that time, all DB
access has come and gone and all that's left is to render the page.
You could try it in beforeFilter(), which fires before the action is
entered.

On Sun, May 17, 2009 at 7:41 PM, JamesF usaexportexpe...@gmail.com wrote:

 hello all, i love cakephp's built in table that shows the sql queries
 that are running. my site is now live but i need a way to check under
 the hood without disrupting my users.

 here is what i put in the beforeRender function of my app_controller:

                function beforeRender(){

                          if ($this-Auth-user('role') == 'admin'){

                                        Configure::write('debug', 2);
                          } else {
                                 //
                          }

 i have Configure::write('debug', 0) set in my core.php

 now this pulls up that sql table thing at the bottom of the screen but
 it is EMPTY. it says (default) 0 query took ms.

 anyone have a solution?

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: need to show debug only if admin - Configure::write('debug', 3); only if admin logged in

2009-05-17 Thread JamesF

just tried this..still getting the same empty result

On May 17, 7:58 pm, brian bally.z...@gmail.com wrote:
 That's because you have it in beforeRender(). By that time, all DB
 access has come and gone and all that's left is to render the page.
 You could try it in beforeFilter(), which fires before the action is
 entered.

 On Sun, May 17, 2009 at 7:41 PM, JamesF usaexportexpe...@gmail.com wrote:

  hello all, i love cakephp's built in table that shows the sql queries
  that are running. my site is now live but i need a way to check under
  the hood without disrupting my users.

  here is what i put in the beforeRender function of my app_controller:

                 function beforeRender(){

                           if ($this-Auth-user('role') == 'admin'){

                                         Configure::write('debug', 2);
                           } else {
                                  //
                           }

  i have Configure::write('debug', 0) set in my core.php

  now this pulls up that sql table thing at the bottom of the screen but
  it is EMPTY. it says (default) 0 query took ms.

  anyone have a solution?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Configure::write('Session.start', true); does *NOT* turn sessions on but session_start() does.

2009-05-16 Thread Miles J

And how do you know your sessions aren't started, what exactly happens?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Configure::write('Session.start', true); does *NOT* turn sessions on but session_start() does.

2009-05-16 Thread Charles

I am echoing the session and nothing happens, it keeps resetting
itself.

On May 16, 3:58 am, Miles J mileswjohn...@gmail.com wrote:
 And how do you know your sessions aren't started, what exactly happens?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Configure::write('Session.start', true); does *NOT* turn sessions on but session_start() does.

2009-05-16 Thread Miles J

Put your security level to low and see what happens.

On May 16, 8:33 am, Charles cri...@gmail.com wrote:
 I am echoing the session and nothing happens, it keeps resetting
 itself.

 On May 16, 3:58 am, Miles J mileswjohn...@gmail.com wrote:

  And how do you know your sessions aren't started, what exactly happens?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Configure::write('Session.start', true); does *NOT* turn sessions on but session_start() does.

2009-05-15 Thread Charles

Any idea why this would be happening?

The session section of my conf:

/**
 * The preferred session handling method. Valid values:
 *
 * 'php'Uses settings defined in your php.ini.
 * 'cake'   Saves session files in CakePHP's /tmp directory.
 * 'database'   Uses CakePHP's database sessions.
 *
 * To define a custom session handler, save it at /app/config/
name.php.
 * Set the value of 'Session.save' to name to utilize it in CakePHP.
 *
 * To use database sessions, execute the SQL file found at /app/config/
sql/sessions.sql.
 *
 */

Configure::write('Session.save', 'php');

/**
 * The name of the table used to store CakePHP database sessions.
 *
 * 'Session.save' must be set to 'database' in order to utilize this
constant.
 *
 * The table name set here should *not* include any table prefix
defined elsewhere.
 */
//Configure::write('Session.table', 'cake_sessions');
/**
 * The DATABASE_CONFIG::$var to use for database session handling.
 *
 * 'Session.save' must be set to 'database' in order to utilize this
constant.
 */
//Configure::write('Session.database', 'default');
/**
 * The name of CakePHP's session cookie.
 */
Configure::write('Session.cookie', 'CAKEPHP');
/**
 * Session time out time (in seconds).
 * Actual value depends on 'Security.level' setting.
 */
Configure::write('Session.timeout', '120');
/**
 * If set to false, sessions are not automatically started.
 */
Configure::write('Session.start', true);
/**
 * When set to false, HTTP_USER_AGENT will not be checked
 * in the session
 */
Configure::write('Session.checkAgent', true);

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Configure::write('Session.start', true); does *NOT* turn sessions on but session_start() does.

2009-05-15 Thread Charles

Help?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: when I have set the Configure::write('debug', 0), how can I let a new model can be use.

2009-03-11 Thread Rimoe
Thanks for your answer.because I has no the encourage to delete
tmp/cache/models/*
data.

[?][?]
when I delete all of that data.
my site is can use the comment the (Configure::write('Cache.disable',
true);)

Thanks

sincerely

rimoe

2009/3/10 Mauricio Morales maomora...@gmail.com


 You can manually delete the tmp/cache/models/* data.

 Are you sure that your table was created with the same DB user that
 Cake's App uses?... It could be a permission problem.

 On Mar 9, 4:36 pm, Rimoe meiyo...@gmail.com wrote:
  Thank you for your answer,
  so I have use the (Cache::clear()) in my controller,
  but it has no anything has happened.
  where should i invoke the Cache::clear()?
  do you know,
  then, i have set the Turn on  of (Configure::write('Cache.disable',
 true);)
  but now I can't turn off it, if I do it, my site will not run.
 
  what should I do,  can you tell me more detail?
 
  thank you very much.
 
  sincerely
 
  rimoe
 
  2009/3/9 Dardo Sordi Bogado dardoso...@gmail.com
 
 
 
I have set (Configure::write('debug', 0)) in my core.php,
now I  added a table,
but the cake can't find the model, and can't use the new model,
In the situation, what should I do?
 
   clear the cache!
 
and I want to use the information of debug,
but I don't want to let it show in page, only show in a file,
what can I do.
 
   You can create a custom datasource extending the one you are using but
   loggin the sql queries instead of dumping them at the end of page. Ex:
  http://bin.cakephp.org/view/503102878
 
   HTH,
   - Dardo Sordi.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---

inline: 360.gif

Re: when I have set the Configure::write('debug', 0), how can I let a new model can be use.

2009-03-10 Thread Mauricio Morales

You can manually delete the tmp/cache/models/* data.

Are you sure that your table was created with the same DB user that
Cake's App uses?... It could be a permission problem.

On Mar 9, 4:36 pm, Rimoe meiyo...@gmail.com wrote:
 Thank you for your answer,
 so I have use the (Cache::clear()) in my controller,
 but it has no anything has happened.
 where should i invoke the Cache::clear()?
 do you know,
 then, i have set the Turn on  of (Configure::write('Cache.disable', true);)
 but now I can't turn off it, if I do it, my site will not run.

 what should I do,  can you tell me more detail?

 thank you very much.

 sincerely

 rimoe

 2009/3/9 Dardo Sordi Bogado dardoso...@gmail.com



   I have set (Configure::write('debug', 0)) in my core.php,
   now I  added a table,
   but the cake can't find the model, and can't use the new model,
   In the situation, what should I do?

  clear the cache!

   and I want to use the information of debug,
   but I don't want to let it show in page, only show in a file,
   what can I do.

  You can create a custom datasource extending the one you are using but
  loggin the sql queries instead of dumping them at the end of page. Ex:
 http://bin.cakephp.org/view/503102878

  HTH,
  - Dardo Sordi.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: when I have set the Configure::write('debug', 0), how can I let a new model can be use.

2009-03-10 Thread Rimoe
hi,

everyone, I want to comment the (Configure::write('Cache.disable', true);)
in my core.php
but if I do it I will get the error:
The requested address *'/'* was not found on this server.

why is it? and what should I do?

I feel mysite is very slow.

Thanks

Rimoe



2009/3/10 Mauricio Morales maomora...@gmail.com


 You can manually delete the tmp/cache/models/* data.

 Are you sure that your table was created with the same DB user that
 Cake's App uses?... It could be a permission problem.

 On Mar 9, 4:36 pm, Rimoe meiyo...@gmail.com wrote:
  Thank you for your answer,
  so I have use the (Cache::clear()) in my controller,
  but it has no anything has happened.
  where should i invoke the Cache::clear()?
  do you know,
  then, i have set the Turn on  of (Configure::write('Cache.disable',
 true);)
  but now I can't turn off it, if I do it, my site will not run.
 
  what should I do,  can you tell me more detail?
 
  thank you very much.
 
  sincerely
 
  rimoe
 
  2009/3/9 Dardo Sordi Bogado dardoso...@gmail.com
 
 
 
I have set (Configure::write('debug', 0)) in my core.php,
now I  added a table,
but the cake can't find the model, and can't use the new model,
In the situation, what should I do?
 
   clear the cache!
 
and I want to use the information of debug,
but I don't want to let it show in page, only show in a file,
what can I do.
 
   You can create a custom datasource extending the one you are using but
   loggin the sql queries instead of dumping them at the end of page. Ex:
  http://bin.cakephp.org/view/503102878
 
   HTH,
   - Dardo Sordi.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



when I have set the Configure::write('debug', 0), how can I let a new model can be use.

2009-03-09 Thread Rimoe
hi,

I have set (Configure::write('debug', 0)) in my core.php,

now I  added a table,

but the cake can't find the model, and can't use the new model,

In the situation, what should I do?

and I want to use the information of debug,

but I don't want to let it show in page, only show in a file,

what can I do.

Thank you for all of your help.

Thanks.

sincerely

rimoe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: when I have set the Configure::write('debug', 0), how can I let a new model can be use.

2009-03-09 Thread Dardo Sordi Bogado

 I have set (Configure::write('debug', 0)) in my core.php,
 now I  added a table,
 but the cake can't find the model, and can't use the new model,
 In the situation, what should I do?

clear the cache!

 and I want to use the information of debug,
 but I don't want to let it show in page, only show in a file,
 what can I do.

You can create a custom datasource extending the one you are using but
loggin the sql queries instead of dumping them at the end of page. Ex:
http://bin.cakephp.org/view/503102878

HTH,
- Dardo Sordi.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: when I have set the Configure::write('debug', 0), how can I let a new model can be use.

2009-03-09 Thread Rimoe
Thank you for your answer,
so I have use the (Cache::clear()) in my controller,
but it has no anything has happened.
where should i invoke the Cache::clear()?
do you know,
then, i have set the Turn on  of (Configure::write('Cache.disable', true);)
but now I can't turn off it, if I do it, my site will not run.

what should I do,  can you tell me more detail?

thank you very much.

sincerely

rimoe

2009/3/9 Dardo Sordi Bogado dardoso...@gmail.com


  I have set (Configure::write('debug', 0)) in my core.php,
  now I  added a table,
  but the cake can't find the model, and can't use the new model,
  In the situation, what should I do?

 clear the cache!

  and I want to use the information of debug,
  but I don't want to let it show in page, only show in a file,
  what can I do.

 You can create a custom datasource extending the one you are using but
 loggin the sql queries instead of dumping them at the end of page. Ex:
 http://bin.cakephp.org/view/503102878

 HTH,
 - Dardo Sordi.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: when I have set the Configure::write('debug', 0), how can I let a new model can be use.

2009-03-09 Thread Miles J

You should be testing this in development anyways.

Try error handling or logging:

http://book.cakephp.org/view/154/Error-Handling
http://book.cakephp.org/view/157/Logging
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Configure::write or define()

2008-09-26 Thread luigi7up

Hello everyone...

I'm little confused with defining constants in Cake.

I have a gallery of pictures that are on voting for _NUMBER_OF_HOURS
constant. In my old application that was written in pure PHP and not
Cake I had constants.php file where, all constants were defined like
this:
define('name', value);

I tried this in my bootstrap.php and it works and I could go with this
but in manual I see some methods like Configure::write and ::read to
do this?!?!

As I understood old method define(); is much better because it uses
php native way to define constants and latter on to use that constant
you just call it like this: _CONSTANT_NAME.

With configure method writing and reading takes some some time and
then again it is pain in the a** to do Configure::read() every time I
need value of _CONSTANT_NAME.

My question is the benefit of using Cake approach??? I can see some
dynamic aspects but everything can be achieved with define();

Am I wrong ??

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write or define()

2008-09-26 Thread Fran Iglesias


El 26/09/2008, a las 11:53, luigi7up escribió:

 As I understood old method define(); is much better because it uses
 php native way to define constants and latter on to use that constant
 you just call it like this: _CONSTANT_NAME.


Configure is not intended for define constants.  It's a flexible way  
to read and write application-wide configuration data.

http://book.cakephp.org/view/42/The-Configuration-Class

Constants are OK for multiple purposes.



--
Fran Iglesias
[EMAIL PROTECTED]





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write or define()

2008-09-26 Thread grigri

Benefits of using Configure:

* No collisions with other php scripts.
* Can be changed at runtime
* Easy to organize, list, group and persist related settings

Benefits of using php constants:

* Less verbose
* More efficient

On Sep 26, 10:53 am, luigi7up [EMAIL PROTECTED] wrote:
 Hello everyone...

 I'm little confused with defining constants in Cake.

 I have a gallery of pictures that are on voting for _NUMBER_OF_HOURS
 constant. In my old application that was written in pure PHP and not
 Cake I had constants.php file where, all constants were defined like
 this:
 define('name', value);

 I tried this in my bootstrap.php and it works and I could go with this
 but in manual I see some methods like Configure::write and ::read to
 do this?!?!

 As I understood old method define(); is much better because it uses
 php native way to define constants and latter on to use that constant
 you just call it like this: _CONSTANT_NAME.

 With configure method writing and reading takes some some time and
 then again it is pain in the a** to do Configure::read() every time I
 need value of _CONSTANT_NAME.

 My question is the benefit of using Cake approach??? I can see some
 dynamic aspects but everything can be achieved with define();

 Am I wrong ??

 Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write or define()

2008-09-26 Thread luigi7up

Thanks for your reply.

In practical example where you want to define number of hours you want
your gallery pictures to be on voting what would you use?

By the way is it okay to use define(); in bootstrap?

Thanks

On Sep 26, 12:09 pm, grigri [EMAIL PROTECTED] wrote:
 Benefits of using Configure:

 * No collisions with other php scripts.
 * Can be changed at runtime
 * Easy to organize, list, group and persist related settings

 Benefits of using php constants:

 * Less verbose
 * More efficient

 On Sep 26, 10:53 am, luigi7up [EMAIL PROTECTED] wrote:

  Hello everyone...

  I'm little confused with defining constants in Cake.

  I have a gallery of pictures that are on voting for _NUMBER_OF_HOURS
  constant. In my old application that was written in pure PHP and not
  Cake I had constants.php file where, all constants were defined like
  this:
  define('name', value);

  I tried this in my bootstrap.php and it works and I could go with this
  but in manual I see some methods like Configure::write and ::read to
  do this?!?!

  As I understood old method define(); is much better because it uses
  php native way to define constants and latter on to use that constant
  you just call it like this: _CONSTANT_NAME.

  With configure method writing and reading takes some some time and
  then again it is pain in the a** to do Configure::read() every time I
  need value of _CONSTANT_NAME.

  My question is the benefit of using Cake approach??? I can see some
  dynamic aspects but everything can be achieved with define();

  Am I wrong ??

  Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write or define()

2008-09-26 Thread mark_story

For me the difference between Configure::write() and define() comes
down to mutability.  If you need to change a value at run time then
use Configure::write().  If in fact your value is a constant and will
never change during script execution, then use define.  It is
semantically more correct, faster and less typing.

-Mark

On Sep 26, 9:05 am, luigi7up [EMAIL PROTECTED] wrote:
 Thanks for your reply.

 In practical example where you want to define number of hours you want
 your gallery pictures to be on voting what would you use?

 By the way is it okay to use define(); in bootstrap?

 Thanks

 On Sep 26, 12:09 pm, grigri [EMAIL PROTECTED] wrote:

  Benefits of using Configure:

  * No collisions with other php scripts.
  * Can be changed at runtime
  * Easy to organize, list, group and persist related settings

  Benefits of using php constants:

  * Less verbose
  * More efficient

  On Sep 26, 10:53 am, luigi7up [EMAIL PROTECTED] wrote:

   Hello everyone...

   I'm little confused with defining constants in Cake.

   I have a gallery of pictures that are on voting for _NUMBER_OF_HOURS
   constant. In my old application that was written in pure PHP and not
   Cake I had constants.php file where, all constants were defined like
   this:
   define('name', value);

   I tried this in my bootstrap.php and it works and I could go with this
   but in manual I see some methods like Configure::write and ::read to
   do this?!?!

   As I understood old method define(); is much better because it uses
   php native way to define constants and latter on to use that constant
   you just call it like this: _CONSTANT_NAME.

   With configure method writing and reading takes some some time and
   then again it is pain in the a** to do Configure::read() every time I
   need value of _CONSTANT_NAME.

   My question is the benefit of using Cake approach??? I can see some
   dynamic aspects but everything can be achieved with define();

   Am I wrong ??

   Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write

2008-07-16 Thread kik

Thanks I tried Configure::store and it's working great. However I
noticed something that's a little confusing. When I use
Configure::store it creates a php file in app/tmp/cache/persistent and
the php file does not have any closing tag such as ?. Is this
normal and reliable way to store a variable or I have made a mistake
somewhere. Basically the php file in the cache folder looks like this:

//START

?php
$config = array();
$config['ApplicationSettings']['app_title'] = 'My Title Goes Here';

//END

As you can see there is no closing ? tag. My other question is does
Configure::store saves the file in another location except the tmp/
cache folder? If not isn't this an unreliable way to save data that I
want to use later?

Thanks again for your big help!

On Jul 16, 12:39 am, Renan Gonçalves [EMAIL PROTECTED] wrote:
 And... if you wanna store this data permanently you must save on a local
 file.
 To do it, use Configure::store and Configure::load

 []'s



 On Tue, Jul 15, 2008 at 4:36 PM, Gonzalo Servat [EMAIL PROTECTED] wrote:
  On Tue, Jul 15, 2008 at 4:02 PM, kik [EMAIL PROTECTED] wrote:

  [..snip..]
  ... As far as I understand when you
  use Configure::write it's storing a data in the config file and the
  data is permanently stored.

  Nope. As far as I know, Configure::write() 'writes' the variable into the
  Configure instance.

  But when I try to get the data from
  another controller or even another action of the same controller I'm
  not able to read the value.

  If you are expecting to write in one call then read in another call, then
  you probably want to use sessions for that.

  It seems that I'm able to get the value
  only from the same action that writes to Configure. Does this mean
  that Configure::write does not store the information permanently? For
  instance I have an action:

  As above, that's correct. It does not store information permanently.

  I will be thankfrul if someone explains to me how this works! Thank
  you in advance for any suggestions!

  This is my understanding of the Configure class.

  Group: If I gave any wrong info, please feel free to correct me.

  - Gonzalo

 --
 Renan Gonçalves - Software Engineer
 Cell Phone: +55 11 8633 6018
 MSN: [EMAIL PROTECTED]
 São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Configure::write

2008-07-15 Thread kik

Hi,

I'm new to cakephp and I was reading the tutorial about
Configure::write and Configure::read. As far as I understand when you
use Configure::write it's storing a data in the config file and the
data is permanently stored. But when I try to get the data from
another controller or even another action of the same controller I'm
not able to read the value. It seems that I'm able to get the value
only from the same action that writes to Configure. Does this mean
that Configure::write does not store the information permanently? For
instance I have an action:

index() {
Configure::write('example', 'myname');
}
and then:

view() {
Configure::read('example');
}
Basically I'm not able to get the value of Example(which is 'myname')
from any other action than index. If I try to read the value from
view() it does not return anything.

I will be thankfrul if someone explains to me how this works! Thank
you in advance for any suggestions!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write

2008-07-15 Thread Gonzalo Servat
On Tue, Jul 15, 2008 at 4:02 PM, kik [EMAIL PROTECTED] wrote:


 [..snip..]
 ... As far as I understand when you
 use Configure::write it's storing a data in the config file and the
 data is permanently stored.


Nope. As far as I know, Configure::write() 'writes' the variable into the
Configure instance.


 But when I try to get the data from
 another controller or even another action of the same controller I'm
 not able to read the value.


If you are expecting to write in one call then read in another call, then
you probably want to use sessions for that.


 It seems that I'm able to get the value
 only from the same action that writes to Configure. Does this mean
 that Configure::write does not store the information permanently? For
 instance I have an action:


As above, that's correct. It does not store information permanently.

I will be thankfrul if someone explains to me how this works! Thank
 you in advance for any suggestions!


This is my understanding of the Configure class.

Group: If I gave any wrong info, please feel free to correct me.

- Gonzalo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write

2008-07-15 Thread Renan Gonçalves
And... if you wanna store this data permanently you must save on a local
file.
To do it, use Configure::store and Configure::load


[]'s

On Tue, Jul 15, 2008 at 4:36 PM, Gonzalo Servat [EMAIL PROTECTED] wrote:

 On Tue, Jul 15, 2008 at 4:02 PM, kik [EMAIL PROTECTED] wrote:


 [..snip..]
 ... As far as I understand when you
 use Configure::write it's storing a data in the config file and the
 data is permanently stored.


 Nope. As far as I know, Configure::write() 'writes' the variable into the
 Configure instance.


 But when I try to get the data from
 another controller or even another action of the same controller I'm
 not able to read the value.


 If you are expecting to write in one call then read in another call, then
 you probably want to use sessions for that.


 It seems that I'm able to get the value
 only from the same action that writes to Configure. Does this mean
 that Configure::write does not store the information permanently? For
 instance I have an action:


 As above, that's correct. It does not store information permanently.

 I will be thankfrul if someone explains to me how this works! Thank
 you in advance for any suggestions!


 This is my understanding of the Configure class.

 Group: If I gave any wrong info, please feel free to correct me.

 - Gonzalo


 



-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Is Configure::write('Config.language', rus) writing to a static variable, and hence will not work in a concurrent system

2008-04-28 Thread robert123

hello,

I am implementing i18n, but dont seem to get answer to the above
question, so hope some one can help me

I set up two languages in my app: 'en-gb' and 'rus'.

In core.php I added:
define('DEFAULT_LANGUAGE', 'en-gb');
Configure::write('Config.language', 'en-gb');

In my app_controller beforeFilter:

Configure::write('Config.language', rus); //can be en-gb or rus

I am using  Configure::write('Config.language', rus);  in the before
filter method to set the locale for the user everytime he access the
web application.

My questions is whether Configure::write('Config.language', rus); is
writing to a static variable, since from my understanding
Configure::write is writing to a application wide variable.

If it is a static variable, the locale setting will be corrupted once
another user happen to access at the same time with another locale.
Hope someone can highlight if this is the correct way, thank you


www.generics.ws
www.genericsmed.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Is Configure::write('Config.language', rus) writing to a static variable, and hence will not work in a concurrent system

2008-04-28 Thread [EMAIL PROTECTED]

Unlike in Java (and RoR I think), PHP-apps do not have any common
application running. The whole app is setup and torn down for each
request. User A setting a value in PHP will never affect User B under
normal circumstances. (Exploiting security-holes is of-course another
matter.)

/Martin


On Apr 28, 5:27 am, robert123 [EMAIL PROTECTED] wrote:
 hello,

 I am implementing i18n, but dont seem to get answer to the above
 question, so hope some one can help me

 I set up two languages in my app: 'en-gb' and 'rus'.

 In core.php I added:
 define('DEFAULT_LANGUAGE', 'en-gb');
 Configure::write('Config.language', 'en-gb');

 In my app_controller beforeFilter:

 Configure::write('Config.language', rus); //can be en-gb or rus

 I am using  Configure::write('Config.language', rus);  in the before
 filter method to set the locale for the user everytime he access the
 web application.

 My questions is whether Configure::write('Config.language', rus); is
 writing to a static variable, since from my understanding
 Configure::write is writing to a application wide variable.

 If it is a static variable, the locale setting will be corrupted once
 another user happen to access at the same time with another locale.
 Hope someone can highlight if this is the correct way, thank you

 www.generics.wswww.genericsmed.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Controller variables VS. Configure::write()

2008-04-24 Thread aranworld

So, let's say I want to set a flag that determines whether or not a
login link should be displayed if a visitor to my site is not logged
in.

Which is the more cake friendly way to do this?

// put this in my AppController
var $displayLoginLink = TRUE;

OR

// put this in my bootstrap.php
Configure::write('Auth.displayLoginLink', TRUE);


Is there any general rule of thumb regarding when to use an
AppController variable and when to use a Config::write() variable?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Controller variables VS. Configure::write()

2008-04-24 Thread b logica

I have my login in one place only, so this may not be useful to you.
But I just check the session for a user in my nav element. If so, the
logout link and other stuff is displayed; if not, the login link.

On Thu, Apr 24, 2008 at 1:51 PM, aranworld [EMAIL PROTECTED] wrote:

  So, let's say I want to set a flag that determines whether or not a
  login link should be displayed if a visitor to my site is not logged
  in.

  Which is the more cake friendly way to do this?

  // put this in my AppController
  var $displayLoginLink = TRUE;

  OR

  // put this in my bootstrap.php
  Configure::write('Auth.displayLoginLink', TRUE);


  Is there any general rule of thumb regarding when to use an
  AppController variable and when to use a Config::write() variable?

  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



I18n, is this correct way? Configure::write('Config.language', en);

2008-04-22 Thread robert123

In the cakephp 1.2 cookbook 
http://book.cakephp.org/view/161/localization-internationalizat

There is a section

$this-L10n = new L10n();
$this-L10n-get(en);
 Configure::write('Config.language', en);

I read  that configure will change the whole application settings. Is
this correct way to implement i18n, since every user have different
locale, and if every user execute the statement above, than it will
change the locale for other user also.

I have tried $this-Session-write('Config.language','en-gb');

but the function __() just will not take any locale from there. Any
help will be deeply appreciated,


www.generics.ws
www.genericsmed.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18n, is this correct way? Configure::write('Config.language', en);

2008-04-22 Thread David Christopher Zentgraf

I just had that same issue the other day, see thread:
http://groups.google.com/group/cake-php/browse_thread/thread/3ada672bf5a86b6b/cf386c0d99eca0bf

Basically, all you do is this in your core.php config file:
Configure::write('Config.language', eng);

This establishes the default language for your app.

Then as the very first thing in beforeFilter, probably best in  
AppController::beforeFilter,
you do the same again to temporarily change the language to something  
else.

Forget about $this-L10n altogether.


On 23 Apr 2008, at 10:07, robert123 wrote:


 In the cakephp 1.2 cookbook 
 http://book.cakephp.org/view/161/localization-internationalizat

 There is a section

 $this-L10n = new L10n();
 $this-L10n-get(en);
 Configure::write('Config.language', en);

 I read  that configure will change the whole application settings. Is
 this correct way to implement i18n, since every user have different
 locale, and if every user execute the statement above, than it will
 change the locale for other user also.

 I have tried $this-Session-write('Config.language','en-gb');

 but the function __() just will not take any locale from there. Any
 help will be deeply appreciated,


 www.generics.ws
 www.genericsmed.com

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


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18n, is this correct way? Configure::write('Config.language', en);

2008-04-22 Thread Femi Taiwo





Additional Info:

Also add this to your beforeFilter.


 Configure::write('Cache.disable', Configure::read('debug'));
...

Your default.po file is by default cached, so any changes you make to
it while developing does not show up for a while.
With this, if you're in debug mode, cool - the default.po file is read
everytime so changes show up immediately, otherwise.cached.

Femi T


David Christopher Zentgraf wrote:

  I just had that same issue the other day, see thread:
http://groups.google.com/group/cake-php/browse_thread/thread/3ada672bf5a86b6b/cf386c0d99eca0bf

Basically, all you do is this in your core.php config file:
Configure::write('Config.language', "eng");

This establishes the default language for your app.

Then as the very first thing in beforeFilter, probably best in  
AppController::beforeFilter,
you do the same again to temporarily change the language to something  
else.

Forget about $this-L10n altogether.


On 23 Apr 2008, at 10:07, robert123 wrote:

  
  
In the cakephp 1.2 cookbook http://book.cakephp.org/view/161/localization-internationalizat

There is a section

$this-L10n = new L10n();
$this-L10n-get("en");
Configure::write('Config.language', "en");

I read  that configure will change the whole application settings. Is
this correct way to implement i18n, since every user have different
locale, and if every user execute the statement above, than it will
change the locale for other user also.

I have tried $this-Session-write('Config.language','en-gb');

but the function __() just will not take any locale from there. Any
help will be deeply appreciated,


www.generics.ws
www.genericsmed.com



  



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups CakePHP group.  To post to this group, send email to cake-php@googlegroups.com  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  -~--~~~~--~~--~--~---





Router::mapResources with Configure::write('Routing.admin', 'admin');

2007-11-01 Thread slawil

Hi,
I have enable Configure::write('Routing.admin', 'admin'); in core.php

and add

Router::mapResources('translators');

to route.php


now when i try to send HTTP DELETE request to /admin/translators/1
I'm getting error:

Missing Method in TranslatorsController
You are seeing this error because the action admin_1 is not defined in
controller TranslatorsController

i try with
Router::mapResources('translators',params(prefix=admin/)); but
without any luck.

Is it this possible in cake 1.2 pre-beta to use admin routing with
REST routing ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Configure::write question

2006-12-11 Thread Langdon Stevenson

I am attempting to make use of the new Configure class to dynamically 
set the debug level to 0 in some of my (AJAX) methods.

I assume that all I need to do is:

   function getSomeData() {
 Configure::write('debug', '0');
 code to find and set data ...
   }


Is this correct?  I have tried this but am still getting debug output in 
the returned content, but no errors.

If I do:

   echo Configure::read('debug');

After setting debug to 0 then it returns 0 as expected.

Can anyone suggest what I am doing wrong?

Regards,
Langdon


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
Cake PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write question

2006-12-11 Thread Ryan

Are you talking about the SQL dump debug output or something else? I
have found that the showLog function in dbo_source.php is called before
the Configure class is loaded so dynamically setting the value at
runtime does not effect the SQL log output.

However, you can preven the SQL dump from displaying by adding these
lines in your beforeFilter method:
$db = ConnectionManager::getDataSource('default');
$db-fullDebug = false;

If you are not talking about the SQL debug then make sure the code
checking the debug level is checking Configure::read() and not the
DEBUG constant set in core.php.
HTH,
Ryan Rose
digiwize.com


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
Cake PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write question

2006-12-11 Thread Langdon Stevenson

Hi Ryan, thanks for your feedback.

 Are you talking about the SQL dump debug output or something else? I
 have found that the showLog function in dbo_source.php is called before
 the Configure class is loaded so dynamically setting the value at
 runtime does not effect the SQL log output.

Yes, I was referring to the SQL dump.  That clears it up for me  I was 
expecting the SQL output to be hidden as well.

For now I have put an IF statement in Core.php that checks for bare 
URLs, if so it sets debug to 0.

Regards,
Langdon

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
Cake PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write question

2006-12-11 Thread Langdon Stevenson

Hi Mandy

 Alternatively, for the ajax response, you can also send a style for
 #cakeSqlLog or something like that with display:none so that the log is
 not displayed. Simple css fix rather than getting into all the
 calculations :)

Thanks for the suggestion, that would a neat way around the problem.

Regards,
Langdon

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
Cake PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Configure::write question

2006-12-11 Thread [EMAIL PROTECTED]

Hi all

simple css fix wont work if the output is xml format. You need to set
the debug to zero while testing. This is cumbersome. But I dont know
any way around this.


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
Cake PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---