mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Add method to recommend the best umask for the current server environment
This commit is contained in:
parent
480e27b55d
commit
f0e6b818af
2 changed files with 75 additions and 0 deletions
|
|
@ -324,4 +324,27 @@ class StorageTest extends \Codeception\TestCase\Test
|
|||
$this->assertTrue(file_exists($sourcedir));
|
||||
$this->assertFalse(Rhymix\Framework\Storage::deleteDirectory($nonexistent));
|
||||
}
|
||||
|
||||
public function testRecommendUmask()
|
||||
{
|
||||
$umask = Rhymix\Framework\Storage::recommendUmask();
|
||||
|
||||
if (strncasecmp(\PHP_OS, 'Win', 3) !== 0)
|
||||
{
|
||||
if (get_current_user() === exec('whoami'))
|
||||
{
|
||||
$this->assertEquals(0022, $umask);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->assertEquals(0, $umask);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->assertEquals(0, $umask);
|
||||
}
|
||||
|
||||
$this->assertFalse(file_exists(\RX_BASEDIR . 'files/cache/uidcheck'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue