f3.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
  4. This file is part of the Fat-Free Framework (http://fatfreeframework.com).
  5. This is free software: you can redistribute it and/or modify it under the
  6. terms of the GNU General Public License as published by the Free Software
  7. Foundation, either version 3 of the License, or later.
  8. Fat-Free Framework is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License along
  13. with Fat-Free Framework. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. //! Legacy mode enabler
  16. class F3 {
  17. static
  18. //! Framework instance
  19. $fw;
  20. /**
  21. * Forward function calls to framework
  22. * @return mixed
  23. * @param $func callback
  24. * @param $args array
  25. **/
  26. static function __callstatic($func,array $args) {
  27. if (!self::$fw)
  28. self::$fw=Base::instance();
  29. return call_user_func_array([self::$fw,$func],$args);
  30. }
  31. }