install.php 879 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Part of the Fuel framework.
  4. *
  5. * @package Fuel
  6. * @version 1.5
  7. * @author Fuel Development Team
  8. * @license MIT License
  9. * @copyright 2010 - 2013 Fuel Development Team
  10. * @link http://fuelphp.com
  11. */
  12. namespace Fuel\Tasks;
  13. /**
  14. * Install task
  15. *
  16. * Run this task to set default write permissions and environment stuff
  17. * for your app. This could be expanded in app/tasks for applicaiton specific stuff.
  18. *
  19. * @package Fuel
  20. * @version 1.0
  21. * @author Phil Sturgeon
  22. */
  23. class Install
  24. {
  25. public static function run()
  26. {
  27. $writable_paths = array(APPPATH.'cache', APPPATH.'logs', APPPATH.'tmp', APPPATH.'config');
  28. foreach ($writable_paths as $path)
  29. {
  30. if (@chmod($path, 0777))
  31. {
  32. \Cli::write("\t".'Made writable: '.$path, 'green');
  33. }
  34. else
  35. {
  36. \Cli::write("\t".'Failed to make writable: '.$path, 'red');
  37. }
  38. }
  39. }
  40. }