Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Sublime
- {
- /**
- * Sublime shell command
- */
- const COMMAND = 'subl';
- /**
- * Launch sublime and open file
- *
- * @param string $file
- * @return void
- */
- public static function openFile($file)
- {
- exec(self::COMMAND .' '. $file);
- }
- /**
- * Get Sublime file url (clickable URL from the browser)
- *
- * @param string $file
- * @return string
- */
- public static function fileUrl($file)
- {
- return self::COMMAND . '://open?url=file://' . $file;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement