Source for file Framework.php

Documentation is available at Framework.php

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework
  5. 5:  *
  6. 6:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  7. 7:  * @license    http://nettephp.com/license  Nette license
  8. 8:  * @link       http://nettephp.com
  9. 9:  * @category   Nette
  10. 10:  * @package    Nette
  11. 11:  */
  12. 12:  
  13. 13:  
  14. 14:  
  15. 15: /**
  16. 16:  * The Nette Framework.
  17. 17:  *
  18. 18:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  19. 19:  * @package    Nette
  20. 20:  */
  21. 21: final class Framework
  22. 22: {
  23. 23:  
  24. 24:     /**#@+ Nette Framework version identification */
  25. 25:     const NAME 'Nette Framework';
  26. 26:  
  27. 27:     const VERSION '0.9.4';
  28. 28:  
  29. 29:     const REVISION 'ae0c8bd released on 2010-04-14';
  30. 30:  
  31. 31:     const PACKAGE 'PHP 5.2';
  32. 32:     /**#@-*/
  33. 33:  
  34. 34:  
  35. 35:  
  36. 36:     /**
  37. 37:      * Static class - cannot be instantiated.
  38. 38:      */
  39. 39:     final public function __construct()
  40. 40:     {
  41. 41:         throw new LogicException("Cannot instantiate static class " get_class($this));
  42. 42:     }
  43. 43:  
  44. 44:  
  45. 45:  
  46. 46:     /**
  47. 47:      * Compares current Nette Framework version with given version.
  48. 48:      * @param  string 
  49. 49:      * @return int 
  50. 50:      */
  51. 51:     public static function compareVersion($version)
  52. 52:     {
  53. 53:         return version_compare($versionself::VERSION);
  54. 54:     }
  55. 55:  
  56. 56:  
  57. 57:  
  58. 58:     /**
  59. 59:      * Nette Framework promotion.
  60. 60:      * @return void 
  61. 61:      */
  62. 62:     public static function promo($xhtml TRUE)
  63. 63:     {
  64. 64:         echo '<a href="http://nettephp.com/" title="Nette Framework - The Most Innovative PHP Framework"><img ',
  65. 65:             'src="http://nettephp.com/images/nette-powered.gif" alt="Powered by Nette Framework" width="80" height="15"',
  66. 66:             ($xhtml ' />' '>')'</a>';
  67. 67:     }
  68. 68:  
  69. 69:  
  70. 70:     
  71. 71:     /**
  72. 72:      * Fixes namespaced class/interface in PHP < 5.3
  73. 73:      */
  74. 74:     public static function fixNamespace($class)
  75. 75:     {
  76. 76:         if ($a strrpos($class'\\')) {
  77. 77:             $class substr($class$a 1);
  78. 78:         }
  79. 79:     }
  80. 80:     
  81. 81:  
  82. 82: }