Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » can't have a database table called 'class' (for obvious reasons)
Re: can't have a database table called 'class' [message #1946 is a reply to message #1945] Mon, 09 February 2009 11:42 Go to previous message
ikatz is currently offline  ikatz
Messages: 40
Registered: December 2007
Location: Durham, NH
Member
No problem!
function isThisAGoodName($tablename)
{
        //short version requires PECL extension
        //return runkit_lint ("<?php class $tablename {} ?" .  ">");

        //"long" version
        $temp_file = tempnam(sys_get_temp_dir(), 'rad');
        file_put_contents($temp_file, "<?php class $tablename {} ?>");

        $result = `php -lq $temp_file`;

        unlink($temp_file);
        return 0 === strpos($result, "No syntax errors detected");
}
 
Read Message
Read Message
Read Message
Previous Topic: Download of file where name contains spaces
Next Topic: Problem when ListView Total causes new page
Goto Forum:
  


Current Time: Sat Dec 28 20:39:09 EST 2024

Total time taken to generate the page: 0.00916 seconds