Skip to content

Commit ed04d2d

Browse files
committed
resim kontrolü eklendi.
1 parent 051f298 commit ed04d2d

File tree

3 files changed

+51
-25
lines changed

3 files changed

+51
-25
lines changed

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ tab_width = 4
88
end_of_line = lf
99
charset = utf-8
1010
trim_trailing_whitespace = true
11-
insert_final_newline = true
11+
insert_final_newline = true
12+
13+
[*.json]
14+
indent_size = 2
15+
tab_width = 2

composer.json

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
{
2-
"name": "ifyazilim/dosyayukleme",
3-
"type": "library",
4-
"description": "PHP ile dosya yükleme işlerinde kullanılan kütüphanedir.",
5-
"keywords": ["dosya yükleme", "upload", "file upload"],
6-
"homepage": "http://github.com/ifyazilim/dosyayukleme",
7-
"license": "MIT",
8-
"authors": [
9-
{
10-
"name": "İrfan Evrens",
11-
"email": "irfanevrens@gmail.com",
12-
"homepage": "https://github.com/irfanevrens"
13-
}
14-
],
15-
"require": {
16-
"league/flysystem": "1.0.*",
17-
"php": ">=5.4.0",
18-
"ext-fileinfo": "*",
19-
"pekkis/mime-types": "^1.0"
20-
},
21-
"require-dev": {
22-
"phpunit/phpunit": "3.7.*"
23-
},
24-
"autoload": {
25-
"psr-4": { "IfYazilim\\DosyaYukleme\\": "src" }
2+
"name": "ifyazilim/dosyayukleme",
3+
"type": "library",
4+
"description": "PHP ile dosya yükleme işlerinde kullanılan kütüphanedir.",
5+
"keywords": [
6+
"dosya yükleme",
7+
"upload",
8+
"file upload"
9+
],
10+
"homepage": "http://github.com/ifyazilim/dosyayukleme",
11+
"license": "MIT",
12+
"authors": [
13+
{
14+
"name": "İrfan Evrens",
15+
"email": "irfanevrens@gmail.com",
16+
"homepage": "https://github.com/irfanevrens"
2617
}
18+
],
19+
"require": {
20+
"league/flysystem": "1.0.*",
21+
"php": ">=5.4.0",
22+
"ext-fileinfo": "*",
23+
"pekkis/mime-types": "^1.0"
24+
},
25+
"require-dev": {
26+
"phpunit/phpunit": "3.7.*"
27+
},
28+
"autoload": {
29+
"psr-4": {
30+
"IfYazilim\\DosyaYukleme\\": "src"
31+
}
32+
}
2733
}

src/DosyaBilgisi.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,20 @@ public function getName()
189189
{
190190
return $this->name;
191191
}
192+
193+
/**
194+
* Dosyanın resim mi değil mi karar verir.
195+
*
196+
* @return bool
197+
*/
198+
public function isImage()
199+
{
200+
return in_array($this->mimeType, [
201+
'image/gif',
202+
'image/jpeg',
203+
'image/pjpeg',
204+
'image/png',
205+
'image/x-png'
206+
]);
207+
}
192208
}

0 commit comments

Comments
 (0)