Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Assessment Files #2

wants to merge 1 commit into from

Conversation

gmrsagar
Copy link

No description provided.

@gmrsagar gmrsagar changed the title Final Files Assessment Files Feb 20, 2019
Copy link

@geshan geshan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs changes.

README.md Show resolved Hide resolved
/**
* Opens a new connection to database
*/
class Database
Copy link

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check file naming

Copy link
Author

@gmrsagar gmrsagar Feb 21, 2019

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');
Copy link

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/';
Copy link

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">
Copy link

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 )
Copy link

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
Copy link

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.

@gmrsagar gmrsagar closed this Feb 21, 2019
@gmrsagar gmrsagar deleted the Sagar_Ghimire_17/02/2019 branch February 21, 2019 10:32
@gmrsagar gmrsagar restored the Sagar_Ghimire_17/02/2019 branch February 21, 2019 10:35
@gmrsagar gmrsagar reopened this Feb 21, 2019
@gmrsagar
Copy link
Author

Needs changes.

Thanks for your feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants