bootstrap_cli.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. * @link http://cakephp.org CakePHP(tm) Project
  12. * @since 3.0.0
  13. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  14. */
  15. use Cake\Core\Configure;
  16. use Cake\Core\Exception\MissingPluginException;
  17. use Cake\Core\Plugin;
  18. /**
  19. * Additional bootstrapping and configuration for CLI environments should
  20. * be put here.
  21. */
  22. // Set the fullBaseUrl to allow URLs to be generated in shell tasks.
  23. // This is useful when sending email from shells.
  24. //Configure::write('App.fullBaseUrl', php_uname('n'));
  25. // Set logs to different files so they don't have permission conflicts.
  26. Configure::write('Log.debug.file', 'cli-debug');
  27. Configure::write('Log.error.file', 'cli-error');
  28. try {
  29. Plugin::load('Bake');
  30. } catch (MissingPluginException $e) {
  31. // Do not halt if the plugin is missing
  32. }