Source for file loader.php

Documentation is available at loader.php

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework
  5. 5:  *
  6. 6:  * Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
  7. 7:  *
  8. 8:  * This source file is subject to the "Nette license" that is bundled
  9. 9:  * with this package in the file license.txt, and/or GPL license.
  10. 10:  *
  11. 11:  * For more information please see http://nettephp.com
  12. 12:  *
  13. 13:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  14. 14:  * @license    http://nettephp.com/license  Nette license
  15. 15:  * @link       http://nettephp.com
  16. 16:  * @category   Nette
  17. 17:  * @package    Nette
  18. 18:  */
  19. 19:  
  20. 20:  
  21. 21:  
  22. 22: /**
  23. 23:  * Check PHP configuration.
  24. 24:  */
  25. 25:  
  26. 26: if (version_compare(PHP_VERSION'5.2.0''<')) {
  27. 27:     throw new Exception('Nette Framework requires PHP 5.2.0 or newer.');
  28. 28: }
  29. 29:  
  30. 30:  
  31. 31: @set_magic_quotes_runtime(FALSE)// intentionally @
  32. 32:  
  33. 33:  
  34. 34:  
  35. 35: /**
  36. 36:  * Nette\Callback factory.
  37. 37:  * @param  mixed   class, object, function, callback
  38. 38:  * @param  string  method
  39. 39:  * @return Callback 
  40. 40:  */
  41. 41: function callback($callback$m NULL)
  42. 42: {
  43. 43:     return ($m === NULL && $callback instanceof Callback$callback new Callback($callback$m);
  44. 44: }
  45. 45:  
  46. 46:  
  47. 47:  
  48. 48: /**
  49. 49:  * Nette\Debug::dump shortcut.
  50. 50:  */
  51. 51: if (!function_exists('dump')) {
  52. 52:     function dump($var)
  53. 53:     {
  54. 54:         foreach (func_get_args(as $argDebug::dump($arg);
  55. 55:         return $var;
  56. 56:     }
  57. 57: }
  58. 58:  
  59. 59:  
  60. 60:  
  61. 61: require_once dirname(__FILE__'/exceptions.php';
  62. 62: require_once dirname(__FILE__'/Framework.php';
  63. 63: require_once dirname(__FILE__'/Object.php';
  64. 64: require_once dirname(__FILE__'/ObjectMixin.php';
  65. 65: require_once dirname(__FILE__'/Callback.php';
  66. 66: require_once dirname(__FILE__'/Loaders/LimitedScope.php';
  67. 67: require_once dirname(__FILE__'/Loaders/AutoLoader.php';
  68. 68: require_once dirname(__FILE__'/Loaders/NetteLoader.php';
  69. 69:  
  70. 70:  
  71. 71: NetteLoader::getInstance()->base dirname(__FILE__);
  72. 72: NetteLoader::getInstance()->register();