Applied fixes from StyleCI

This commit is contained in:
Sujit Prasad
2016-02-19 02:20:12 -05:00
committed by StyleCI Bot
parent be5df5334f
commit d637c2b23f
439 changed files with 19063 additions and 19210 deletions

View File

@@ -5,4 +5,3 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

View File

@@ -1,24 +1,24 @@
<?php
//Check if we are getting the image
if (isset($_FILES['image'])) {
//Get the image array of details
$img = $_FILES['image'];
//The new path of the uploaded image, rand is just used for the sake of it
$path = "upload/" . rand() . $img["name"];
//Move the file to our new path
move_uploaded_file($img['tmp_name'], $path);
//Get image info, reuiqred to biuld the JSON object
$data = getimagesize($path);
//The direct link to the uploaded image, this might varyu depending on your script location
$link = "http://$_SERVER[HTTP_HOST]" . "/codex/" . $path;
//Here we are constructing the JSON Object
$res = array("upload" => array(
"links" => array("original" => $link),
"image" => array("width" => $data[0],
"height" => $data[1],
),
));
//echo out the response :)
echo json_encode($res);
//Get the image array of details
$img = $_FILES['image'];
//The new path of the uploaded image, rand is just used for the sake of it
$path = 'upload/'.rand().$img['name'];
//Move the file to our new path
move_uploaded_file($img['tmp_name'], $path);
//Get image info, reuiqred to biuld the JSON object
$data = getimagesize($path);
//The direct link to the uploaded image, this might varyu depending on your script location
$link = "http://$_SERVER[HTTP_HOST]".'/codex/'.$path;
//Here we are constructing the JSON Object
$res = ['upload' => [
'links' => ['original' => $link],
'image' => ['width' => $data[0],
'height' => $data[1],
],
]];
//echo out the response :)
echo json_encode($res);
}
?>

View File

@@ -1,24 +1,24 @@
<?php
//Check if we are getting the image
if (isset($_FILES['image'])) {
//Get the image array of details
$img = $_FILES['image'];
//The new path of the uploaded image, rand is just used for the sake of it
$path = "upload/" . rand() . $img["name"];
//Move the file to our new path
move_uploaded_file($img['tmp_name'], $path);
//Get image info, reuiqred to biuld the JSON object
$data = getimagesize($path);
//The direct link to the uploaded image, this might varyu depending on your script location
$link = "http://$_SERVER[HTTP_HOST]" . "/codex/" . $path;
//Here we are constructing the JSON Object
$res = array("upload" => array(
"links" => array("original" => $link),
"image" => array("width" => $data[0],
"height" => $data[1],
),
));
//echo out the response :)
echo json_encode($res);
//Get the image array of details
$img = $_FILES['image'];
//The new path of the uploaded image, rand is just used for the sake of it
$path = 'upload/'.rand().$img['name'];
//Move the file to our new path
move_uploaded_file($img['tmp_name'], $path);
//Get image info, reuiqred to biuld the JSON object
$data = getimagesize($path);
//The direct link to the uploaded image, this might varyu depending on your script location
$link = "http://$_SERVER[HTTP_HOST]".'/codex/'.$path;
//Here we are constructing the JSON Object
$res = ['upload' => [
'links' => ['original' => $link],
'image' => ['width' => $data[0],
'height' => $data[1],
],
]];
//echo out the response :)
echo json_encode($res);
}
?>