Skip to content

Assessment Files#2

Open
gmrsagar wants to merge 1 commit into
mindarc:masterfrom
gmrsagar:Sagar_Ghimire_17/02/2019
Open

Assessment Files#2
gmrsagar wants to merge 1 commit into
mindarc:masterfrom
gmrsagar:Sagar_Ghimire_17/02/2019

Conversation

@gmrsagar
Copy link
Copy Markdown

No description provided.

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

@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.

Comment thread README.md
Comment thread db.php
/**
* Opens a new connection to database
*/
class Database
Copy link
Copy Markdown

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.

Comment thread image-uploader.php
@@ -0,0 +1,78 @@
<?php
require_once('./db.php');
class ImageUploader
Copy link
Copy Markdown

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
Copy Markdown
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.

Comment thread image-uploader.php
@@ -0,0 +1,78 @@
<?php
require_once('./db.php');
Copy link
Copy Markdown

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?

Comment thread image-uploader.php
require_once('./db.php');
class ImageUploader
{
private $src = './media/';
Copy link
Copy Markdown

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.

Comment thread image-uploader.php
}
$migratedRows = getRows();
?>
<html lang="en">
Copy link
Copy Markdown

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.

Comment thread migrate.php
{
$mysqli = $this->db->connect();

$result = $mysqli->query("INSERT INTO ".$this->migrate_table." ( sku, name )
Copy link
Copy Markdown

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.

Comment thread migrate.php
{
echo 'Migration Successful';
}
else
Copy link
Copy Markdown

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