-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
65 lines (59 loc) · 1.78 KB
/
Copy pathindex.php
File metadata and controls
65 lines (59 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* Project: GetOwnGithubRepositories
* Author: Gurcan
* Date: 12.06.2018
* Time: 22:13
* File: index.oho.php
*/
use IGA\Controller\Github;
use IGA\Dotenv\Dotenv;
function autoload($className)
{
$dir = __DIR__.'/src/';
$classPath = $dir.$className.'.php';
include($classPath);
}
spl_autoload_register('autoload');
if (!isset($_SERVER['APP_ENV'])) {
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('.env dosyası bulunamadı.');
}
(new Dotenv(__DIR__))->load();
}
$github = new Github();
$repositoryList = $github->getRepositoryList();
?>
<!doctype html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Repository List</title>
</head>
<body>
<h1>Repository List</h1>
<table cellpadding="5" cellspacing="0" border="1" width="100%" style="border: 1px solid #ddd">
<thead>
<tr>
<th align="left" width="8%">ID</th>
<th align="left">Name</th>
<th align="left" width="8%">Language</th>
<th align="left" width="8%">Star</th>
</tr>
</thead>
<tbody>
<?php foreach ($repositoryList as $index => $repository) { ?>
<tr>
<td><?php echo $repository->id; ?></td>
<td><a href="<?php echo $repository->html_url; ?>" target="_blank"><?php echo $repository->name; ?></a></td>
<td><?php echo $repository->language; ?></td>
<td><?php echo $repository->stargazers_count; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</body>
</html>