Kijin Sung
4533dacd4b
Add Storage::getLock() for exclusive access to a named lock
...
여러 프로세스를 동시에 실행할 경우 1개만 작동하도록
lock을 관리하는 기능을 코어 프레임워크에서 제공하도록 한다.
두 개 이상의 프로세스에서 동일한 이름의 lock을 요청할 경우
먼저 요청한 프로세스는 true, 나머지 프로세스들은 false를 받게 된다.
lock을 갖고 있던 프로세스가 종료되면 다시 요청할 수 있다.
예를 들어 크론탭에서 1분마다 실행하는 CLI 스크립트가 있는데
간혹 1분 이상 소요된다면 2개가 동시에 실행될 수도 있다.
이 때 lock을 받지 못한 쪽을 종료하면 동시 실행을 방지할 수 있다.
2018-05-30 21:04:30 +09:00
Kijin Sung
0023a9cc1a
Cache opcache status to reduce function_exists() calls
2017-12-09 01:40:04 +09:00
Kijin Sung
4257edf7fa
Implement saving favicon, mobicon, and default image for domain
2017-03-12 22:55:57 +09:00
Kijin Sung
30cdf63b77
Refactor Storage::recommendUmask() into Storage::getServerUID()
2017-01-26 21:29:01 +09:00
Kijin Sung
5f83192e5d
Remove slashes before trying to delete empty directories
2017-01-26 18:30:09 +09:00
Kijin Sung
3dc736817d
Add Storage::deleteEmptyDirectory() to recursively clear empty directories
2017-01-26 18:01:27 +09:00
Kijin Sung
c71b90b2d6
Fix error when writing an empty file
2016-07-18 21:34:53 +09:00
Kijin Sung
55547c56e4
Do not use safe_overwrite if target directory is not writable
2016-07-11 11:14:00 +09:00
Kijin Sung
63b6ac9e37
Set the default umask automatically upon install
2016-07-03 21:48:09 +09:00
Kijin Sung
f0e6b818af
Add method to recommend the best umask for the current server environment
2016-07-03 21:42:47 +09:00
Kijin Sung
480e27b55d
Apply permissions before moving temp file into place
2016-07-03 21:25:05 +09:00
Kijin Sung
ce878bcaf6
Merge branch 'develop' into pr/umask
2016-07-03 21:21:17 +09:00
Kijin Sung
a15095dd00
Use umask consistently
2016-07-03 20:46:22 +09:00
Kijin Sung
ce594eece7
Throw user warnings when a file operation fails dangerously
2016-07-03 17:30:46 +09:00
Kijin Sung
8f3a9db69a
Call clearstatcache() after write operations
2016-06-23 17:29:32 +09:00
Kijin Sung
30106b7fc4
Use atomic rename to safely overwrite frequently accessed files
2016-06-23 00:00:48 +09:00
Kijin Sung
df22d9e69e
Fix permissions when manually copying an uploaded file
2016-05-08 15:07:17 +09:00
Kijin Sung
568151b5ee
Add comments to cache files
2016-04-17 14:41:18 +09:00
Kijin Sung
36bc83680f
Add streaming options to Storage::read() and Storage::write()
2016-03-20 19:53:50 +09:00
Kijin Sung
4fa3bf8cfb
Add readPHPData() and writePHPData() to Storage class
2016-03-20 19:22:59 +09:00
Kijin Sung
eb1c6e33e6
Improve dotfile handling in Storage::readDirectory() on HHVM
2016-03-20 09:54:10 +09:00
Kijin Sung
f718b5a3e4
Add Storage class and unit tests
2016-03-18 18:11:57 +09:00
Kijin Sung
139e11df13
Also clean relative paths in cleanPath()
2016-03-15 14:14:50 +09:00