8000 Fix emacs link by rubenrua · Pull Request #21731 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix emacs link #21731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2017
Merged

Fix emacs link #21731

merged 1 commit into from
Mar 1, 2017

Conversation

rubenrua
Copy link
Contributor
@rubenrua rubenrua commented Feb 23, 2017
Q A
Branch? 2.7
Bug fix? yes (minor)
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR none

When an Emacs buffer is modified, by default Emacs automatically creates a
temporary symlink in the same directory as the file being edited (e.g. Controller.php):

.#Controller.php -> user@host.12345:1296583136

where '12345' is the Emacs' PID.

In this case Symfony breaks with a RuntimeException:

SplFileInfo::getMTime(): stat failed for ...Bundle/Controller/.#APIController.php

in
vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php
at line 89

$newestMTime = max($file->getMTime(), $newestMTime);

@nicolas-grekas
Copy link
Member

Applies to 2.7, isn't it?

@nicolas-grekas nicolas-grekas added this to the 2.7 milestone Feb 25, 2017
@rubenrua
Copy link
Contributor Author

Yes, new pull request?

@xabbuh
Copy link
Member
xabbuh commented Feb 27, 2017

@rubenrua No need for a new PR. You can rebase your changes onto the 2.7 branch and then changed the target path here.

When an Emacs buffer is modified, by default Emacs automatically creates a
temporary symlink in the same directory as the file being edited (e.g. Controller.php):

```
.#Controller.php -> user@host.12345:1296583136
```

where '12345' is Emacs' PID.

In this case Symfony breaks with a RuntimeException:

```
SplFileInfo::getMTime(): stat failed for ...Bundle/Controller/.#APIController.php
```

in
vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php
at line 89

```
$newestMTime = max($file->getMTime(), $newestMTime);
```
@rubenrua rubenrua changed the base branch from 2.8 to 2.7 February 28, 2017 11:11
@rubenrua
Copy link
Contributor Author

Rebase done

@@ -84,8 +84,15 @@ public function isFresh($timestamp)
continue;
}

// for broken links
try {
$fileMTime = $file->getMTime();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does getMTime() from PHP throws a RuntimeException? If yes, since which version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All PHP versions since 5.3.

symlink('/tmp/target_not_exists', '/tmp/link');
$file = new SplFileInfo('/tmp/link');
var_dump($file->getMTime());

https://3v4l.org/nLNYH

@fabpot
Copy link
Member
fabpot commented Mar 1, 2017

Thank you @rubenrua.

@fabpot fabpot merged commit c6f7ca6 into symfony:2.7 Mar 1, 2017
fabpot added a commit that referenced this pull request Mar 1, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

Fix emacs link

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes (minor)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

When an Emacs buffer is modified, by default Emacs automatically creates a
temporary symlink in the same directory as the file being edited (e.g. Controller.php):

```
.#Controller.php -> user@host.12345:1296583136
```

where '12345' is [the Emacs' PID][1].

In this case Symfony breaks with a RuntimeException:

```
SplFileInfo::getMTime(): stat failed for ...Bundle/Controller/.#APIController.php
```

in
vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php
at line 89

```
$newestMTime = max($file->getMTime(), $newestMTime);
```

[1]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Interlocking.html

Commits
-------

c6f7ca6 Fix RuntimeException when an Emacs buffer is modified
This was referenced Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0