Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Trivial Patch: Remove warnings about 'Undefined index: debug_profile'

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1804 Views
  • elijahlofgren
    Avatar
    Google Summer of Code Hacker
    222 Posts

    Trivial Patch: Remove warnings about 'Undefined index: debug_profile' Link to this post

    This simple patch fixes warnings about debug_profile that I get on silverstripe.2.0.DailyBuild.2007-05-15

    Edit: It seems the forum might have messed up the patch.
    You can download it here instead of using the below: http://www.elijahlofgren.com/silverstripe/patches/Fix-debug_profile-errors-silverstripe.2.0.DailyBuild.2007-05-15.patch

    Index: sapphire/main.php
    ===================================================================
    --- sapphire/main.php (revision 1)
    +++ sapphire/main.php (working copy)
    @@ -48,7 +48,7 @@
    if(isset($_GET['debug_profile'])) Profiler::init();
    if(isset($_GET['debug_profile'])) Profiler::mark('all_execution');

    -if($_GET['debug_profile']) Profiler::mark('main.php init');
    +if(isset($_GET['debug_profile'])) Profiler::mark('main.php init');

    // Default director
    Director::addRules(10, array(
    @@ -69,9 +69,9 @@
    // Connect to database
    require_once("core/model/DB.php");

    -if($_GET['debug_profile']) Profiler::mark('DB::connect');
    +if(isset($_GET['debug_profile'])) Profiler::mark('DB::connect');
    DB::connect($databaseConfig);
    -if($_GET['debug_profile']) Profiler::unmark('DB::connect');
    +if(isset($_GET['debug_profile'])) Profiler::unmark('DB::connect');

    // Get the request URL
    @@ -92,7 +92,7 @@

    // Direct away - this is the "main" function, that hands control to the apporopriate controllerx

    -if($_GET['debug_profile']) Profiler::unmark('main.php init');
    +if(isset($_GET['debug_profile'])) Profiler::unmark('main.php init');

    $dir = new Director();
    $dir->direct($url);

  • Andy
    Avatar
    230 Posts
    1804 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.