How can I Show my Database Global Variables and Full Process List?

2012-08-29 Thread andrewperk
Hello, I need to be able to print out some data from my database such as: SHOW FULL PROCESSLIST SHOW GLOBAL STATUS SHOW GLOBAL VARIABLES LIKE 'hostname' etc.. How can I accomplish this? What I've been trying to do is use the query() method in a model to run my own custom query but that's

Re: How can I Show my Database Global Variables and Full Process List?

2012-08-29 Thread lowpass
database such as: SHOW FULL PROCESSLIST SHOW GLOBAL STATUS SHOW GLOBAL VARIABLES LIKE 'hostname' etc.. How can I accomplish this? What I've been trying to do is use the query() method in a model to run my own custom query but that's not working: $this-query(SHOW FULL PROCESSLIST

Re: Getting global variables from Database in cakePHP

2008-10-07 Thread dr. Hannibal Lecter
Maybe something like this would help you: http://dsi.vozibrale.com/articles/view/simple-db-based-configuration-for-cakephp-apps There is also a working (and slightly improved) example in my CMS project (same site). Hope that helps! On Oct 7, 6:58 am, Jipson [EMAIL PROTECTED] wrote: Hi,      

Re: Getting global variables from Database in cakePHP

2008-10-07 Thread Jipson
Thank you all.Thanks a lot. Dr. Hannibal Lecter's suggestion helped me. Now my problem is solved. Once again thank you all. On Oct 7, 1:06 pm, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: Maybe something like this would help you:

Getting global variables from Database in cakePHP

2008-10-06 Thread Jipson
Hi Friends, Now I am facing a problem that, in my project I havesome datas like (admin email, site name, payapal email etc) in my settings table.I have to get these all values throughout in my project like global variables in php.What are the steps I have to do for it? Please help me

Re: Getting global variables from Database in cakePHP

2008-10-06 Thread mark_story
On Oct 6, 8:30 am, Jipson [EMAIL PROTECTED] wrote: Hi Friends, Now I am facing a problem that, in my project I havesome datas like (admin email, site name, payapal email etc) in my settings table.I have to get these all values throughout in my project like global variables in php.What

Re: Getting global variables from Database in cakePHP

2008-10-06 Thread jitka (poLK)
For example, you can - load necessary settings from db when you need them - load all settings once and use Configure::store() (also called from afterSave callback of this model), Configure::load() (called from bootstrap) and then Configure::read() where necessary - same approach as 2nd one, but

Re: Getting global variables from Database in cakePHP

2008-10-06 Thread Jipson
Hi, Thank you Jitka and mark. I tried with jitka's solution but,as a new developer to cakephp I couldn't obtain the solutions. I searched the tutorials also but I didn't got it.Can you please explain it with some examples please Thanks, Jipson. On Oct 6, 8:09 pm,

global variables

2007-01-28 Thread Sergei
Hi, what's an easy way to have some global variables and arrays available to my controllers and views? I tried to insert some array to bootstrap.php like $myarray = array (); But I cannot access it from my controller. any help? --~--~-~--~~~---~--~~ You

Re: global variables

2007-01-28 Thread Grant Cox
Use define, in your bootstrap.php define( 'YOUR_IMPORTANT_VALUE', array() ); then use YOUR_IMPORTANT_VALUE in your controller. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this

Re: global variables

2007-01-28 Thread jitka
You can use Configure class for Your need, ie in Your bootstrap.php call Configure::write('App.varOne', array('someKey' = 'someValue')); Configure::write('App.varTwo', true); Configure::write('App.varThree', 159); and somewhere in Your code You can call $app_config = Configure::read('App');

Re: global variables

2007-01-28 Thread Sergei
I tried this, of course. That won't work, because define can handle only SCALAR variables. Arrays are not scalar. == Warning: Constants may only evaluate to scalar values == And the variable isn't available. Another ideas? How come so powerful framework cannot handle such easy task as global

Re: global variables

2007-01-28 Thread Sergei
Thanks, looks promising! On 28 Янв., 19:48, jitka [EMAIL PROTECTED] wrote: You can use Configure class for Your need, ie in Your bootstrap.php call --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group.

Re: global variables

2007-01-28 Thread Michal Bilcik
Hello, 28. 1. 2007, Sergei: what's an easy way to have some global variables and arrays available to my controllers and views? You can create your config file (my_settings.php) in app\config directory with variables: $config['my_variable'] = '123'; and in controller you load this config

Re: global variables

2007-01-28 Thread Sergei
thank you, I guess that's what I need. On 28 Янв., 22:14, Michal Bilcik [EMAIL PROTECTED] wrote: what's an easy way to have some global variables and arrays available to my controllers and views?You can create your config file (my_settings.php) in app\config directory with variables

Re: global variables

2007-01-28 Thread Sergei
Hi, is there any way to load the config only one time somewhere in app- controller? On 28 Янв., 22:14, Michal Bilcik [EMAIL PROTECTED] wrote: and in controller you load this config file: Configure::load('my_settings'); --~--~-~--~~~---~--~~ You received

Re: Global variables?

2006-05-26 Thread AD7six
Hi All, This is on the Wiki now (http://wiki.cakephp.org/tutorials:css_menus) , Hope it's useful and if there are any updates, I don't own it - feel free to enhance it ;). Cheers, AD7six --~--~-~--~~~---~--~~ You received this message because you are

Re: Global variables?

2006-05-24 Thread Olivier percebois-Garve
For a while AD7six provided the following. I'm not sure its up-to-date, it's my version I can't find the original anymore. The idea is to put your menu in a component so you load it only where its needed. Personally I have a dynamic menu and I build it in the model but I can't say if its the

Re: Global variables?

2006-05-24 Thread 100rk
I can't find the original anymore. I saw it also and I also cannot find it :) When I'm in need for such as global configuration options, I'm using my 'Config' component, which API simply follows SessionComponent API. NOTE FOR ALL: it is licensed under one term: If You will use it, check if there

Re: Global variables?

2006-05-24 Thread 100rk
Little enhancement for this component for those who are using multiple places for M/V/C files: function getModelPaths() { $config = Configure::getInstance(); return $config-modelPaths; } function getViewPaths() { $config = Configure::getInstance(); return $config-viewPaths; }

Global variables?

2006-05-23 Thread felle42
Hello, I'm new to CakePHP. I found some comments on how to access global variables so i've put an array-variable into the /app/conf/bootstrap.php but i can´t access it in my AppController::beforeFilter()-Method. The file(bootstrap.php) is loaded by the framework. I have verified that by putting

Re: Global variables?

2006-05-23 Thread 100rk
if You defined those vars in bootstrap.php by code global $abc, $def; $abc = true; $def = 'XXX'; then You can acces them in Controller::beforeFilter() method by global $def; $this-set('def', $def); But You IMO have to consider, if You really need global variable. I'm trying to say there will

Re: Global variables?

2006-05-23 Thread felle42
Thanks 100rk. setting the variables in bootstrap.php global did it for me! But why do I have to do this? isn´t the file(bootstrap.php) included by a php-include or -require? I need the global varibals for implementing submenues. I define them as an array an the controller selects the right one.

Re: Global variables?

2006-05-23 Thread 100rk
File bootstrap is included in method Configure::__loadBootstrap() so You have to mark Your global variables by keyword 'global' as global - otherwise they are valid only in scope inside of above mentioned method. About global variables: if this solution is good enough for You, then it is perfect

Global Variables

2006-05-16 Thread John Zimmerman [gmail]
I have a file I often include that has a bunch of arrays that I made with data for things like United States, names/abreviations/etc...I am trying to use require_once to include this file in the app_controller.php and then access the data by declaring a global in local scope. So far I have been

Re: Global Variables

2006-05-16 Thread John David Anderson (_psychic_)
Vendors is a great way to include stuff: 1. Stick your php file in /app/vendors 2. Get it in Cake with vendor('nameoffile'); Globals work best in AppController for me, but I suppose you can throw things in /app/config/bootstrap.php as well. -- John On May 16, 2006, at 5:20 PM, John

Re: Global Variables

2006-05-16 Thread John Zimmerman [gmail]
After monkeying around with it some more this is what I had to do to get access to my variables.Put the require statement in the constructore of the AppController classCreate a class variable and assign the variable from the file I was including to the class variable. Then from my other

Re: Global Variables and Arrays

2006-04-12 Thread wassimk
Thanks for the replies Mika and Jose. They helped out and everything is working great now. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Global Variables and Arrays

2006-04-09 Thread Jose Cedeno
There are several files in which you could put variables to be accessed in other files:app_model.php - in your model variable is accessibleapp_controller.php - in your controllers variable is accessible core.php - anywhere accessibleJoseOn 4/8/06, wassimk [EMAIL PROTECTED] wrote: Hello