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

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
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
class date {
    public static function check($month, $day, $year) { return checkdate($month, $day, $year); }
    public static function set_timezone($timezone) { return date_default_timezone_set($timezone); }
    public static function get_timezone() { return date_default_timezone_get(); }
    public static function parse_from_format($format, $date) { return date_parse_from_format($format, $date); }
    public static function parse($date) { return date_parse($date); }
    public static function sun_info($time, $latitude, $longitude) { return date_sun_info($time, $latitude, $longitude); }
    public static function sunrise($timestamp, $format = SUNFUNCS_RET_STRING , $latitude = null, $longitude = null, $zenith = null, $gmt_offset = 0) { return date_sunrise($timestamp, $format, $latitude, $longitude, $zenith, $gmt_offset); }
    public static function sunset($timestamp, $format = SUNFUNCS_RET_STRING , $latitude = null, $longitude = null, $zenith = null, $gmt_offset = 0) { return date_sunset($timestamp, $format, $latitude, $longitude, $zenith, $gmt_offset); }
    public static function format($format, $timestamp = null) { if ($timestamp) return date($format, $timestamp); else return date($format); }
    public static function getdate($timestamp = null) { if ($timestamp) return getdate($timestamp); else return getdate(); }
    public static function gmformat($format, $timestamp = null) { if ($timestamp) return gmdate($format, $timestamp); else return gmdate($format); }
    public static function idate($format, $timestamp = null) { if ($timestamp) return idate($format, $timestamp); else return idate($format); }
}

class file extends stream_base {
    private $fp;
    public static function open($file, $mode) { return new self(fopen($file, $mode)); }
    private function __construct($fp) { $this->fp = $fp; }
    public static function isReadable($filename) { return is_readable($filename); }
    public static function isWritable($filename) { return is_writeable($filename); }
    public static function isExecutable($filename) { return is_executable($filename); }
    public static function size($filename) { return filesize($filename); }
    public static function mtime($filename) { return filemtime($filename); }
    public static function atime($filename) { return fileatime($filename); }
    public static function ctime($filename) { return filectime($filename); }
    public static function group($filename) { return filegroup($filename); }
    public static function perms($filename) { return fileperms($filename); }
    public static function owner($filename) { return fileowner($filename); }
    public static function type($filename) { return filetype($filename); }
    public static function chgrp($filename, $group) { return chgrp($filename, $group); }
    public static function chmod($filename, $mode) { return chmod($filename, $mode); }
    public static function chown($filename, $owner) { return chown($filename, $owner); }
    public static function copy($source, $dest) { return copy($source, $dest); }
    public static function delete($filename) { return unlink($filename); }
    public static function isDir($file) { return is_dir($file); }
    public static function isFile($file) { return is_file($file); }
    public static function isLink($file) { return is_link($file); }
    public static function md5($filename) { return md5_file($filename); }
    public static function sha1($filename) { return sha1_file($filename); }
    public static function ini($file, $sections = false, $mode = INI_SCANNER_NORMAL) { return parse_ini_file($file, $sections, $mode); }
    public static function xml($file) { $simple_xml = simplexml_load_file($file); return (array)$simple_xml; }
    public static function json($file, $assoc = false, $options = 0) { return json_decode(file_get_contents($file), $assoc, 512, $options); }
}

class url {
    public static function parse($url, $component = -1) { return parse_url($url, $component); }
    public static function encode($url) { return urlencode($url); }
    public static function decode($url) { return urldecode($url); }
    public static function raw_encode($url) { return rawurlencode($url); }
    public static function raw_decode($url) { return rawurldecode($url); }
    public static function headers($url, $format = 0) { return get_headers($url, $format); }
    public static function meta_tags($url, $format = 0) { return get_meta_tags($url); }
}

И такого еще навалом. Представляю вам PHP-API-Beautifier.

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

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

  • Вот что бывает, дети, когда изначально отвратительный, лишенный кодстайла язык, пытаются причесать.

    Нужно или зактнуть нос и пийсать на пхп как он есть, или валить куда-нить где изначально был кодстайл.

    Напоминает одного чувака который в 2005м году на PHP4 напилил классы Collection, Array и Set чтобы иметь ооп коллекции
    Ответить
    • Да и не понятно когда подчеркивание писать, а когда нет
      Ответить
      • А в J нижнее подчеркивание в именах означает обращение к полям класса, в числах – знак минус, одно подчеркивание – бесконечность, джва – минус бечконечность, _. – NaN, _: – глагол всегда возвращающий бесконечность.

        Спасибо, я кончел.
        Ответить
  • Сперва подумал что джава, потом увидел название раздела и жёстко обломался.
    Ответить
    • В джаве все методы и так прекрасны, зачем их еще раз переименовывать?
      Ответить
      • Превратилась ли твоя "супруга" в принцессу, о связавший свою жизнь с жабой??
        Ответить
        • Она медленно превращается в котлин.

          А у тебя вообще "труп невесты", связавший жизнь с дельфями
          Ответить
            • В том месте где у него дырочка для дыхания?

              На самом деле Дельфи вовсе не дельфин а Пифия. Жрица такая античная. Так что у меня для тебя дурные новости.
              Ответить
              • Не ее ли статуя стояла перед офисом Борланд? Впоследствие, кстати, статую продали на аукционе, чтобы хоть как-то свести концы с концами (


                С тобой неинтересно. Ты демагог и софист.
                Ответить
                • >>Не ее ли статуя стояла перед офисом Борланд?

                  Кто посмел статую из фонтана утащить
                  Весло ей оторвать и на газоне отдуплить?

                  Не знаю. Мне жаль борланд. Они все полимеры порастеряли
                  Ответить
  • В классе file смешались в кучу конелюди... и гарь от тысячи орудий затмила напрочь всё.
    Тут тебе и операции с потоками ввода-вывода, и с файловой системой, и подсчёт хэшей, и чтение различных форматов... стало еще говнистее, имхо.
    Ответить
    • Да и дерьмовое смешение нижних_подчёркиваний и camelCase'а осталось. Действительно говно.
      Ответить

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

Из-за тебя ушел bormand, guest!

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


    8