Worldmonger

Use your god's powers to build & control beautiful 3D worlds on Windows 8 Metro

25|0 Up Down · 0 replies 24/10/2013 10:54pm by marcus

Have problems with SilverStripe and lowercase mysql table names when going to Linux? SS3.0 has code in place that will fix it, but to run dev/build, it actually tries to check the database beforehand. Temporarily patch the following from Controller.php

public function init() {
    if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

    // Directly access the session variable just in case the Group or Member tables don't yet exist
    if(Session::get('loggedInAs') && Security::database_is_ready()) {
        $member = Member::currentUser();
        if($member) {
            if(!headers_sent()) Cookie::set("PastMember", true, 90, null, null, false, true);
            DB::query("UPDATE \"Member\" SET \"LastVisited\" = " . DB::getConn()->now()
                . " WHERE \"ID\" = $member->ID", null);
        }
    }

    // This is used to test that subordinate controllers are actually calling parent::init() - a common bug
    $this->baseInitCalled = true;
}

and add a false statement to make sure the Member table access doesn't occur

public function init() {
    if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

    // Directly access the session variable just in case the Group or Member tables don't yet exist
    if(false && Session::get('loggedInAs') && Security::database_is_ready()) {
        $member = Member::currentUser();
        if($member) {
            if(!headers_sent()) Cookie::set("PastMember", true, 90, null, null, false, true);
            DB::query("UPDATE \"Member\" SET \"LastVisited\" = " . DB::getConn()->now()
                . " WHERE \"ID\" = $member->ID", null);
        }
    }

    // This is used to test that subordinate controllers are actually calling parent::init() - a common bug
    $this->baseInitCalled = true;
}

#php #silverstripe

24|0 Up Down · 0 replies 23/01/2013 10:31am by marcus

Switch to HTTPS Now, For Free

18|0 Up Down · 0 replies 26/09/2013 11:07pm by marcus

php-o

O-syntax for PHP. Contribute to php-o development by creating an account on GitHub.

15|0 Up Down · 0 replies 08/02/2013 11:00am by marcus

#cycling

14|0 Up Down · 0 replies 18/10/2012 12:21pm by marcus

Solr Explain

#solr

12|0 Up Down · 0 replies 29/09/2013 9:28pm by marcus

12|0 Up Down · 0 replies 05/02/2013 10:16pm by marcus