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

2012-08-29 Thread lowpass
Works for me:

$q = $this->Post->query("SHOW FULL PROCESSLIST");
die(debug($q));

Of course, debug needs to be enabled, and caching disabled. Have you
checked that?

On Wed, Aug 29, 2012 at 2:24 PM, andrewperk  wrote:
> 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 not working:
>
> $this->query("SHOW FULL PROCESSLIST");
>
> This doesn't return anything, there is no error either, it's just empty. Any
> help would be appreciated.
>
> 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
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




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 not working:

$this->query("SHOW FULL PROCESSLIST");

This doesn't return anything, there is no error either, it's just empty. 
Any help would be appreciated.

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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




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:
>
> http://dsi.vozibrale.com/articles/view/simple-db-based-configuration-...
>
> 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,
> >      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, "jitka (poLK)" <[EMAIL PROTECTED]> wrote:
>
> > > 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 with Cache::write()/read()
--~--~-~--~~~---~--~~
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: 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,
>      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, "jitka (poLK)" <[EMAIL PROTECTED]> wrote:
>
> > 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 with Cache::write()/read()
>
>
--~--~-~--~~~---~--~~
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: 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, "jitka (poLK)" <[EMAIL PROTECTED]> wrote:
> 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 with Cache::write()/read()
--~--~-~--~~~---~--~~
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: 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 with Cache::write()/read()
--~--~-~--~~~---~--~~
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: 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 are the steps I have to do for it? Please
> help me.
>
> Thanks in Advance.
> Jipson

Make a model and dump out the 'settings' to globals would do the
trick.  However, using globals is wrong in almost every situation.
Whats wrong with loading the settings as needed?

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



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.

Thanks in Advance.
Jipson
--~--~-~--~~~---~--~~
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: 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 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: 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:
>
> $config['my_variable'] = '123';


--~--~-~--~~~---~--~~
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: 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 file:

Configure::load('my_settings');

and you can use:

$my_variable = Configure::read('my_variable');

-- 
 Michal Bilcik


--~--~-~--~~~---~--~~
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: 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.
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: 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 
data? :-(


> Use define, in your bootstrap.php
>
> define( 'YOUR_IMPORTANT_VALUE', array() );


--~--~-~--~~~---~--~~
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: 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');

or

$app_var_two = Configure::read('App.varTwo');


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



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



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;
}
function &getControllerPaths()
{
$config =& Configure::getInstance();
return $config->controllerPaths;
}


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



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 is a page about it on cake wiki - if it doesn't exist yet and
You're able describe what is important in correct English, make page
about it on wiki and maintain it in future.

app/controllers/components/config.php:
custom)) {
$config->custom = array();
}
}
function write($name, $value)
{
$config =& Configure::getInstance();
$config->custom[$name] = $value;
}
function read($name = null)
{
if (!is_null($name)) {
if (ConfigComponent::check($name)) {
$config =& Configure::getInstance();
return $config->custom[$name];
}
else {
return null;
}
}
else {
$config =& Configure::getInstance();
return $config->custom;
}
}
function del($name)
{
if (ConfigComponent::check($name)) {
$config =& Configure::getInstance();
$unset($config->custom[$name]);
}
}
function delete($name)
{
ConfigComponent::delete($name);
}
function check($name)
{
$config =& Configure::getInstance();
return isset($config->custom[$name]);
}
}
?>

Usage in controller:
var $uses = array('Config', ...);
and then
$this->set('menuArray', $this->Config->read('menuArray'));

OR anywhere outside of this controller (if dispatcher is processid it's
method) - in view, element, even in model:

$menu = ConfigComponent::read('menuArray');

So in this particular case I will have to put in bootstrap.php code:
$_conf =& Configure::getInstance();
$_conf->custom = array('xyz' => 123);
unset($_conf);

and then access it as is described above.


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



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 best approach.

olivvv

### in your controller:

var $components = array('Menu');
var $beforeFilter = array('init');

function init()
{
// Create menu component
$this->Menu->controller = &$this;
$this->Menu->init($this->name);
}

### the menu.php component



controller->set('MenuItems',$this->MenuItems);
}
}
?>




felle42 wrote:
> 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. is there a better way
> of doing this?
>
> greets
> felle42
>
>
> >
>
>   


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



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 and do not listen to me, it is only question of personal
taste, You know ;-) Truth is: file bootstrap.php is mentioned for such
a things.


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



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. is there a better way
of doing this?

greets
felle42


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



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 be probably 'more clean' way how to achieve
this, if You aren't just include some foreign code.


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



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 a php-syntax error in
it. But I can´t access the variables defined in it. I know I have to
set them global where I try to access them...
I use version 1.0.x.x of the framework.
Any ideas?

greets
felle42


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



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 controllers I can access using $thi->variableI was including the file at the top of my controller file before with no luck.  I could not say...
global $variable;print $variable;I would get no output.Anyway this will work until I get everything working with  vendors.ThanksOn 5/16/06, 
John Zimmerman <[EMAIL PROTECTED]> wrote:
I used vendors, but no change.  I can put a print statement in the file I am including and it prints out after it is included, but I still can't get to the  variables within my contollers.There are no class definitions in this file, just arrays with values.
I must have something else hung up, I will have to go through and see what else might be going wrong.I will report back later, but if anyone has any other suggestions that would be great.Thanks

On 5/16/06, BoBB <[EMAIL PROTECTED]> wrote:

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');Globals work best in AppController for me, but I suppose you canthrow things in /app/config/bootstrap.php as well.

-- JohnOn May 16, 2006, at 5:20 PM, John Zimmerman [gmail] wrote:> 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 unable to get this to work.  My variables aren't> accessible.>> Has anyone else run into problems using globals?>> I have used globals outside of the cakephp framework on this same
> webserver before.>> If you have a suggestion as to a way to do this better I am all> ears as well.>> Thanks>> >






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


Re: Global Variables

2006-05-16 Thread BoBB
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');Globals work best in AppController for me, but I suppose you canthrow things in /app/config/bootstrap.php as well.
-- JohnOn May 16, 2006, at 5:20 PM, John Zimmerman [gmail] wrote:> 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 unable to get this to work.  My variables aren't> accessible.>> Has anyone else run into problems using globals?>> I have used globals outside of the cakephp framework on this same
> webserver before.>> If you have a suggestion as to a way to do this better I am all> ears as well.>> Thanks>> >
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


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 Zimmerman [gmail] wrote:

> 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 unable to get this to work.  My variables aren't  
> accessible.
>
> Has anyone else run into problems using globals?
>
> I have used globals outside of the cakephp framework on this same  
> webserver before.
>
> If you have a suggestion as to a way to do this better I am all  
> ears as well.
>
> Thanks
>
> >


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



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 unable to get this to work.  My variables aren't accessible.Has anyone else run into problems using globals?I have used globals outside of the cakephp framework on this same webserver before.
If you have a suggestion as to a way to do this better I am all ears as well.Thanks

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


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



Re: Global Variables and Arrays

2006-04-09 Thread Mika

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 group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



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

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


Global Variables and Arrays

2006-04-08 Thread wassimk

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?


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