History log of /web-bugs/src/Repository/ObsoletePatchRepository.php (Results 1 – 3 of 3)
Revision Date Author Comments
# b78a0714 26-Dec-2018 Peter Kokot

Refactor repository classes to use vanilla PDOStatement

Current goal is to use as close to PDO expected functionality without
overriding and making custom methods due to easier understan

Refactor repository classes to use vanilla PDOStatement

Current goal is to use as close to PDO expected functionality without
overriding and making custom methods due to easier understanding of
the app itself for people working on the code and contributors.

This patch refactors repository classes to use the expected
\PDOStatement without method chaining.

show more ...


# 14f8c07a 14-Dec-2018 Peter Kokot

Refactor PDO wrapper

Some considerations were raised on the mailing list that this PHP
application doesn't need a PDO wrapper at all.

Changes:
- ::fetchRow() method removed

Refactor PDO wrapper

Some considerations were raised on the mailing list that this PHP
application doesn't need a PDO wrapper at all.

Changes:
- ::fetchRow() method removed in favor of the vanilla PDOStatement::fetch()
- ::fetchAll() override removed in favor of the vanilla
PDOStatement::fetchAll()
- ::fetchCol() removed since it is not used and is only a wrapper for
the PDOStatement::fetchColumn()
- PDO fetch_style synced accross the app. When no fetch style is passed
the default PDO::FETCH_ASSOC is used as set when connecting to db.
- Remove Database::escape() method
The custom ::escape() method is a wrapper around PDO::quote() which
additionally trims leading and trailing quotes from the string. All
this should ideally be done via prepared statements only, except where
we can and need to use PDO::quote() this step can be done on the given
string or variable at hand directly.
- Remove escapeSQL() function
The escapeSQL function is a wrapper around the PDO::quote() and is
using $dbh from the global scope which is not testable nor good practice
further on. Removed and refactored into only PDO::quote() usages on
required places.
- Remove ::fetchOne() method
The fetchOne() method is a simple wrapper around the PDOStatement::fetch()
method with very minor tweaks so the usage can be simplified even more.
The PDOStatement::fetch(\PDO::FETCH_NUM)[0] will always return either a
result from the database column or when row is empty a null.
- Probably this should be refactored to the database tables respected
repositories further on.
- Remove PDO wrapper
The app's current goal is to lean on a vanilla PDO wrapper only.
Current set of features also don't require additional functionality
and extending PDO to a wrapper or create a database abstraction layer
yet.

show more ...


# 8ab9a1d1 05-Dec-2018 Peter Kokot

Refactor patches uploading

This patch moves patches uploading functionality from the outdated
HTTP_Upload package to a dedicated service class in the app.

Additional changes in

Refactor patches uploading

This patch moves patches uploading functionality from the outdated
HTTP_Upload package to a dedicated service class in the app.

Additional changes in this context:
- Functionality concerning retrieving patches data from database has
been moved to a separate repository classes.
- Some missed bugs fixed when uploading patches and no developer info
were recorded.
- Obsoleting patches functionality is now working again.
- Added a simple unit test.

show more ...