Results 1 to 6 of 6

Thread: I want some informations about $GLOBALS

  1. #1
    shrisamsalunke is offline Sugar Community Member
    Join Date
    Dec 2011
    Posts
    46

    Default I want some informations about $GLOBALS

    hello everyone,
    please give me in brief about $GLOBALS (specialy $GLOBALS['log']).......................i don't know what exactly it do...........this is inside link.php and sugatBean.php file..................Is this help me for removing errors regard database?

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: I want some informations about $GLOBALS

    $GLOBALS are php native special variables, which are registered by SugarCRM inside include/entryPoint.php, they are link to special SugarCRM variables, like $db, $log, $current_user etc.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    shrisamsalunke is offline Sugar Community Member
    Join Date
    Dec 2011
    Posts
    46

    Default Re: I want some informations about $GLOBALS

    hi andopes,
    thanks for rply................but what is use of $globals and exactly where i can use this $globals??
    i thing if you give me one example then it will be more helping me.............

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: I want some informations about $GLOBALS

    We use globals to easily access special SugarCRM variables.

    When you want to access a sugar config attribute you can do by two ways:

    PHP Code:
    global $sugar_config;

    $variable $sugar_config['some_attribute']; 
    or directaly:

    PHP Code:
    $variable $GLOBALS['sugar_config']['some_attribute']; 
    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: I want some informations about $GLOBALS

    Just to complement, to know more details about what $GLOBALS contains, you could execute the follow:
    <pre>
    <?php print_r($GLOBALS) ?>
    </pre>
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  6. #6
    shrisamsalunke is offline Sugar Community Member
    Join Date
    Dec 2011
    Posts
    46

    Default Re: I want some informations about $GLOBALS

    Thanks both of you.............this helping me

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to collect informations from other modules to display
    By naveen2k7 in forum Developer Help
    Replies: 3
    Last Post: 2010-06-03, 05:35 PM
  2. Where does $GLOBALS['db'] first get $db
    By josh.sweeney in forum Developer Help
    Replies: 4
    Last Post: 2008-12-01, 02:05 PM
  3. Replies: 3
    Last Post: 2008-07-09, 01:37 PM
  4. print_r($GLOBALS) === 'OMG!!!'
    By kmitz in forum Developer Help
    Replies: 0
    Last Post: 2007-11-02, 08:33 PM
  5. Replies: 13
    Last Post: 2006-09-20, 04:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •