"PHP" / Говнокод #23297 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
function db($class, $configName)
{
    eval("class $class extends Database {
        public static function staticConstruct()
        {
            global \$fcConfig;
            \$db                  = \$fcConfig->get('db');
            static::\$host          = \$db->get('$configName.host');
            static::\$user_name     = \$db->get('$configName.username');
            static::\$user_pass     = \$db->get('$configName.password');
            static::\$database_name = \$db->get('$configName.dbname');

            static::connect();
        }
    }
    
    \$class::staticConstruct();");
}

db( 'DB', 'connection' );

Нужно больше динамикиблять....

Запостил: rez1dent3 rez1dent3, (Updated )

Комментарии (0) RSS

Добавить комментарий

Семь раз отмерь — один отрежь, guest!

    А не использовать ли нам bbcode?


    8