-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assessment Files #2
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs changes.
/** | ||
* Opens a new connection to database | ||
*/ | ||
class Database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming file and class same would help.
@@ -0,0 +1,78 @@ | |||
<?php | |||
require_once('./db.php'); | |||
class ImageUploader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check file naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the filename should match the class name. But the task guideline required this specific filename.
@@ -0,0 +1,78 @@ | |||
<?php | |||
require_once('./db.php'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using namespaces and autoloader?
require_once('./db.php'); | ||
class ImageUploader | ||
{ | ||
private $src = './media/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would suggest it to be configurable.
} | ||
$migratedRows = getRows(); | ||
?> | ||
<html lang="en"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest separating view and other work.
{ | ||
$mysqli = $this->db->connect(); | ||
|
||
$result = $mysqli->query("INSERT INTO ".$this->migrate_table." ( sku, name ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sql injection is possible with this look at parameterized query.
{ | ||
echo 'Migration Successful'; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Else can easily be avoided most if the times use ternary operator.
Thanks for your feedback |
No description provided.