Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. class Sublime
  4. {
  5.  
  6. /**
  7. * Sublime shell command
  8. */
  9. const COMMAND = 'subl';
  10.  
  11. /**
  12. * Launch sublime and open file
  13. *
  14. * @param string $file
  15. * @return void
  16. */
  17. public static function openFile($file)
  18. {
  19. exec(self::COMMAND .' '. $file);
  20. }
  21.  
  22. /**
  23. * Get Sublime file url (clickable URL from the browser)
  24. *
  25. * @param string $file
  26. * @return string
  27. */
  28. public static function fileUrl($file)
  29. {
  30. return self::COMMAND . '://open?url=file://' . $file;
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement