28 Commits

Author SHA1 Message Date
Peter Kokot
9d47b05f2d Convert all tabs to spaces 2019-05-22 02:41:51 +02:00
Peter Kokot
5cd2630a86 Add dependency injection container
This patch introduces a dependency injection container for the PHP bug
tracker application. Container deals with the creation of all service
classes and additionally provides retrieving of configuration parameters.
Service classes are used everywhere in the app - from accessing database
to uploading files. Configuration parameters include infrastructure
configuration (database credentials...) and application level
configuration (directories locations...).

Container is compatible with the PSR-11 container interface defined
so it is simple to quickly understand its usage. Advanced features
such as autowiring are not included in this phase.
2019-01-28 00:47:18 +01:00
Peter Kokot
ad8bc2d5ab Move bugdb queries to repository 2018-12-19 02:33:03 +01:00
Peter Kokot
f038854680 Remove unneeded check for database handle presence
This check(s) were once used in previous code for local testings.
2018-12-18 19:55:20 +01:00
Peter Kokot
a5b6fa0704 Refactor get_resolve_reasons() to repository class 2018-12-17 23:25:17 +01:00
Peter Kokot
14f8c07aec 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.
2018-12-17 22:46:55 +01:00
Peter Kokot
9909448411 Remove PEAR errors usage from no-feedback cron job
The error handling has been refactored via
23298a1236.
2018-12-05 11:55:34 +01:00
Peter Kokot
a06f85b0c3 Refactor long array() syntax to short []
Since site is using PHP 5.4+ already, the longer `array()` syntax can be
refactored to shorter `[]`. Also code is already using short array
syntax on some places.
2018-10-24 20:27:59 +02:00
Peter Kokot
8c1bedf1c0 Update http to https
Changes:
- http links updated to https (those that work so far)
- us3.php.net mirror changed to php.net for fetching PHP versions
- some outdated links refreshed
2018-10-23 17:14:42 +02:00
Peter Kokot
21e0f760f1 Change dirname(__FILE__) to shorter __DIR__ 2018-10-23 17:02:10 +02:00
Peter Kokot
180dccfe9d Trim trailing whitespace 2018-10-17 15:41:36 +02:00
Rasmus Lerdorf
23298a1236 New bugs.php.net code 2018-07-17 19:53:03 -04:00
kovacs.ferenc
9612686ee3 make the shebang more portable 2014-12-30 11:16:00 +01:00
Ferenc Kovacs
d7011ab6b4 I've got you! we were overwritting the variable which was used in the while loop already. 2013-02-18 01:33:14 +01:00
Ferenc Kovacs
b8a6d478d3 there are two more bug fields which the mail_bug_updates() function expects/uses 2013-02-18 01:28:23 +01:00
Ferenc Kovacs
99803ca676 make the return value of get_package_mail() more consistent. previously the third item of the returned array could contain either the bcc or the params based on one of the input arguments 2013-02-18 00:05:43 +01:00
Ferenc Kovacs
5bab3e64f0 I'm pretty sure that this was just a copy paste mistake 2013-02-17 21:06:21 +01:00
Hannes Magnusson
9e3082dcb5 There is no such status anymore, its a bug type 2011-08-30 14:17:02 +00:00
Philip Olson
06c372da6c Removed 'No Feedback' as discussed on php-webmaster@ 2010-08-31 02:29:22 +00:00
Philip Olson
47d02257d4 Added all open-ish types of status, as we have assigned bugs with many different open status types. And added status to the email. 2010-08-18 16:54:47 +00:00
Philip Olson
f362334e24 Added bug type (bug or feature request) as requested by johannes 2010-08-09 18:14:26 +00:00
Philip Olson
e84b55dea2 Removed debugging/test code 2010-06-15 21:25:35 +00:00
Derick Rethans
55f3b6a929 - Fixed mail sending script
- INcreased length from 42 to 65.
- Removed the "Testing phase"
2010-06-15 21:03:54 +00:00
Philip Olson
0ec812f0a3 Added script that emails people with assigned bugs. In 'test' mode currently. Will be added to weekly cron. 2010-06-01 17:05:18 +00:00
Daniel Egeberg
10ed048f98 Forgot to update some calls to get_package_mail(). 2010-04-18 12:54:47 +00:00
Jani Taskinen
58ee71e287 - Added function for adding comments 2010-03-09 16:40:59 +00:00
Jani Taskinen
e27f26a020 - Get rid of hard-coded message here as well 2010-03-03 18:19:56 +00:00
Jani Taskinen
401bfec3f5 - Added missing "no-feedback cron job 2010-03-03 17:44:18 +00:00