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
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()
met
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:
>
> http://dsi.vozibrale.com/articles/view/simple-db-base
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,
>
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, "ji
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 wi
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
>
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
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 receive
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.p
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
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"
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
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');
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 grou
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?
--~--~-~--~~~---~--~
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 subscribed
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;
>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
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 b
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
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. i
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
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
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 controllers
I think the intended place for global defines is in app/config/bootstrap.php ... that's where I put mine.On 5/16/06, John David Anderson (_psychic_) <
[EMAIL PROTECTED]> wrote:Vendors is a great way to include stuff:
1. Stick your php file in /app/vendors2. Get it in Cake with vendor('nameoffile');
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 Zimmerman
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 u
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 cake-php@googlegroups
Instead of core.php try bootstrap.php in your app/config dir
--~--~-~--~~~---~--~~
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
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 Everyo
Hello Everyone,
Is there a way to register an array as global using Cake? Kind of like
application wide settings array that I can load from a database.
Something like
$settings = array();
$this->register->settings($settings)
Then you can access $this->settings anywhere?
--~--~-~--~--
32 matches
Mail list logo