PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/www/libs/nette-dev/Framework.php

https://github.com/bazo/Mokuji
PHP | 82 lines | 30 code | 20 blank | 32 comment | 1 complexity | a7b71406003e6b0929bdc6945e845c84 MD5 | raw file
Possible License(s): BSD-3-Clause, MIT
  1. <?php
  2. /**
  3. * Nette Framework
  4. *
  5. * @copyright Copyright (c) 2004, 2010 David Grudl
  6. * @license http://nettephp.com/license Nette license
  7. * @link http://nettephp.com
  8. * @category Nette
  9. * @package Nette
  10. */
  11. /**
  12. * The Nette Framework.
  13. *
  14. * @copyright Copyright (c) 2004, 2010 David Grudl
  15. * @package Nette
  16. */
  17. final class Framework
  18. {
  19. /**#@+ Nette Framework version identification */
  20. const NAME = 'Nette Framework';
  21. const VERSION = '1.0-dev';
  22. const REVISION = '7504d94 released on 2010-04-06';
  23. const PACKAGE = 'PHP 5.2';
  24. /**#@-*/
  25. /**
  26. * Static class - cannot be instantiated.
  27. */
  28. final public function __construct()
  29. {
  30. throw new LogicException("Cannot instantiate static class " . get_class($this));
  31. }
  32. /**
  33. * Compares current Nette Framework version with given version.
  34. * @param string
  35. * @return int
  36. */
  37. public static function compareVersion($version)
  38. {
  39. return version_compare($version, self::VERSION);
  40. }
  41. /**
  42. * Nette Framework promotion.
  43. * @return void
  44. */
  45. public static function promo($xhtml = TRUE)
  46. {
  47. echo '<a href="http://nettephp.com/" title="Nette Framework - The Most Innovative PHP Framework"><img ',
  48. 'src="http://nettephp.com/images/nette-powered.gif" alt="Powered by Nette Framework" width="80" height="15"',
  49. ($xhtml ? ' />' : '>'), '</a>';
  50. }
  51. /**
  52. * Fixes namespaced class/interface in PHP < 5.3
  53. */
  54. public static function fixNamespace(& $class)
  55. {
  56. if ($a = strrpos($class, '\\')) {
  57. $class = substr($class, $a + 1);
  58. }
  59. }
  60. }