[PHP-WEBMASTER] [web-php] master: Update minimum versions of development tools (#983)

2024-06-01 Thread Peter Kokot via GitHub
Author: Peter Kokot (petk)
Committer: GitHub (web-flow)
Pusher: saundefined
Date: 2024-06-01T15:29:23+03:00

Commit: 
https://github.com/php/web-php/commit/65f0835179342cd0fce11d6625206efc8734a333
Raw diff: 
https://github.com/php/web-php/commit/65f0835179342cd0fce11d6625206efc8734a333.diff

Update minimum versions of development tools (#983)

Changed paths:
  M  git.php


Diff:

diff --git a/git.php b/git.php
index 71deee808f..429974fce7 100644
--- a/git.php
+++ b/git.php
@@ -43,21 +43,24 @@
 
 
 
- autoconf:
+ autoconf:
   
-   PHP 5.4 - 7.1: 2.59+
+   PHP 7.3 and later: 2.68+
PHP 7.2: 2.64+
-   PHP 7.3: 2.68+
+   PHP 7.1 and earlier: 2.59+
+  
+ 
+ libtool: 1.4.x+ (except 1.4.2)
+ re2c:
+  
+PHP 8.3 and later: 1.0.3+
+PHP 8.2 and earlier: 0.13.4+
   
  
- libtool: 1.4.x+ (except 1.4.2)
- re2c: 0.13.4+
  bison:
   
-   PHP 5.4: 1.28, 1.35, 1.75, 2.0 to 2.6.4
-   PHP 5.5 and 5.6: 2.4 to 2.7
-   PHP 7.0 - 7.3: 2.4+
-   PHP 7.4 - PHP 8.0: 3.0.0+
+   PHP 7.4 and later: 3.0.0+
+   PHP 7.3 and earlier: 2.4+
   
  
 


[PHP-WEBMASTER] [web-php] master: Add URL to Debian security tracker (#982)

2024-04-24 Thread Peter Kokot via GitHub
Author: Peter Kokot (petk)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2024-04-24T21:39:29+01:00

Commit: 
https://github.com/php/web-php/commit/f9e5c80955f64930b19bf48fb46ece909a903824
Raw diff: 
https://github.com/php/web-php/commit/f9e5c80955f64930b19bf48fb46ece909a903824.diff

Add URL to Debian security tracker (#982)

Changed paths:
  M  archive/entries/2024-04-24-1.xml


Diff:

diff --git a/archive/entries/2024-04-24-1.xml b/archive/entries/2024-04-24-1.xml
index 1bdbe9e429..62f4fed063 100644
--- a/archive/entries/2024-04-24-1.xml
+++ b/archive/entries/2024-04-24-1.xml
@@ -34,10 +34,10 @@
 Additionally it is also good practice for applications to accept 
only
 specific charsets, with an allow-list.
  
-Some Linux distributions such as Debian, CentOS, and others, already have
-published patched variants of glibc. Please upgrade as soon as
-possible.
+Some Linux distributions such as https://security-tracker.debian.org/tracker/CVE-2024-2961";>Debian,
+CentOS, and others, already have published patched variants of glibc.
+Please upgrade as soon as possible.
  
 Once an update is available in glibc, updating that package on your
 Linux machine will be enough to alleviate the issue. You do not need to


[PHP-WEBMASTER] com web/php: Bump required bison version for PHP-7.4: git.php

2019-06-25 Thread Peter Kokot
Commit:bfebb27b9a8d5ebe609ab3cf60a823d6a4640cc9
Author:Peter Kokot  Tue, 25 Jun 2019 17:21:48 
+0200
Parents:   cc04846a36327bb402975575bed91b18cef395e5
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=bfebb27b9a8d5ebe609ab3cf60a823d6a4640cc9

Log:
Bump required bison version for PHP-7.4

Since PHP 7.4, parser and lexer files are no longer bundled with the
Git repository PHP code. And the Bison 3.0.0 or later is needed to
generate parser files.

Changed paths:
  M  git.php


Diff:
diff --git a/git.php b/git.php
index 80dbb6f..aa38aea 100644
--- a/git.php
+++ b/git.php
@@ -56,7 +56,8 @@ site_header("Git Access", array("current" => "community"));
   
PHP 5.4: 1.28, 1.35, 1.75, 2.0 to 2.6.4
PHP 5.5 and 5.6: 2.4 to 2.7
-   PHP 7: 2.4+
+   PHP 7.0 - 7.3: 2.4+
+   PHP 7.4: 3.0.0+
   
  
 


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Fix HTML for PHP 7.4 GPG keys: include/gpg-keys.inc

2019-05-29 Thread Peter Kokot
Commit:f6da7c4f621bb700603dafeae01677048d832991
Author:Peter Kokot  Wed, 29 May 2019 23:06:08 
+0200
Parents:   106eece540e379ca064b7af7ff07f6cac1f65133
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=f6da7c4f621bb700603dafeae01677048d832991

Log:
Fix HTML for PHP 7.4 GPG keys

Changed paths:
  M  include/gpg-keys.inc


Diff:
diff --git a/include/gpg-keys.inc b/include/gpg-keys.inc
index f01b1e3..2594d6e 100644
--- a/include/gpg-keys.inc
+++ b/include/gpg-keys.inc
@@ -8,13 +8,13 @@ uid  Kalle Sommer Nielsen (PHP) 
<ka...@php.net>
 "7.4" => <<< GPG
 pub   rsa3072 2019-03-25 [SC] [expires: 2021-03-24]
   A78F 717F 0793 F15F 6285  3392 3A6F 9E81 27D3 0399
-uid   [ultimate] Derick Rethans (Personal Key) 

-uid   [ultimate] Derick Rethans 
+uid   [ultimate] Derick Rethans (Personal Key) 
<der...@derickrethans.nl>
+uid   [ultimate] Derick Rethans <der...@php.net>
 sub   rsa3072 2019-03-25 [E] [expires: 2021-03-24]
 
 pub   rsa4096 2019-05-29 [SC] [expires: 2021-05-28]
   4267 0A7F E4D0 441C 8E46  3234 9E4F DC07 4A4E F02D
-uid   [ultimate] Peter Kokot 
+uid   [ultimate] Peter Kokot <p...@php.net>
 sub   rsa4096 2019-05-29 [E] [expires: 2021-05-28]
 GPG
 ,


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Add p...@php.net PHP 7.4 GPG key fingerprint: include/gpg-keys.inc

2019-05-29 Thread Peter Kokot
Commit:106eece540e379ca064b7af7ff07f6cac1f65133
Author:Peter Kokot  Wed, 29 May 2019 22:54:03 
+0200
Parents:   1d8133d329e5b87c941adec69b905de363131c22
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=106eece540e379ca064b7af7ff07f6cac1f65133

Log:
Add p...@php.net PHP 7.4 GPG key fingerprint

Changed paths:
  M  include/gpg-keys.inc


Diff:
diff --git a/include/gpg-keys.inc b/include/gpg-keys.inc
index 1e07cc7..f01b1e3 100644
--- a/include/gpg-keys.inc
+++ b/include/gpg-keys.inc
@@ -11,6 +11,11 @@ pub   rsa3072 2019-03-25 [SC] [expires: 2021-03-24]
 uid   [ultimate] Derick Rethans (Personal Key) 

 uid   [ultimate] Derick Rethans 
 sub   rsa3072 2019-03-25 [E] [expires: 2021-03-24]
+
+pub   rsa4096 2019-05-29 [SC] [expires: 2021-05-28]
+  4267 0A7F E4D0 441C 8E46  3234 9E4F DC07 4A4E F02D
+uid   [ultimate] Peter Kokot 
+sub   rsa4096 2019-05-29 [E] [expires: 2021-05-28]
 GPG
 ,
 "7.3" => <<< GPG


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Revert "Add automatic fixtures generator importer": .gitignore README.md composer.json composer.lock config/container.php config/parameters.php scripts/console sql/fixtur

2019-05-25 Thread Peter Kokot
Commit:fd1338e3de54fd96b6cdaeb08508b4a5ba84f67a
Author:Peter Kokot  Sat, 25 May 2019 12:16:43 
+0200
Parents:   95cdd55d51122c8ba26f6a9db7decfc1682a40cd
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=fd1338e3de54fd96b6cdaeb08508b4a5ba84f67a

Log:
Revert "Add automatic fixtures generator importer"

This reverts commit 5cdac95adc49562291a873c8704de3ceb0d9d398.

Due to the https://github.com/php/web-bugs/pull/77 discussion and
request from a prominent member of the PHP group - Kalle - I'm reverting
this awesome addition because it caused too many conflicts and issues.
So it is not worth of investing more from my side into this neither
having a ruined experience further on from any side here.

This fix has been really helpful with some development ways but people
who maintain this app further better have peace of mind...

Changed paths:
  M  .gitignore
  M  README.md
  M  composer.json
  M  composer.lock
  M  config/container.php
  M  config/parameters.php
  D  scripts/console
  A  sql/fixtures.sql
  D  src/Command/InsertFixturesCommand.php
  D  src/Fixtures/AppFixtures.php
  D  tests/Unit/Command/InsertFixturesCommandTest.php

diff --git a/.gitignore b/.gitignore
index fe3c3eb..8d0441e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,7 @@
 
 # Local specific PHPUnit configuration
 /phpunit.xml
-/.phpunit.result.cache
+.phpunit.result.cache
 
 # Transient and temporary generated files
 /var/
diff --git a/README.md b/README.md
index af5cc30..1adab68 100644
--- a/README.md
+++ b/README.md
@@ -17,13 +17,8 @@ Modify `local_config.php` according to your local 
development environment.
 
 * Database:
 
-Create a new MySQL, MariaDB, Percona Server, or equivalent database using
-`sql/database.sql`, create database schema `sql/schema.sql` and insert demo 
data
-fixtures by running:
-
-```bash
-php scripts/console app:fixtures:insert
-```
+Create a new MySQL/MariaDB database using `sql/database.sql`, create database
+schema `sql/schema.sql` and insert fixtures using `sql/fixtures.sql`.
 
 ## Tests
 
@@ -47,10 +42,9 @@ Source code of this application is structured in the 
following directories:
 ├─ prepend.php  # Autoloader, DB connection, container, app 
initialization
 └─ ...
  └─ scripts/# Command line development tools and scripts
-├─ console  # Application's main script for running CLI 
commands
 ├─ cron/# Various systems scripts to run periodically on 
the server
 └─ ...
- ├─ sql/# Database schema
+ ├─ sql/# Database schema and fixtures
  └─ src/# Application source code classes
 ├─ Horde/   # https://www.horde.org/libraries/Horde_Text_Diff
 └─ ...
diff --git a/composer.json b/composer.json
index 4d02265..abec91d 100644
--- a/composer.json
+++ b/composer.json
@@ -32,9 +32,7 @@
 },
 "require-dev": {
 "ext-pdo_sqlite": "*",
-"fzaninotto/faker": "^1.8",
-"phpunit/phpunit": "^8.1.5",
-"symfony/console": "^4.2"
+"phpunit/phpunit": "^8.1.5"
 },
 "autoload": {
 "psr-4": {
diff --git a/composer.lock b/composer.lock
index 898739c..8111618 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies";,
 "This file is @generated automatically"
 ],
-"content-hash": "e90209efe832cd89e50a5f742fd551a8",
+"content-hash": "994d11b989a10210dc468c7046539905",
 "packages": [],
 "packages-dev": [
 {
@@ -64,56 +64,6 @@
 "time": "2019-03-17T17:37:11+00:00"
 },
 {
-"name": "fzaninotto/faker",
-"version": "v1.8.0",
-"source": {
-"type": "git",
-"url": "https://github.com/fzaninotto/Faker.git";,
-"reference": "f72816b43e74063c8b10357394b6bba8cb1c10de"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de";,
-"reference": "f72816b43e74063c8b10357394b6bba8cb1c10de",
-"shasum": ""
-},
-"require": {
-"php": "^5.3.3 || ^7.0"
-},
-"require-dev": {
-"ext-intl": "*",
-  

[PHP-WEBMASTER] Re: bugs.php.net update 2019-05

2019-05-23 Thread Peter Kokot
Hello,

On Wed, 22 May 2019 at 22:52, Peter Kokot  wrote:
>
> Hello webmasters,
>
> I was requested to write email here (apologies for missing that sooner
> but my last email didn't get responses because the constant
> discussions are probably too time consuming for everyone in their busy
> lives so no problem basically, I understand).
>
> There are few adjustments taking place on the PHP bugs tracker -
> application level at the moment.
>
> Two main things are currently being worked on:
> 1.) Bugs categories (a.k.a. packages)
> https://bugs.php.net/bug.php?id=78036
> (how good that can be done depends on many things but plan is to move
> the categories to static configuration-alike layer instead of the
> database directly). So, yes we will finally be able to add some new
> bug category, or update current ones.
>
> 2.) Splitting front controllers to the templates:
> We have already discussed this thoroughly and integrated a template
> engine in the bugs.php.net and now it's time to split all the www/*
> front controllers gradually to the template layer and the "controller"
> alike code in the files.
>
> I've also already integrated a data fixtures importer functionality.
> So that on localhost installation we have some demo data to work with
> and test how the app behaves. Anyone working today with web apps need
> to have also some data already in the app so the local installation
> behaves as much similar to the production as possible. Kalle alerted
> me, that I've missed the discussion about it here, so now that's
> already done and others don't need to invest that more... If it turns
> out that we don't need to have demo data on localhost for development,
> we'll refactor this more later on.
>
> For this reason I also use Docker extensively - if someone will want
> to use it and install it locally:
> https://github.com/petk/bugs.php.net
>
> Next steps depend here on multiple things.
>
> My suggestion here is very basic actually for now:
> - make code more OOP-alike (mainly the functions usage migrated to classes)
> - add more tests
> - and finally getting to fix the current opened bugs (there are quite
> many and some are not very trivial without some changes in the code -
> like moving things around, renaming some files etc).
>
> In case you're interested in the project progress and plan to also
> code on it directly, please start following GitHub and pull requests
> (anyone's suggestion and contribution is as always welcome):
> https://github.com/php/web-bugs
>
> To not disorient the progress too much as far as the first two points
> are concerned, I'll get forward with those two.
>
> Thanks and have a nice day forward.
>
> --
> Peter Kokot

Also a quick response here: I'm leaving these web/* PHP projects. Some
have been fixed a bit, most have failed because next steps involve too
many things such as accesses and similar which I think PHP internals
are not ready for it yet nor actually willing to do. I really
appreciate all the effort from some people's side here, you were all
doing the best you can, but I think that I'm in a way a bit here with
some of the suggestions according to the response(s) I've received
here. Well, maybe someone will make it. Doing a change over a
discussions that take place over a period of months to half a year is
not acceptable for me. Or discussing the PSR-4 autoloading, or
Composer, or something from PEAR's museum arsenal... My evaluation of
this bugs.php.net project is that it's time for the internals people
to sit down, close the mailing list commits (one of the most
problematic thing is that people who don't code on this app or have
done a semicolon fix give opinions on how the app should be coded) and
fix it. Because this is not a usable tracker of bugs for php and
belonging extensions. Neither is an open source project as it should
be. Not yet...

To not make our experiences any worse, the initial plan is now reset
and left to the next person working on it or who ever picks this up -
Pieter I assume.

--
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Remove unused functions: include/functions.php

2019-05-22 Thread Peter Kokot
Commit:95cdd55d51122c8ba26f6a9db7decfc1682a40cd
Author:Peter Kokot  Thu, 23 May 2019 03:00:42 
+0200
Parents:   9531cd154db3a5e41b6e806226e9e371d2699f52
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=95cdd55d51122c8ba26f6a9db7decfc1682a40cd

Log:
Remove unused functions

- admin_table_static
- admin_table_dynamic
- inline_content_menu

Changed paths:
  M  include/functions.php


Diff:
diff --git a/include/functions.php b/include/functions.php
index fd3bbd7..a4e3a0c 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1677,117 +1677,3 @@ function bugs_get_hash($passwd)
 {
 return hash_hmac('sha256', $passwd, getenv('USER_PWD_SALT'));
 }
-
-
-/**
- * Inline content menu
- *
- * . The base_url is a prefix for the location, currently does not support 
_SERVER['QUERY_STRING']
- * . The current_action is used to indicate which page is currently being 
displayed
- * . Menu items are in (action_name => Title) array pairs
- */
-function inline_content_menu($base_url, $current_action, array $menu)
-{
-if (!$menu) {
-return;
-}
-
-$buffer = '';
-
-foreach ($menu as $action => $title) {
-if ($current_action === $action) {
-$buffer .= sprintf('%s | ', $title);
-} else {
-$buffer .= sprintf('%s | ', $base_url, 
$action, $title);
-}
-}
-
-echo "";
-echo rtrim($buffer, ' | ');
-echo "\n";
-}
-
-function admin_table_static(array $header, array $rows)
-{
-if (!$header || !$rows || sizeof($header) != sizeof($rows[0])) {
-return;
-}
-
-echo "\n";
-echo "\n";
-
-foreach ($header as $name) {
-echo "$name\n";
-}
-
-echo "\n";
-
-
-foreach ($rows as $row) {
-$i = 0;
-
-echo "\n";
-
-foreach ($row as $value) {
-echo "$value\n";
-
-++$i;
-}
-
-echo "\n";
-}
-
-echo "\n";
-}
-
-function admin_table_dynamic(array $rows)
-{
-if (!$rows) {
-return;
-}
-
-$printed_header = false;
-
-echo "\n";
-
-foreach ($rows as $row) {
-if (!$printed_header) {
-echo "\n";
-
-foreach (array_keys($row) as $column) {
-echo "$column\n";
-}
-
-echo "\n";
-
-$printed_header = true;
-}
-
-$i = 0;
-
-echo "\n";
-
-foreach ($row as $column => $value) {
-echo "$value\n";
-
-++$i;
-}
-
-echo "\n";
-}
-}
-
-function mailto_list(array $mails)
-{
-if(!$mails) {
-return;
-}
-
-$buffer = '';
-
-foreach ($mails as $mail) {
-$buffer .= sprintf('mailto:%1$s";>%1$s, ', $mail);
-}
-
-echo rtrim($buffer, ', ');
-}


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Converted the current admin pages (/admin) to use proper templates and repositories: config/container.php src/Repository/DatabaseStatusRepository.php src/Repository/PhpIn

2019-05-22 Thread Peter Kokot
Commit:9531cd154db3a5e41b6e806226e9e371d2699f52
Author:Pieter Hordijk  Wed, 22 May 2019 
21:06:46 +0300
Committer: Peter Kokot   Thu, 23 May 2019 02:46:24 
+0200
Parents:   e8bab3538a9d05d0da584c2ff8b18c7d9eea2fdd
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=9531cd154db3a5e41b6e806226e9e371d2699f52

Log:
Converted the current admin pages (/admin) to use proper templates and 
repositories

Changed paths:
  M  config/container.php
  A  src/Repository/DatabaseStatusRepository.php
  A  src/Repository/PhpInfoRepository.php
  M  src/Repository/ReasonRepository.php
  A  templates/pages/admin/database_status.php
  A  templates/pages/admin/mailing_lists.php
  A  templates/pages/admin/menu.php
  A  templates/pages/admin/phpinfo.php
  A  templates/pages/admin/quick_responses.php
  M  www/admin/index.php
  M  www/css/style.css

diff --git a/config/container.php b/config/container.php
index 59e3045..d869f44 100644
--- a/config/container.php
+++ b/config/container.php
@@ -33,6 +33,10 @@ $container->set(App\Repository\CommentRepository::class, 
function ($c) {
 return new App\Repository\CommentRepository($c->get(\PDO::class));
 });
 
+$container->set(App\Repository\DatabaseStatusRepository::class, function ($c) {
+return new App\Repository\DatabaseStatusRepository($c->get(\PDO::class));
+});
+
 $container->set(App\Repository\ObsoletePatchRepository::class, function ($c) {
 return new App\Repository\ObsoletePatchRepository($c->get(\PDO::class));
 });
@@ -45,6 +49,10 @@ $container->set(App\Repository\PatchRepository::class, 
function ($c) {
 return new App\Repository\PatchRepository($c->get(\PDO::class), 
$c->get('uploads_dir'));
 });
 
+$container->set(App\Repository\PhpInfoRepository::class, function ($c) {
+return new App\Repository\PhpInfoRepository();
+});
+
 $container->set(App\Repository\PullRequestRepository::class, function ($c) {
 return new App\Repository\PullRequestRepository($c->get(\PDO::class));
 });
diff --git a/src/Repository/DatabaseStatusRepository.php 
b/src/Repository/DatabaseStatusRepository.php
new file mode 100644
index 000..971ba42
--- /dev/null
+++ b/src/Repository/DatabaseStatusRepository.php
@@ -0,0 +1,60 @@
+dbh = $dbh;
+}
+
+public function getMysqlVersion(): string
+{
+return $this->dbh->query('SELECT version() 
mysql_version')->fetchColumn(0);
+}
+
+/**
+ * @return string[]
+ */
+public function findAllTables(): array
+{
+return $this->dbh->query('SHOW TABLES')->fetchAll(\PDO::FETCH_COLUMN);
+}
+
+/**
+ * @return array
+ */
+public function getNumberOfRowsInTables(): array
+{
+$numberOfRowsPerTable = [];
+
+foreach ($this->findAllTables() as $tableName) {
+$sql = sprintf('SELECT COUNT(*) FROM `%s`', $tableName);
+
+$numberOfRowsPerTable[$tableName] = 
$this->dbh->query($sql)->fetchColumn(0);
+}
+
+return $numberOfRowsPerTable;
+}
+
+/**
+ * @return array>
+ */
+public function getStatusOfTables(): array
+{
+return $this->dbh->query('SHOW TABLE STATUS')->fetchAll();
+}
+}
diff --git a/src/Repository/PhpInfoRepository.php 
b/src/Repository/PhpInfoRepository.php
new file mode 100644
index 000..6542357
--- /dev/null
+++ b/src/Repository/PhpInfoRepository.php
@@ -0,0 +1,46 @@
+replaceSensitiveInformation(ob_get_clean());
+$phpInfo = $this->cleanHtml($phpInfo);
+
+return $phpInfo;
+}
+
+private function replaceSensitiveInformation(string $phpInfo): string
+{
+return str_replace([
+getenv('AUTH_TOKEN'),
+getenv('USER_TOKEN'),
+getenv('USER_PWD_SALT'),
+], '<hidden>', $phpInfo);
+}
+
+/**
+ * This method unwrap the information from the body tag, removes zend and 
php logos and fixes sizes
+ * for presentation purposes
+ *
+ * We might want to do it proper at some point using DOM methods
+ */
+private function cleanHtml(string $phpInfo): string
+{
+preg_match('!(.*)!ims', $phpInfo, $m);
+
+$m[1] = preg_replace('!http://www.php.net/";>!ims', '', $m[1]);
+$m[1] = preg_replace('!http://www.zend.com/";>!ims', '', $m[1]);
+$m[1] = str_replace(' width="600"', ' width="80%"', $m[1]);
+
+return $m[1];
+}
+}
diff --git a/src/Repository/ReasonRepository.php 
b/src/Repository/ReasonRepository.php
index fd4f411..b33d60a 100644
--- a/src/Repository/ReasonRepository.php
+++ b/src/Repository/ReasonRepository.php
@@ -52,4 +52,14 @@ class ReasonRepository
 
 return [$resolves, $variations];
 }
+
+/**
+ * @r

[PHP-WEBMASTER] com web/bugs: Add variables import to included templates: docs/templates.md src/Template/Context.php tests/Unit/Template/ContextTest.php tests/fixtures/templates/forms/form_2.php tests

2019-05-22 Thread Peter Kokot
Commit:e8bab3538a9d05d0da584c2ff8b18c7d9eea2fdd
Author:Peter Kokot  Thu, 23 May 2019 02:10:03 
+0200
Parents:   fe351f79ddc962b22235f00e66a13d8b4f4034f5
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=e8bab3538a9d05d0da584c2ff8b18c7d9eea2fdd

Log:
Add variables import to included templates

Changed paths:
  M  docs/templates.md
  M  src/Template/Context.php
  M  tests/Unit/Template/ContextTest.php
  A  tests/fixtures/templates/forms/form_2.php
  M  tests/fixtures/templates/pages/including.php


Diff:
diff --git a/docs/templates.md b/docs/templates.md
index cea0976..0623d91 100644
--- a/docs/templates.md
+++ b/docs/templates.md
@@ -73,8 +73,13 @@ To include a partial template snippet file:
 include('forms/report_bug.php') ?>
 ```
 
-which is equivalent to ``.
-The variable scope is inherited by the template that included the file.
+which is equivalent to ``,
+except that the variable scope is not inherited by the template that included
+the file. To import variables into the included template snippet file:
+
+```php
+include('forms/contact.php', ['formHeading' => 'value', 'foo' => 
'bar']) ?>
+```
 
 ## Blocks
 
diff --git a/src/Template/Context.php b/src/Template/Context.php
index eaf9403..98994f4 100644
--- a/src/Template/Context.php
+++ b/src/Template/Context.php
@@ -141,8 +141,14 @@ class Context
  *
  * @return mixed
  */
-public function include(string $template)
+public function include(string $template, array $variables = [])
 {
+if (count($variables) > extract($variables, EXTR_SKIP)) {
+throw new \Exception(
+'Variables with numeric names $0, $1... cannot be imported to 
scope '.$template
+);
+}
+
 return include $this->dir.'/'.$template;
 }
 
diff --git a/tests/Unit/Template/ContextTest.php 
b/tests/Unit/Template/ContextTest.php
index 8b82de7..c4d2252 100644
--- a/tests/Unit/Template/ContextTest.php
+++ b/tests/Unit/Template/ContextTest.php
@@ -52,6 +52,14 @@ class ContextTest extends TestCase
 $this->assertEquals(include TEST_FIXTURES_DIRECTORY . 
'/templates/includes/variable.php', $variable);
 }
 
+public function testIncludeOnInvalidVariableCounts(): void
+{
+$this->expectException(\Exception::class);
+$this->expectExceptionMessage('Variables with numeric names $0, $1... 
cannot be imported to scope includes/variable.php');
+
+$this->context->include('includes/variable.php', ['var1', 'var2', 
'var3']);
+}
+
 /**
  * @dataProvider attacksProvider
  */
diff --git a/tests/fixtures/templates/forms/form_2.php 
b/tests/fixtures/templates/forms/form_2.php
new file mode 100644
index 000..ba4a660
--- /dev/null
+++ b/tests/fixtures/templates/forms/form_2.php
@@ -0,0 +1,10 @@
+append('scripts'); ?>
+
+end('scripts'); ?>
+
+e($importedVariable) ?>
+
+
+
+
+
diff --git a/tests/fixtures/templates/pages/including.php 
b/tests/fixtures/templates/pages/including.php
index 746b59a..fd157bd 100644
--- a/tests/fixtures/templates/pages/including.php
+++ b/tests/fixtures/templates/pages/including.php
@@ -1,5 +1,6 @@
 extends('layout.php', ['title' => 'Testing blocks appends']) ?>
 
 start('content') ?>
-include('forms/form.php') ?>
+
+include('forms/form_2.php', ['importedVariable' => 
$someVariable]) ?>
 end('content') ?>


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] bugs.php.net update 2019-05

2019-05-22 Thread Peter Kokot
Hello webmasters,

I was requested to write email here (apologies for missing that sooner
but my last email didn't get responses because the constant
discussions are probably too time consuming for everyone in their busy
lives so no problem basically, I understand).

There are few adjustments taking place on the PHP bugs tracker -
application level at the moment.

Two main things are currently being worked on:
1.) Bugs categories (a.k.a. packages)
https://bugs.php.net/bug.php?id=78036
(how good that can be done depends on many things but plan is to move
the categories to static configuration-alike layer instead of the
database directly). So, yes we will finally be able to add some new
bug category, or update current ones.

2.) Splitting front controllers to the templates:
We have already discussed this thoroughly and integrated a template
engine in the bugs.php.net and now it's time to split all the www/*
front controllers gradually to the template layer and the "controller"
alike code in the files.

I've also already integrated a data fixtures importer functionality.
So that on localhost installation we have some demo data to work with
and test how the app behaves. Anyone working today with web apps need
to have also some data already in the app so the local installation
behaves as much similar to the production as possible. Kalle alerted
me, that I've missed the discussion about it here, so now that's
already done and others don't need to invest that more... If it turns
out that we don't need to have demo data on localhost for development,
we'll refactor this more later on.

For this reason I also use Docker extensively - if someone will want
to use it and install it locally:
https://github.com/petk/bugs.php.net

Next steps depend here on multiple things.

My suggestion here is very basic actually for now:
- make code more OOP-alike (mainly the functions usage migrated to classes)
- add more tests
- and finally getting to fix the current opened bugs (there are quite
many and some are not very trivial without some changes in the code -
like moving things around, renaming some files etc).

In case you're interested in the project progress and plan to also
code on it directly, please start following GitHub and pull requests
(anyone's suggestion and contribution is as always welcome):
https://github.com/php/web-bugs

To not disorient the progress too much as far as the first two points
are concerned, I'll get forward with those two.

Thanks and have a nice day forward.

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Move quick fix reasons list to template: templates/pages/quick_fix_desc.php www/quick-fix-desc.php

2019-05-22 Thread Peter Kokot
Commit:fe351f79ddc962b22235f00e66a13d8b4f4034f5
Author:Peter Kokot  Wed, 22 May 2019 20:12:38 
+0200
Parents:   03e280e9bcc6fb964e6c7b8fc9e54ab93d6b14f4
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=fe351f79ddc962b22235f00e66a13d8b4f4034f5

Log:
Move quick fix reasons list to template

Changed paths:
  A  templates/pages/quick_fix_desc.php
  M  www/quick-fix-desc.php


Diff:
diff --git a/templates/pages/quick_fix_desc.php 
b/templates/pages/quick_fix_desc.php
new file mode 100644
index 000..608cb8b
--- /dev/null
+++ b/templates/pages/quick_fix_desc.php
@@ -0,0 +1,29 @@
+extends('layout.php', ['title' => 'Quick fix descriptions']) ?>
+
+start('content') ?>
+
+
+ $reason): ?>
+
+
+
+
+
+e($reason['title']) ?>
+Status: e($reason['status']) ?>
+e($reason['message']) ?>
+
+
+
+ $variation): ?>
+
+e($reason['title']) ?> (e($type) 
?>)
+Status: e($reason['status']) ?>
+e($variation) ?>
+
+
+
+
+
+
+end('content') ?>
diff --git a/www/quick-fix-desc.php b/www/quick-fix-desc.php
index c360379..5aad03f 100644
--- a/www/quick-fix-desc.php
+++ b/www/quick-fix-desc.php
@@ -1,47 +1,22 @@
 get(ReasonRepository::class);
-list($RESOLVE_REASONS, $FIX_VARIATIONS) = 
$reasonRepository->findByProject($site);
-
-// Authenticate
-bugs_authenticate($user, $pw, $logged_in, $user_flags);
-
-response_header('Quick Fix Descriptions');
-
-?>
-
- $reason) {
-if (!empty($reason['package_name']))
-$reason['title'] = "{$reason['title']} ({$reason['package_name']})";
-
-echo "
-
-{$reason['title']}
-Status: {$reason['status']}
-{$reason['message']}
-
-";
-if (isset($FIX_VARIATIONS[$key])) {
-foreach ($FIX_VARIATIONS[$key] as $type => $variation) {
-echo "
-
-{$reason['title']} ({$type})
-Status: {$reason['status']}
-{$variation}
-";
-}
-}
-}
-?>
-
+list($reasons, $variations) = $reasonRepository->findByProject('php');
 
-render('pages/quick_fix_desc.php', [
+'reasons' => $reasons,
+'variations' => $variations,
+]);


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Use noHtml() instead of e() to escape data in href attribute: templates/pages/index.php

2019-05-22 Thread Peter Kokot
Commit:03e280e9bcc6fb964e6c7b8fc9e54ab93d6b14f4
Author:Pieter Hordijk  Wed, 22 May 2019 
16:45:17 +0300
Parents:   49dd23a4a88040cf1134c374b2369a104f803765
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=03e280e9bcc6fb964e6c7b8fc9e54ab93d6b14f4

Log:
Use noHtml() instead of e() to escape data in href attribute

Changed paths:
  M  templates/pages/index.php


Diff:
diff --git a/templates/pages/index.php b/templates/pages/index.php
index 177e93f..dedb98b 100644
--- a/templates/pages/index.php
+++ b/templates/pages/index.php
@@ -60,7 +60,7 @@ open bug and see if you can help resolve it. We have made it 
easy. Hit
 
 
  $link): ?>
-e($title) ?>
+e($title) 
?>
 
 


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Move backtrace pages to templates: include/functions.php templates/pages/bugs_generating_backtrace.php templates/pages/bugs_generating_backtrace_win32.php www/bugs-genera

2019-05-21 Thread Peter Kokot
Commit:49dd23a4a88040cf1134c374b2369a104f803765
Author:Peter Kokot  Wed, 22 May 2019 04:43:45 
+0200
Parents:   35a1baa22f5a5388194047182e3eca31371c6b40
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=49dd23a4a88040cf1134c374b2369a104f803765

Log:
Move backtrace pages to templates

Changed paths:
  M  include/functions.php
  A  templates/pages/bugs_generating_backtrace.php
  A  templates/pages/bugs_generating_backtrace_win32.php
  M  www/bugs-generating-backtrace-win32.php
  M  www/bugs-generating-backtrace.php

diff --git a/include/functions.php b/include/functions.php
index 5e314a2..fd3bbd7 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1707,32 +1707,6 @@ function inline_content_menu($base_url, $current_action, 
array $menu)
 echo "\n";
 }
 
-/**
- * Inline content menu for backtraces
- *
- * Specify either 'Unix' or 'Windows' to select the current page
- */
-function backtrace_inline_menu($platform)
-{
-if ($platform != 'Unix' && $platform != 'Windows') {
-return;
-}
-
-$buffer = '';
-
-foreach (['Unix' => '', 'Windows' => '-win32'] as $platform_key => 
$platform_suffix) {
-if ($platform_key == $platform) {
-$buffer .= sprintf('%s | ', $platform_key);
-} else {
-$buffer .= sprintf('%s | ', $platform_suffix, 
$platform_key);
-}
-}
-
-echo "";
-echo rtrim($buffer, ' | ');
-echo "\n";
-}
-
 function admin_table_static(array $header, array $rows)
 {
 if (!$header || !$rows || sizeof($header) != sizeof($rows[0])) {
diff --git a/templates/pages/bugs_generating_backtrace.php 
b/templates/pages/bugs_generating_backtrace.php
new file mode 100644
index 000..b99f383
--- /dev/null
+++ b/templates/pages/bugs_generating_backtrace.php
@@ -0,0 +1,179 @@
+extends('layout.php', ['title' => 'Generating a gdb backtrace']) 
?>
+
+start('content') ?>
+
+
+Unix | Windows
+
+
+Generating a gdb backtrace
+
+Noticing PHP crashes
+
+There's no absolute way to know that PHP is crashing, but there may be signs.
+Typically, if you access a page that is always supposed to generate output (has
+a leading HTML block, for example), and suddenly get "Document contains no 
data"
+from your browser, it may mean that PHP crashes somewhere along the execution 
of
+the script. Another way to tell that PHP is crashing is by looking at the 
Apache
+error logs, and looking for SEGV (Apache 1.2) or Segmentation Fault (Apache
+1.3).
+
+Important!
+To get a backtrace with correct information you must have PHP configured with
+--enable-debug!
+
+If you don't have a core file yet:
+
+
+
+Remove any limits you may have on core dump size from your shell:
+
+tcsh:  unlimit coredumpsize
+bash/sh:  ulimit -c unlimited
+
+
+
+Ensure that the directory in which you're running PHP, or the
+PHP-enabled httpd, has write permissions for the user who's running 
PHP.
+
+
+Cause PHP to crash:
+
+PHP CGI: Simply run php with the script that crashes it
+PHP Apache Module: Run httpd -X, and access the script that 
crashes PHP
+
+
+
+
+Generic way to get a core on Linux
+
+
+
+Set up the core pattern (run this command as root):
+
+echo "<cores dir>/core-%e.%p" > 
/proc/sys/kernel/core_pattern
+make sure the directory is writable by PHP
+
+
+Set the ulimit (see above how to do it).
+Restart/rerun PHP.
+
+
+After that any process crashing in your system, including PHP, will leave 
its
+core file in the directory you've specified in core_pattern.
+
+Once you have the core file:
+
+
+
+Run gdb with the path to the PHP or PHP-enabled httpd binary, and path
+to the core file. Some examples:
+
+gdb /usr/local/apache/sbin/httpd 
/usr/local/apache/sbin/core
+gdb /home/user/dev/php-snaps/sapi/cli/php 
/home/user/dev/testing/core
+
+
+
+At the gdb prompt, run:
+
+(gdb) bt
+
+
+
+
+If you can't get a core file:
+
+
+Run httpd -X under gdb with something like:
+
+gdb /usr/local/apache/sbin/httpd
+(gdb) run -X
+
+
+
+Then use your web browser and access your server to force the crash. 
You
+should see a gdb prompt appear and some message indicating that there
+was a crash. At this gdb prompt, type:
+
+(gdb) bt
+
+
+
+   

[PHP-WEBMASTER] com web/bugs: Update phpunit schema version: README.md phpunit.xml.dist

2019-05-21 Thread Peter Kokot
Commit:35a1baa22f5a5388194047182e3eca31371c6b40
Author:Peter Kokot  Wed, 22 May 2019 03:20:30 
+0200
Parents:   5cdac95adc49562291a873c8704de3ceb0d9d398
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=35a1baa22f5a5388194047182e3eca31371c6b40

Log:
Update phpunit schema version

Changed paths:
  M  README.md
  M  phpunit.xml.dist


Diff:
diff --git a/README.md b/README.md
index f767e56..af5cc30 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Application unit tests can be executed in development 
environment after
 installing dependencies by running `phpunit`:
 
 ```bash
-phpunit
+./vendor/bin/phpunit
 ```
 
 ## Directory structure
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index e19c661..5bd0060 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -3,7 +3,7 @@
 
 http://www.w3.org/2001/XMLSchema-instance";
-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.4/phpunit.xsd";
+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.1/phpunit.xsd";
 backupGlobals="false"
 colors="true"
 bootstrap="tests/bootstrap.php">


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Add automatic fixtures generator importer: .gitignore README.md composer.json composer.lock config/container.php config/parameters.php scripts/console sql/fixtures.sql sr

2019-05-21 Thread Peter Kokot
Commit:5cdac95adc49562291a873c8704de3ceb0d9d398
Author:Peter Kokot  Mon, 6 May 2019 10:53:06 
+0200
Parents:   9d47b05f2db8b32039ab940db0083d6f4ce3370e
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=5cdac95adc49562291a873c8704de3ceb0d9d398

Log:
Add automatic fixtures generator importer

When developing site locally, developer needs to have data sets to run
manual tests, see how the app is built, and similar. The new additional
command line command using Symfony/Console component creates a main
scripts/console entry point for running Commands. Initial set of demo
fixtures data is generated using the faker library and includes most
data needed to use and test application manually in the local
environment.

Changed paths:
  M  .gitignore
  M  README.md
  M  composer.json
  M  composer.lock
  M  config/container.php
  M  config/parameters.php
  A  scripts/console
  D  sql/fixtures.sql
  A  src/Command/InsertFixturesCommand.php
  A  src/Fixtures/AppFixtures.php
  A  tests/Unit/Command/InsertFixturesCommandTest.php

diff --git a/.gitignore b/.gitignore
index 8d0441e..fe3c3eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,7 @@
 
 # Local specific PHPUnit configuration
 /phpunit.xml
-.phpunit.result.cache
+/.phpunit.result.cache
 
 # Transient and temporary generated files
 /var/
diff --git a/README.md b/README.md
index d3421a2..f767e56 100644
--- a/README.md
+++ b/README.md
@@ -17,8 +17,13 @@ Modify `local_config.php` according to your local 
development environment.
 
 * Database:
 
-Create a new MySQL/MariaDB database using `sql/database.sql`, create database
-schema `sql/schema.sql` and insert fixtures using `sql/fixtures.sql`.
+Create a new MySQL, MariaDB, Percona Server, or equivalent database using
+`sql/database.sql`, create database schema `sql/schema.sql` and insert demo 
data
+fixtures by running:
+
+```bash
+php scripts/console app:fixtures:insert
+```
 
 ## Tests
 
@@ -42,9 +47,10 @@ Source code of this application is structured in the 
following directories:
 ├─ prepend.php  # Autoloader, DB connection, container, app 
initialization
 └─ ...
  └─ scripts/# Command line development tools and scripts
+├─ console  # Application's main script for running CLI 
commands
 ├─ cron/# Various systems scripts to run periodically on 
the server
 └─ ...
- ├─ sql/# Database schema and fixtures
+ ├─ sql/# Database schema
  └─ src/# Application source code classes
 ├─ Horde/   # https://www.horde.org/libraries/Horde_Text_Diff
 └─ ...
diff --git a/composer.json b/composer.json
index abec91d..4d02265 100644
--- a/composer.json
+++ b/composer.json
@@ -32,7 +32,9 @@
 },
 "require-dev": {
 "ext-pdo_sqlite": "*",
-"phpunit/phpunit": "^8.1.5"
+"fzaninotto/faker": "^1.8",
+"phpunit/phpunit": "^8.1.5",
+"symfony/console": "^4.2"
 },
 "autoload": {
 "psr-4": {
diff --git a/composer.lock b/composer.lock
index 8111618..898739c 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies";,
 "This file is @generated automatically"
 ],
-"content-hash": "994d11b989a10210dc468c7046539905",
+"content-hash": "e90209efe832cd89e50a5f742fd551a8",
 "packages": [],
 "packages-dev": [
 {
@@ -64,6 +64,56 @@
 "time": "2019-03-17T17:37:11+00:00"
 },
 {
+"name": "fzaninotto/faker",
+"version": "v1.8.0",
+"source": {
+"type": "git",
+"url": "https://github.com/fzaninotto/Faker.git";,
+"reference": "f72816b43e74063c8b10357394b6bba8cb1c10de"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de";,
+"reference": "f72816b43e74063c8b10357394b6bba8cb1c10de",
+"shasum": ""
+},
+"require": {
+"php": "^5.3.3 || ^7.0"
+},
+"require-dev": {
+"ext-intl": "*",
+"phpunit/phpunit": "^4.8.35 || ^5.7",
+"squizlabs/php_codesniffer": "^1.5

[PHP-WEBMASTER] com web/bugs: Convert all tabs to spaces: include/functions.php include/query.php include/trusted-devs.php local_config.php.sample scripts/cron/email-assigned scripts/cron/no-feedback

2019-05-21 Thread Peter Kokot
Commit:9d47b05f2db8b32039ab940db0083d6f4ce3370e
Author:Peter Kokot  Wed, 22 May 2019 02:21:21 
+0200
Parents:   80d03e3e78f80fd90e4c231accaaa67bb9da37b6
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=9d47b05f2db8b32039ab940db0083d6f4ce3370e

Log:
Convert all tabs to spaces

Changed paths:
  M  include/functions.php
  M  include/query.php
  M  include/trusted-devs.php
  M  local_config.php.sample
  M  scripts/cron/email-assigned
  M  scripts/cron/no-feedback
  M  templates/addghpull.php
  M  templates/addpatch.php
  M  templates/search-rdf.php
  M  templates/search-rss2.php
  M  www/admin/index.php
  M  www/api.php
  M  www/bug-pwd-finder.php
  M  www/bug.php
  M  www/bugs-generating-backtrace-win32.php
  M  www/bugs-generating-backtrace.php
  M  www/css/style.css
  M  www/error.php
  M  www/fix.php
  M  www/js/package-affected.js
  M  www/js/search.js
  M  www/js/userlisting.php
  M  www/js/util.js
  M  www/login.php
  M  www/lstats.php
  M  www/patch-display.php
  M  www/quick-fix-desc.php
  M  www/report.php
  M  www/rpc.php
  M  www/rss/bug.php
  M  www/rss/rdf.php
  M  www/rss/rss.php
  M  www/rss/search.php
  M  www/rss/xml.php
  M  www/search.php
  M  www/stats.php
  M  www/vote.php


Diff: 

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Move simple pages to templates: include/auth.php templates/pages/bugs_getting_valgrind_log.php templates/pages/how_to_report.php templates/pages/search_how_to.php www/bug

2019-05-21 Thread Peter Kokot
Commit:80d03e3e78f80fd90e4c231accaaa67bb9da37b6
Author:Peter Kokot  Fri, 4 Jan 2019 01:03:29 
+0100
Parents:   353abb3d0bbec66f5f4d76f29dd6717d7babb5a9
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=80d03e3e78f80fd90e4c231accaaa67bb9da37b6

Log:
Move simple pages to templates

This is initial patch of the series of patches that moves the most
simple pages to templates.

Changed paths:
  A  include/auth.php
  A  templates/pages/bugs_getting_valgrind_log.php
  A  templates/pages/how_to_report.php
  A  templates/pages/search_how_to.php
  M  www/bugs-getting-valgrind-log.php
  M  www/how-to-report.php
  M  www/index.php
  M  www/search-howto.php

diff --git a/include/auth.php b/include/auth.php
new file mode 100644
index 000..e9d1052
--- /dev/null
+++ b/include/auth.php
@@ -0,0 +1,31 @@
+handle;
+} elseif (!empty($_SESSION['user'])) {
+$isLoggedIn = true;
+$username = $_SESSION['user'];
+} else {
+$isLoggedIn = false;
+$username = '';
+}
+
+$template->assign([
+'authIsLoggedIn' => $isLoggedIn,
+'authUsername' => $username,
+'authRole' => $logged_in,
+]);
diff --git a/templates/pages/bugs_getting_valgrind_log.php 
b/templates/pages/bugs_getting_valgrind_log.php
new file mode 100644
index 000..1bdec34
--- /dev/null
+++ b/templates/pages/bugs_getting_valgrind_log.php
@@ -0,0 +1,98 @@
+extends('layout.php', ['title' => 'Generating a valgrind log']) ?>
+
+start('content') ?>
+
+Generating a valgrind log
+
+Important!
+
+To get a meaningful log you must have PHP configured with 
--enable-debug
+and disable Zend memory manager.
+
+Disabling Zend MM
+
+
+Zend Engine uses its own routines to optimize memory management, but because of
+this valgrind cannot see most of the memory issues. You must disable Zend 
memory
+manager before running PHP with valgrind. In order to do this you need to set
+USE_ZEND_ALLOC environment variable to 0.
+
+
+
+Use
+export USE_ZEND_ALLOC=0
+or
+setenv USE_ZEND_ALLOC 0
+(the syntax depends on what your shell supports).
+
+
+
+This works since PHP 5.2, in older versions you had to reconfigure PHP with
+--disable-zend-memory-manager option.
+
+
+Using Shared Extensions
+
+
+To correctly show the stack frames for extensions compiled as shared 
libraries, set:
+export ZEND_DONT_UNLOAD_MODULES=1 or
+setenv ZEND_DONT_UNLOAD_MODULES 1 (the syntax depends 
on
+what your shell supports).
+
+
+
+This works from PHP 5.3.11 onwards.
+
+
+Running PHP CLI, Built-in Web Server or PHP CGI through valgrind
+
+
+To generate the valgrind log using PHP CLI/CGI, you need to execute the 
following
+command:
+
+
+
+
+valgrind --tool=memcheck --num-callers=30 --log-file=php.log 
/path/to/php-cli script.php
+
+
+
+This should put the log into php.log file in the current working 
directory.
+
+
+To valgrind the built-in web server, use the appropriate -S and -t options to
+the CLI executable. Run your application via a browser and review php.log for
+any valgrind errors.
+
+
+Running PHP Apache module through valgrind
+
+ If you compiled PHP and Apache statically, make sure the Apache binary is
+not stripped after make install, otherwise you lose the required
+debug info. To check it, run file /path/to/httpd, it should output
+something like this (notice "not stripped"):
+
+
+
+
+# file /usr/local/apache2/bin/httpd
+/usr/local/apache2/bin/httpd: ELF 64-bit LSB executable, x86-64, 
version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), 
not stripped
+
+
+
+
+To generate the valgrind log using PHP as Apache module, you need to run the
+Apache itself under valgrind:
+
+
+
+
+valgrind --tool=memcheck --num-callers=30 --log-file=apache.log 
/usr/local/apache/bin/httpd -X
+
+
+
+
+Run your application via a browser. All the memory errors will be in 
apache.log.
+
+
+end('content') ?>
diff --git a/templates/pages/how_to_report.php 
b/templates/pages/how_to_report.php
new file mode 100644
index 000..0445e9d
--- /dev/null
+++ b/templates/pages/how_to_report.php
@@ -0,0 +1,137 @@
+extends('layout.php', ['title' => 'How to Report a Bug']) ?>
+
+start('content') ?>
+
+How to Report a Bug
+
+There is a large number of PHP users. There is a much smaller number of 
people
+who actually develop the PHP language and extensions. There is an even smaller
+number of people who actively fix bugs reported by users.
+
+What does this mean for you, an aspiring bug reporter? In order to catch the
+eye of one of these few stalwart volunteers, you'll need to take to
+heart a few tips on how to report a bug so that they can and will help you.
+
+Take special note of that word in bold above. The people who are going to
+help you with a bug you report are volunt

[PHP-WEBMASTER] com web/bugs: Fix #64249: Bug tracker doesn't send notifies on adding of pull requests: www/gh-pull-add.php

2019-05-21 Thread Peter Kokot
Commit:353abb3d0bbec66f5f4d76f29dd6717d7babb5a9
Author:Peter Kokot  Wed, 22 May 2019 01:19:34 
+0200
Parents:   3c344392bdbb711da6c6cbc0611fe4fbc19f1599
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=353abb3d0bbec66f5f4d76f29dd6717d7babb5a9

Log:
Fix #64249: Bug tracker doesn't send notifies on adding of pull requests

This now sends also notification about GitHub pull request being
attached to a bug report.

Bugs:
https://bugs.php.net/64249

Changed paths:
  M  www/gh-pull-add.php


Diff:
diff --git a/www/gh-pull-add.php b/www/gh-pull-add.php
index 3f1d91a..4dac961 100644
--- a/www/gh-pull-add.php
+++ b/www/gh-pull-add.php
@@ -17,107 +17,107 @@ bugs_authenticate($user, $pw, $logged_in, $user_flags);
 /// Input vars
 $bug_id = !empty($_REQUEST['bug']) ? (int) $_REQUEST['bug'] : 0;
 if (empty($bug_id)) {
-   $bug_id = !empty($_REQUEST['bug_id']) ? (int) $_REQUEST['bug_id'] : 0;
+$bug_id = !empty($_REQUEST['bug_id']) ? (int) $_REQUEST['bug_id'] : 0;
 }
 
 if (empty($bug_id)) {
-   response_header('Error :: no bug selected');
-   display_bug_error('No bug selected to add a patch to (no bug or 
bug_id!)');
-   response_footer();
-   exit;
+response_header('Error :: no bug selected');
+display_bug_error('No bug selected to add a patch to (no bug or bug_id!)');
+response_footer();
+exit;
 }
 
 $bugRepository = $container->get(BugRepository::class);
 
 if (!($buginfo = $bugRepository->findOneById($bug_id))) {
-   response_header('Error :: invalid bug selected');
-   display_bug_error("Invalid bug #{$bug_id} selected");
-   response_footer();
-   exit;
+response_header('Error :: invalid bug selected');
+display_bug_error("Invalid bug #{$bug_id} selected");
+response_footer();
+exit;
 }
 
 $package_name = $buginfo['package_name'];
 
 // captcha is not necessary if the user is logged in
 if (!$logged_in) {
-   $captcha = $container->get(Captcha::class);
+$captcha = $container->get(Captcha::class);
 }
 
 $show_bug_info = bugs_has_access($bug_id, $buginfo, $pw, $user_flags);
 
 if (!$show_bug_info) {
-   response_header('Private report');
-   display_bug_error("The bug #{$bug_id} is not available to public");
-   response_footer();
-   exit;
+response_header('Private report');
+display_bug_error("The bug #{$bug_id} is not available to public");
+response_footer();
+exit;
 }
 
 $pullinfo = $container->get(GitHub::class);
 $pullRequestRepository = $container->get(PullRequestRepository::class);
 
 if (isset($_POST['addpull'])) {
-   $errors = [];
-   if (empty($_POST['repository'])) {
-   $errors[] = 'No repository selected';
-   }
-   if (empty($_POST['pull_id'])) {
-   $errors[] = 'No Pull request selected';
-   }
-
-   if (!$logged_in) {
-   try {
-   $email = isset($_POST['email']) ? $_POST['email'] : '';
-
-   if (!is_valid_email($email, $logged_in)) {
-   $errors[] = 'Email address must be valid!';
-   }
-
-   /**
-* Check if session answer is set, then compare
-* it with the post captcha value. If it's not
-* the same, then it's an incorrect password.
-*/
-   if (!isset($_SESSION['answer']) || $_POST['captcha'] != 
$_SESSION['answer']) {
-   $errors[] = 'Incorrect Captcha';
-   }
-
-   if (count($errors)) {
-   throw new Exception('');
-   }
-
-   } catch (Exception $e) {
-   $pulls = 
$pullRequestRepository->findAllByBugId($bug_id);
-   include "{$ROOT_DIR}/templates/addghpull.php";
-   exit;
-   }
-   } else {
-   $email = $auth_user->email;
-   }
-
-   if (!count($errors)) {
-   try {
-   $newpr = $pullinfo->attach($bug_id, 
$_POST['repository'], $_POST['pull_id'], $email);
-   } catch(\Exception $e) {
-   $errors = ['Could not attach pull request to Bug 
#'.$bug_id];
-
-   if ($e->errorInfo[1] === 1062) {
-   $errors[] = 'This pull request is already 
added.';
-   }
-
-   if ('

[PHP-WEBMASTER] com web/bugs: Fix #62088: Missing changelog entry when adding patch: www/patch-add.php

2019-05-21 Thread Peter Kokot
Commit:3c344392bdbb711da6c6cbc0611fe4fbc19f1599
Author:Peter Kokot  Wed, 22 May 2019 01:13:15 
+0200
Parents:   80abfff45301cb69fcd992a911ed6925625455e6
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=3c344392bdbb711da6c6cbc0611fe4fbc19f1599

Log:
Fix #62088: Missing changelog entry when adding patch

Bugs:
https://bugs.php.net/62088

Changed paths:
  M  www/patch-add.php


Diff:
diff --git a/www/patch-add.php b/www/patch-add.php
index 76e34f0..9429ced 100644
--- a/www/patch-add.php
+++ b/www/patch-add.php
@@ -21,39 +21,39 @@ $canpatch = true;
 /// Input vars
 $bug_id = !empty($_REQUEST['bug']) ? (int) $_REQUEST['bug'] : 0;
 if (empty($bug_id)) {
-   $bug_id = !empty($_REQUEST['bug_id']) ? (int) $_REQUEST['bug_id'] : 0;
+$bug_id = !empty($_REQUEST['bug_id']) ? (int) $_REQUEST['bug_id'] : 0;
 }
 
 if (empty($bug_id)) {
-   response_header('Error :: no bug selected');
-   display_bug_error('No bug selected to add a patch to (no bug or 
bug_id!)');
-   response_footer();
-   exit;
+response_header('Error :: no bug selected');
+display_bug_error('No bug selected to add a patch to (no bug or bug_id!)');
+response_footer();
+exit;
 }
 
 $bugRepository = $container->get(BugRepository::class);
 
 if (!($buginfo = $bugRepository->findOneById($bug_id))) {
-   response_header('Error :: invalid bug selected');
-   display_bug_error("Invalid bug #{$bug_id} selected");
-   response_footer();
-   exit;
+response_header('Error :: invalid bug selected');
+display_bug_error("Invalid bug #{$bug_id} selected");
+response_footer();
+exit;
 }
 
 $package_name = $buginfo['package_name'];
 
 // captcha is not necessary if the user is logged in
 if (!$logged_in) {
-   $captcha = $container->get(Captcha::class);
+$captcha = $container->get(Captcha::class);
 }
 
 $show_bug_info = bugs_has_access($bug_id, $buginfo, $pw, $user_flags);
 
 if (!$show_bug_info) {
-   response_header('Private report');
-   display_bug_error("The bug #{$bug_id} is not available to public");
-   response_footer();
-   exit;
+response_header('Private report');
+display_bug_error("The bug #{$bug_id} is not available to public");
+response_footer();
+exit;
 }
 
 $patch_name = (!empty($_GET['patchname']) && is_string($_GET['patchname'])) ? 
$_GET['patchname'] : '';
@@ -61,79 +61,77 @@ $patch_name = (!empty($_POST['name']) && 
is_string($_POST['name'])) ? $_POST['na
 $patch_name_url = urlencode($patch_name);
 
 if (isset($_POST['addpatch'])) {
-   if (!isset($_POST['obsoleted'])) {
-   $_POST['obsoleted'] = [];
-   }
-
-   // Check that patch name is given (required always)
-   if (empty($patch_name)) {
-   $patches = $patchRepository->findAllByBugId($bug_id);
-   $errors[] = 'No patch name entered';
-   include "{$ROOT_DIR}/templates/addpatch.php";
-   exit;
-   }
-
-   if (!$logged_in) {
-   try {
-   $errors = [];
-
-   $email = isset($_POST['email']) ? $_POST['email'] : '';
-
-   if (!is_valid_email($email, $logged_in)) {
-   $errors[] = 'Email address must be valid!';
-   }
-
-   /**
-* Check if session answer is set, then compare
-* it with the post captcha value. If it's not
-* the same, then it's an incorrect password.
-*/
-   if (!isset($_SESSION['answer']) || $_POST['captcha'] != 
$_SESSION['answer']) {
-   $errors[] = 'Incorrect Captcha';
-   }
-
-   if (count($errors)) {
-   throw new \Exception('');
-   }
-
-   try {
-   $revision = $patchTracker->attach($bug_id, 
'patch', $patch_name, $email, $_POST['obsoleted']);
-   } catch (\Exception $e) {
-   $patches = 
$patchRepository->findAllByBugId($bug_id);
-   $errors[] = $e->getMessage();
-   $errors[] = 'Could not attach patch 
"'.htmlspecialchars($patch_name).'" to Bug #'.$bug_id;
-   include "{$ROOT_DIR}/templ

[PHP-WEBMASTER] com web/bugs: Add sorting and pdo_sqlite requirement to composer.json: composer.json composer.lock

2019-05-20 Thread Peter Kokot
Commit:80abfff45301cb69fcd992a911ed6925625455e6
Author:Peter Kokot  Tue, 21 May 2019 03:18:03 
+0200
Parents:   1c9eef526724d1ea42381eabfcfe7a649bf592b6
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=80abfff45301cb69fcd992a911ed6925625455e6

Log:
Add sorting and pdo_sqlite requirement to composer.json

Changed paths:
  M  composer.json
  M  composer.lock


Diff:
diff --git a/composer.json b/composer.json
index 64ea11e..abec91d 100644
--- a/composer.json
+++ b/composer.json
@@ -31,6 +31,7 @@
 "ext-session": "*"
 },
 "require-dev": {
+"ext-pdo_sqlite": "*",
 "phpunit/phpunit": "^8.1.5"
 },
 "autoload": {
@@ -44,6 +45,9 @@
 "App\\Tests\\": "tests/"
 }
 },
+"config": {
+"sort-packages": true
+},
 "scripts":{
 "post-install-cmd": [
 "App\\Utils\\ComposerScripts::installConfig",
diff --git a/composer.lock b/composer.lock
index c2e6783..8111618 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies";,
 "This file is @generated automatically"
 ],
-"content-hash": "17ababe7c83360ac61eb5e7adc7d9024",
+"content-hash": "994d11b989a10210dc468c7046539905",
 "packages": [],
 "packages-dev": [
 {
@@ -1496,5 +1496,7 @@
 "ext-pdo_mysql": "*",
 "ext-session": "*"
 },
-"platform-dev": []
+"platform-dev": {
+"ext-pdo_sqlite": "*"
+}
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Upgrade to PHP 7.3: composer.json composer.lock www/fix.php

2019-05-20 Thread Peter Kokot
Commit:1c9eef526724d1ea42381eabfcfe7a649bf592b6
Author:Peter Kokot  Tue, 21 May 2019 01:34:00 
+0200
Parents:   f762db348dc0ef698bdbd3cd4c95530b1266e027
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=1c9eef526724d1ea42381eabfcfe7a649bf592b6

Log:
Upgrade to PHP 7.3

Application now also support PHP 7.3 as a minimum for future code
changes.

Changed paths:
  M  composer.json
  M  composer.lock
  M  www/fix.php


Diff:
diff --git a/composer.json b/composer.json
index c32eeda..64ea11e 100644
--- a/composer.json
+++ b/composer.json
@@ -21,7 +21,7 @@
 "rss": "https://bugs.php.net/rss";
 },
 "require": {
-"php": "^7.2",
+"php": "^7.3",
 "ext-fileinfo": "*",
 "ext-json": "*",
 "ext-mbstring": "*",
diff --git a/composer.lock b/composer.lock
index 63aa327..c2e6783 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies";,
 "This file is @generated automatically"
 ],
-"content-hash": "dba2ed92613c9c0acb06a57f86464228",
+"content-hash": "17ababe7c83360ac61eb5e7adc7d9024",
 "packages": [],
 "packages-dev": [
 {
@@ -1487,7 +1487,7 @@
 "prefer-stable": false,
 "prefer-lowest": false,
 "platform": {
-"php": "^7.2",
+"php": "^7.3",
 "ext-fileinfo": "*",
 "ext-json": "*",
 "ext-mbstring": "*",
diff --git a/www/fix.php b/www/fix.php
index 4a11487..1c0d36e 100644
--- a/www/fix.php
+++ b/www/fix.php
@@ -43,7 +43,7 @@ $reasonRepository = $container->get(ReasonRepository::class);
 list($RESOLVE_REASONS, $FIX_VARIATIONS) = 
$reasonRepository->findByProject($site);
 
 // Handle reason / comments
-$reason = filter_var($_REQUEST['r'], FILTER_SANITIZE_STRING);
+$reason = isset($_REQUEST['r']) ? filter_var($_REQUEST['r'], 
FILTER_SANITIZE_STRING) : '';
 $ncomment = isset($_POST['ncomment']) ? trim($_POST['ncomment']) : '';
 
 if (!$reason || !isset($RESOLVE_REASONS[$reason])) {


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Add tests fixes: .gitignore composer.json composer.lock phpunit.xml.dist src/Autoloader.php tests/AutoloaderTest.php tests/Container/ContainerTest.php tests/Container/Moc

2019-05-16 Thread Peter Kokot
Commit:f762db348dc0ef698bdbd3cd4c95530b1266e027
Author:Pieter Hordijk  Thu, 16 May 2019 
16:05:18 +0300
Committer: Peter Kokot   Thu, 16 May 2019 22:05:30 
+0200
Parents:   3c825bc8531f1896d823c77eba97b2b709338427
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=f762db348dc0ef698bdbd3cd4c95530b1266e027

Log:
Add tests fixes

- Added filter to phpunit config
- This enables support for coverage support
- Moved unit tests to dedicated directory
- Also created constants for the locations of the fixtures and mocks for
  testing so we do not have to use relative paths in tests
- Updated phpunit to 8
- Added type information to tests
- Added return type and parameter type declarations for tests
- Added strict types to tests
- CS fixes in tests
- Aligning arrays, consistent string concatenation, removed unused local
  vars
- Added constant for test cache directory
- Make the autoloader also properly work on windows
- Windows does not care about the directory separator used so just trim
  both variant from the end.

Changed paths:
  M  .gitignore
  M  composer.json
  M  composer.lock
  M  phpunit.xml.dist
  M  src/Autoloader.php
  D  tests/AutoloaderTest.php
  D  tests/Container/ContainerTest.php
  D  tests/Container/MockDependency.php
  D  tests/Container/MockService.php
  A  tests/Mocks/responses/dev-body.txt
  A  tests/Mocks/responses/stable-body.txt
  D  tests/Template/ContextTest.php
  D  tests/Template/EngineTest.php
  A  tests/Unit/AutoloaderTest.php
  A  tests/Unit/Container/ContainerTest.php
  A  tests/Unit/Container/MockDependency.php
  A  tests/Unit/Container/MockService.php
  A  tests/Unit/Template/ContextTest.php
  A  tests/Unit/Template/EngineTest.php
  A  tests/Unit/Utils/CacheTest.php
  A  tests/Unit/Utils/CaptchaTest.php
  A  tests/Unit/Utils/UploaderTest.php
  A  tests/Unit/Utils/Versions/ClientTest.php
  A  tests/Unit/Utils/Versions/GeneratorTest.php
  D  tests/Utils/CacheTest.php
  D  tests/Utils/CaptchaTest.php
  D  tests/Utils/UploaderTest.php
  D  tests/Utils/Versions/ClientTest.php
  D  tests/Utils/Versions/GeneratorTest.php
  A  tests/bootstrap.php
  D  tests/mock/responses/dev-body.txt
  D  tests/mock/responses/stable-body.txt

diff --git a/.gitignore b/.gitignore
index 07c61bc..8d0441e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,9 @@
+# These files are generated during application running or testing and are
+# intentionally untracked to ignore by Git. For other development environment
+# specific files, such as editor configuration, a good practice is to exclude
+# them using the .git/info/exclude in the cloned repository or a global
+# .gitignore file.
+
 # Uploaded patches
 /uploads/
 
@@ -6,6 +12,7 @@
 
 # Local specific PHPUnit configuration
 /phpunit.xml
+.phpunit.result.cache
 
 # Transient and temporary generated files
 /var/
diff --git a/composer.json b/composer.json
index 438518b..c32eeda 100644
--- a/composer.json
+++ b/composer.json
@@ -31,7 +31,7 @@
 "ext-session": "*"
 },
 "require-dev": {
-"phpunit/phpunit": "^7.5"
+"phpunit/phpunit": "^8.1.5"
 },
 "autoload": {
 "psr-4": {
diff --git a/composer.lock b/composer.lock
index b5c6108..63aa327 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies";,
 "This file is @generated automatically"
 ],
-"content-hash": "c4d7d1e13a174de9ebf8016cf7872528",
+"content-hash": "dba2ed92613c9c0acb06a57f86464228",
 "packages": [],
 "packages-dev": [
 {
@@ -430,40 +430,40 @@
 },
 {
 "name": "phpunit/php-code-coverage",
-"version": "6.1.4",
+"version": "7.0.3",
 "source": {
 "type": "git",
 "url": 
"https://github.com/sebastianbergmann/php-code-coverage.git";,
-"reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d"
+"reference": "0317a769a81845c390e19684d9ba25d7f6aa4707"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d";,
-"reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d",
+"url": 
"https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0317a769a81845c390e19684d9ba25d7f6aa4707";,
+"reference": "0317a769a81845c390e19684d9b

[PHP-WEBMASTER] com web/bugs: Do not use suspended status when requesting a random ticked: src/Repository/BugRepository.php

2019-05-15 Thread Peter Kokot
Commit:3c825bc8531f1896d823c77eba97b2b709338427
Author:Pieter Hordijk  Wed, 15 May 2019 
19:41:14 +0300
Parents:   6d59ead00cdd3df0526fd5f1027b957717956f76
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=3c825bc8531f1896d823c77eba97b2b709338427

Log:
Do not use suspended status when requesting a random ticked

Changed paths:
  M  src/Repository/BugRepository.php


Diff:
diff --git a/src/Repository/BugRepository.php b/src/Repository/BugRepository.php
index d47f0c3..8bb871f 100644
--- a/src/Repository/BugRepository.php
+++ b/src/Repository/BugRepository.php
@@ -63,7 +63,7 @@ class BugRepository
 {
 $sql = "SELECT id
 FROM bugdb
-WHERE status NOT IN('Closed', 'Not a bug', 'Duplicate', 
'Spam', 'Wont fix', 'No Feedback')
+WHERE status NOT IN('Closed', 'Not a bug', 'Duplicate', 
'Spam', 'Wont fix', 'No Feedback', 'Suspended')
 AND private = 'N'
 ORDER BY RAND() LIMIT 1
 ";


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: phpday 2019, in a couple of days.: archive/archive.xml archive/entries/2019-05-08-1.xml

2019-05-08 Thread Peter Kokot
Commit:8172d101fdcf8f51b52d365aa84273b3c949a62c
Author:Matteo Beccati  Wed, 8 May 2019 09:31:37 
+0200
Parents:   06b121f2f7b5bf1fa0351ad0e119650ba271a063
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=8172d101fdcf8f51b52d365aa84273b3c949a62c

Log:
phpday 2019, in a couple of days.

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-05-08-1.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index 7c58519..e9b359a 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-05-08-1.xml b/archive/entries/2019-05-08-1.xml
new file mode 100644
index 000..6ca221d
--- /dev/null
+++ b/archive/entries/2019-05-08-1.xml
@@ -0,0 +1,19 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  phpday 2019
+  http://php.net/archive/2019.php#id2019-05-08-1
+  2019-05-08T09:28:01+02:00
+  2019-05-08T09:28:01+02:00
+  http://php.net/ns/news";>2019-05-11
+  
+  http://php.net/conferences/index.php#id2019-05-08-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://2019.phpday.it/"; title="phpday 
2019">phpday-it.png
+  https://2019.phpday.it/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ The Italian PHP user group GrUSP is pleased to announce the https://2019.phpday.it/";>16th edition of phpday, taking 
place on May 10-11th, 2019 in Verona, Italy. 
+ It is the first historic Italian conference dedicated solely to PHP 
development, technologies and management. It is aimed to IT managers, 
developers and innovators. Each year it renews the opportunity to link to new 
business partners.
+ Check out our great https://2019.phpday.it/schedule.html";>schedule and get your ticket 
now!
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Fix undefined index if bug status not set: www/search.php

2019-05-05 Thread Peter Kokot
Commit:6d59ead00cdd3df0526fd5f1027b957717956f76
Author:Peter Kokot  Sun, 5 May 2019 16:04:48 
+0200
Parents:   35463d9fa397f963443f75c42f54e1a7bbfc5432
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=6d59ead00cdd3df0526fd5f1027b957717956f76

Log:
Fix undefined index if bug status not set

Changed paths:
  M  www/search.php


Diff:
diff --git a/www/search.php b/www/search.php
index d99f20e..1edd193 100644
--- a/www/search.php
+++ b/www/search.php
@@ -150,7 +150,7 @@ if (isset($_GET['cmd']) && $_GET['cmd'] == 'display')
 ' , "\n";


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Fix #77971: Can't access other than 1st page of advanced bug search: include/query.php

2019-05-04 Thread Peter Kokot
Commit:35463d9fa397f963443f75c42f54e1a7bbfc5432
Author:Peter Kokot  Sun, 5 May 2019 05:42:22 
+0200
Parents:   2abc2bd092bc4abf9b1e3c51d01847b05d150d40
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=35463d9fa397f963443f75c42f54e1a7bbfc5432

Log:
Fix #77971: Can't access other than 1st page of advanced bug search

Bugs:
https://bugs.php.net/77971

Changed paths:
  M  include/query.php


Diff:
diff --git a/include/query.php b/include/query.php
index efe903b..46be206 100644
--- a/include/query.php
+++ b/include/query.php
@@ -88,8 +88,8 @@ if (isset($_GET['cmd']) && $_GET['cmd'] == 'display')
if (!empty($package_name)) {
$where_clause .= ' AND bugdb.package_name';
if (count($package_name) > 1) {
-   $package_name = array_map([$dbh, 'quote'], 
$package_name);
-   $where_clause .= " IN (" . join(", ", $package_name) . 
")";
+   $items = array_map([$dbh, 'quote'], $package_name);
+   $where_clause .= " IN (" . join(", ", $items) . ")";
} else {
$where_clause .= ' = ' . $dbh->quote($package_name[0]);
}
@@ -98,8 +98,8 @@ if (isset($_GET['cmd']) && $_GET['cmd'] == 'display')
if (!empty($package_nname)) {
$where_clause .= ' AND bugdb.package_name';
if (count($package_nname) > 1) {
-   $package_nname = array_map([$dbh, 'quote'], 
$package_nname);
-   $where_clause .= " NOT IN (" . join(", ", 
$package_nname) . ")";
+   $items = array_map([$dbh, 'quote'], $package_nname);
+   $where_clause .= " NOT IN (" . join(", ", $items) . ")";
} else {
$where_clause .= ' <> ' . 
$dbh->quote($package_nname[0]);
}


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Bump Composer dependencies: composer.lock

2019-05-04 Thread Peter Kokot
Commit:2abc2bd092bc4abf9b1e3c51d01847b05d150d40
Author:Peter Kokot  Sat, 4 May 2019 22:13:55 
+0200
Parents:   98337280da29ac042159c2280895d0b4ec753a01
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=2abc2bd092bc4abf9b1e3c51d01847b05d150d40

Log:
Bump Composer dependencies

Changed paths:
  M  composer.lock

diff --git a/composer.lock b/composer.lock
index a2bc849..b5c6108 100644
--- a/composer.lock
+++ b/composer.lock
@@ -9,27 +9,29 @@
 "packages-dev": [
 {
 "name": "doctrine/instantiator",
-"version": "1.1.0",
+"version": "1.2.0",
 "source": {
 "type": "git",
 "url": "https://github.com/doctrine/instantiator.git";,
-"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
+"reference": "a2c590166b2133a4633738648b6b064edae0814a"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda";,
-"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+"url": 
"https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a";,
+"reference": "a2c590166b2133a4633738648b6b064edae0814a",
 "shasum": ""
 },
 "require": {
 "php": "^7.1"
 },
 "require-dev": {
-"athletic/athletic": "~0.1.8",
+"doctrine/coding-standard": "^6.0",
 "ext-pdo": "*",
 "ext-phar": "*",
-"phpunit/phpunit": "^6.2.3",
-"squizlabs/php_codesniffer": "^3.0.2"
+"phpbench/phpbench": "^0.13",
+"phpstan/phpstan-phpunit": "^0.11",
+"phpstan/phpstan-shim": "^0.11",
+"phpunit/phpunit": "^7.0"
 },
 "type": "library",
 "extra": {
@@ -54,25 +56,25 @@
 }
 ],
 "description": "A small, lightweight utility to instantiate 
objects in PHP without invoking their constructors",
-"homepage": "https://github.com/doctrine/instantiator";,
+"homepage": 
"https://www.doctrine-project.org/projects/instantiator.html";,
 "keywords": [
 "constructor",
 "instantiate"
 ],
-"time": "2017-07-22T11:58:36+00:00"
+"time": "2019-03-17T17:37:11+00:00"
 },
 {
 "name": "myclabs/deep-copy",
-"version": "1.8.1",
+"version": "1.9.1",
 "source": {
 "type": "git",
 "url": "https://github.com/myclabs/DeepCopy.git";,
-"reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8"
+"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8";,
-"reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
+"url": 
"https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72";,
+"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72",
 "shasum": ""
 },
 "require": {
@@ -107,7 +109,7 @@
 "object",
 "object graph"
 ],
-"time": "2018-06-11T23:09:50+00:00"
+"time": "2019-04-07T13:18:21+00:00"
 },
 {
 "name": "phar-io/manifest",
@@ -267,16 +269,16 @@
 },
 {
 "name": "phpdocumentor/reflection-docblock&quo

[PHP-WEBMASTER] com web/bugs: Fix #77452: Undefined status Wont fix: www/search-howto.php

2019-05-04 Thread Peter Kokot
Commit:98337280da29ac042159c2280895d0b4ec753a01
Author:Peter Kokot  Sat, 4 May 2019 13:45:03 
+0200
Parents:   408f4f085471c16daba761ef0f89acca9ebd06ef
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=98337280da29ac042159c2280895d0b4ec753a01

Log:
Fix #77452: Undefined status Wont fix

This adds additional explanation of the "Wont fix" status.

Bugs:
https://bugs.php.net/77452

Changed paths:
  M  www/search-howto.php


Diff:
diff --git a/www/search-howto.php b/www/search-howto.php
index 463b79e..6b0edaf 100644
--- a/www/search-howto.php
+++ b/www/search-howto.php
@@ -96,6 +96,11 @@ options.
Suspended: Tickets 
which are waiting on some action
which is outside the scope of the PHP 
developers.

+   
+   Wont fix: Tickets 
where PHP developers won't fix an issue
+   (even though it is acknowlegded as 
such), for reasons to be stated in the
+   closing comment.
+   
All: All types, even 
not-a-bug.




--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Fix the conference URL: archive/entries/2019-03-23-1.xml

2019-04-23 Thread Peter Kokot
Commit:d39006260b6421b65856392477525025d90733e8
Author:Krishnaprasad MG  Tue, 23 Apr 2019 
10:53:24 +0200
Committer: GitHub   Tue, 23 Apr 2019 10:53:24 +0200
Parents:   cdec537f81f3d17d1343450005b6ca21688a5ae0
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=d39006260b6421b65856392477525025d90733e8

Log:
Fix the conference URL

Changed paths:
  M  archive/entries/2019-03-23-1.xml


Diff:
diff --git a/archive/entries/2019-03-23-1.xml b/archive/entries/2019-03-23-1.xml
index 2b90a64..f8c2ef8 100644
--- a/archive/entries/2019-03-23-1.xml
+++ b/archive/entries/2019-03-23-1.xml
@@ -7,8 +7,8 @@
   http://php.net/ns/news";>2019-04-13
   
   http://php.net/conferences/index.php#id2019-03-23-1"; 
rel="alternate" type="text/html"/>
-  http://php.net/ns/news"; 
link="https://mwww.middevcon.com/"; title="Mid-Atlantic Developer 
Conference">middevcon2018.png
-  https://mwww.middevcon.com/"; rel="via" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://www.middevcon.com/"; title="Mid-Atlantic Developer 
Conference">middevcon2018.png
+  https://www.middevcon.com/"; rel="via" type="text/html"/>
   
 http://www.w3.org/1999/xhtml";>
  


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Add PHPConf.Asia 2019: archive/archive.xml archive/entries/2019-04-04-4.xml

2019-04-04 Thread Peter Kokot
Commit:dda8349d9b81a131f7a90ce17f134ecce0ea0ce1
Author:Zion Ng  Thu, 4 Apr 2019 12:46:08 +0800
Committer: Peter Kokot   Thu, 4 Apr 2019 20:20:45 
+0200
Parents:   8f61af8edf79ae5d44cc8816559f35f0c386e534
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=dda8349d9b81a131f7a90ce17f134ecce0ea0ce1

Log:
Add PHPConf.Asia 2019

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-04-04-4.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index bc62300..34b0f52 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-04-04-4.xml b/archive/entries/2019-04-04-4.xml
new file mode 100644
index 000..5daa1fa
--- /dev/null
+++ b/archive/entries/2019-04-04-4.xml
@@ -0,0 +1,21 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  PHPConf.Asia 2019
+  http://php.net/archive/2019.php#id2019-04-04-4
+  2019-04-04T12:51:44+08:00
+  2019-04-04T12:51:44+08:00
+  http://php.net/ns/news";>2019-06-24
+  
+  http://php.net/conferences/index.php#id2019-04-04-4"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://2019.phpconf.asia"; 
title="PHPConf.Asia">phpconfasia-logo.png
+  https://2019.phpconf.asia"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+  PHPConf.Asia 2019
+  Announcing PHPConf.Asia 2019 - The Pan-Asian PHP Conference - Ticket 
Sales are Open!
+  The fourth pan-Asian PHP conference will take place between 24th to 
26th June 2019 in Singapore - the Garden City of the East! This is a single 
track, 2 days Conference (24th to 25th June 2019). Followed by 1 Workshop Day 
on 26th June 2019.
+  Come and meet with the fastest growing PHP communities in Asia. More 
than 200 attendees are expected in this single track conference.
+  Hop over to https://2019.phpconf.asia for more details!
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Announcing some upcoming Symfony conferences: archive/archive.xml archive/entries/2019-04-02-1.xml archive/entries/2019-04-02-2.xml archive/entries/2019-04-02-3.xml archiv

2019-04-02 Thread Peter Kokot
Commit:914c74d9cb757eef1d94d7590e9e9b7dbea83812
Author:Javier Eguiluz  Tue, 2 Apr 2019 
12:32:30 +0200
Committer: Peter Kokot   Tue, 2 Apr 2019 22:54:48 
+0200
Parents:   92ad163be6c52938a81e3bd5eed34ad1d33c7f9c
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=914c74d9cb757eef1d94d7590e9e9b7dbea83812

Log:
Announcing some upcoming Symfony conferences

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-04-02-1.xml
  A  archive/entries/2019-04-02-2.xml
  A  archive/entries/2019-04-02-3.xml
  A  archive/entries/2019-04-02-4.xml
  A  archive/entries/2019-04-02-5.xml
  A  archive/entries/2019-04-02-6.xml
  A  images/news/symfonycon-amsterdam-2019.png
  A  images/news/symfonylive-berlin-2019.png
  A  images/news/symfonylive-london-2019.png
  A  images/news/symfonylive-saopaulo-2019.png
  A  images/news/symfonylive-tunis-2019.png
  A  images/news/symfonylive-warszawa-2019.png

diff --git a/archive/archive.xml b/archive/archive.xml
index d0b6d51..8f396f0 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,12 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
+  
+  
+  
+  
+  
   
   
   
diff --git a/archive/entries/2019-04-02-1.xml b/archive/entries/2019-04-02-1.xml
new file mode 100644
index 000..017cd0a
--- /dev/null
+++ b/archive/entries/2019-04-02-1.xml
@@ -0,0 +1,22 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  SymfonyLive Tunis 2019
+  http://php.net/archive/2019.php#id2019-04-02-1
+  2019-04-02T10:03:21+00:00
+  2019-04-02T10:03:21+00:00
+  http://php.net/ns/news";>2019-04-27
+  
+  http://php.net/conferences/index.php#id2019-04-02-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://tunis2019.live.symfony.com/"; title="SymfonyLive Tunis 2019 
Conference">symfonylive-tunis-2019.png
+  https://tunis2019.live.symfony.com/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ The SymfonyLive conference is coming to Tunis for the first time! From 
the
+ 25th to the 27th of April there will be two workshop days and a 
conference day.
+ 
+ Symfony fans, don't miss the opportunity to attend inspiring and 
exciting
+ talks and hands-on workshops!
+ 
+
+  
+
diff --git a/archive/entries/2019-04-02-2.xml b/archive/entries/2019-04-02-2.xml
new file mode 100644
index 000..a78d7b6
--- /dev/null
+++ b/archive/entries/2019-04-02-2.xml
@@ -0,0 +1,21 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  SymfonyLive São Paulo 2019
+  http://php.net/archive/2019.php#id2019-04-02-2
+  2019-04-02T10:13:07+00:00
+  2019-04-02T10:13:07+00:00
+  http://php.net/ns/news";>2019-05-16
+  
+  http://php.net/conferences/index.php#id2019-04-02-2"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://brasil2019.live.symfony.com/"; title="SymfonyLive São Paulo 2019 
Conference">symfonylive-saopaulo-2019.png
+  https://brasil2019.live.symfony.com/"; rel="via" 
type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ The SymfonyLive conference is coming to Brazil for the first time! 
Join the
+ big Symfony Brazilian community and learn all about the latest Symfony 
features.
+ 
+ Symfony fans, don't miss the opportunity to attend inspiring and 
exciting
+ talks and hands-on workshops from the 14th to the 17th of May!
+
+  
+
diff --git a/archive/entries/2019-04-02-3.xml b/archive/entries/2019-04-02-3.xml
new file mode 100644
index 000..d884c80
--- /dev/null
+++ b/archive/entries/2019-04-02-3.xml
@@ -0,0 +1,21 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  SymfonyLive Warszawa 2019
+  http://php.net/archive/2019.php#id2019-04-02-3
+  2019-04-02T10:21:12+00:00
+  2019-04-02T10:21:12+00:00
+  http://php.net/ns/news";>2019-06-13
+  
+  http://php.net/conferences/index.php#id2019-04-02-3"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://warszawa2019.live.symfony.com/"; title="SymfonyLive Warszawa 2019 
Conference">symfonylive-warszawa-2019.png
+  https://warszawa2019.live.symfony.com/"; rel="via" 
type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ The SymfonyLive conference is coming to Warsaw (Poland) for the first 
time! Join the
+ big Symfony Polish community and learn all about the latest Symfony 
features.
+ 
+ Symfony fans, don't miss the opportunity to attend inspiring and 
exciting
+ talks and hands-on workshops from the 11th to the 14th of June!
+
+  
+
diff -

[PHP-WEBMASTER] com web/php: Remove unused legacy reST redirections: error.php

2019-03-30 Thread Peter Kokot
Commit:b8332da255ab483c9b4b7cb9b9b8bcf41463c597
Author:Peter Kokot  Wed, 27 Mar 2019 22:27:42 
+0100
Parents:   4716c2ba20e7d9183e333711c560aca060f1d65f
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=b8332da255ab483c9b4b7cb9b9b8bcf41463c597

Log:
Remove unused legacy reST redirections

The php.net/reST pages once served some source code files. It has been
removed via 74bc9e6ad77fb860ae8e171d46b4914a3737d7a9 in 2013 so these
redirections are most likely not relevant anymore for PHP.net audience.

Changed paths:
  M  error.php


Diff:
diff --git a/error.php b/error.php
index c9cdb6f..3f1cc7c 100644
--- a/error.php
+++ b/error.php
@@ -475,11 +475,6 @@ $external_redirects = array(
 "release/5_3_0.php" => "/releases/5_3_0.php", // PHP 5.3.0 release 
announcement had a typo
 "ideas.php"   => "http://wiki.php.net/ideas";, // BC
 "releases.atom" => "/releases/feed.php", // BC, No need to pre-generate it
-// We used to do reST rendering of README files
-"rest/readme.release_process"   => 
"http://git.php.net/?p=php-src.git;a=blob_plain;f=README.RELEASE_PROCESS;hb=HEAD";,
-"rest/readme.mailinglist_rules" => 
"http://git.php.net/?p=php-src.git;a=blob_plain;f=README.MAILINGLIST_RULES;hb=HEAD";,
-"rest/readme.git-rules" => 
"http://git.php.net/?p=php-src.git;a=blob_plain;f=README.GIT-RULES;hb=HEAD";,
-"rest/coding_standards" => 
"http://git.php.net/?p=php-src.git;a=blob_plain;f=CODING_STANDARDS;hb=HEAD";,
 "spec"=> "https://github.com/php/php-langspec";,
 "sunglasses"  => "https://www.youtube.com/watch?v=dQw4w9WgXcQ";, // 
Temporary easter egg for bug#66144
 );


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] New syntax proposal (type hinting)

2019-03-23 Thread Peter Kokot
Hello,

On Sat, 23 Mar 2019 at 19:45, dj.drezyna  wrote:
>
> I wish have opportunity to set types not only like:   function a(): string {} 
>  or  function b(): ?string {}   but also as:  function c(): string | int {}  
> or  function d(): ?string | ?array {}// all of them should mark that null is 
> accepted.   Similar thing is I suppose is in catch{} clause.   Of course not 
> only return types can affected but also types in args.   And sometime we can 
> think about types of properties and variables however this is rather long 
> distance future.   So the first part of this message is could be done in the 
> near future?

Can you please forward this email to the internals mailing list
instead: intern...@lists.php.net

Thanks... This mailing list is about *.php.net websites.

-- 
Peter Kokot

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Fixed PHP Russia logo: images/news/php_russia_2019.png

2019-03-13 Thread Peter Kokot
Commit:d5fddc4df899515c6dc35c7eab08c06cfe1e2395
Author:Alexander Makarov  Wed, 13 Mar 2019 
14:18:40 +0300
Committer: Peter Kokot   Wed, 13 Mar 2019 20:24:19 
+0100
Parents:   97d8b37332604338a5fef54cdb833852882030ce
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=d5fddc4df899515c6dc35c7eab08c06cfe1e2395

Log:
Fixed PHP Russia logo

Changed paths:
  M  images/news/php_russia_2019.png


Diff:
diff --git a/images/news/php_russia_2019.png b/images/news/php_russia_2019.png
index 2b2e736..7a059af 100644
Binary files a/images/news/php_russia_2019.png and 
b/images/news/php_russia_2019.png differ


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Added PHPerKaigi 2019: archive/archive.xml archive/entries/2019-03-13-1.xml images/news/phperkaigi-2019.png

2019-03-13 Thread Peter Kokot
Commit:97d8b37332604338a5fef54cdb833852882030ce
Author:Jun_Watanabe  Wed, 13 Mar 
2019 17:07:48 +0900
Parents:   f68f0093156c61ffb1f90581f129e57564a9fc1c
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=97d8b37332604338a5fef54cdb833852882030ce

Log:
Added PHPerKaigi 2019

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-03-13-1.xml
  A  images/news/phperkaigi-2019.png


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index a13ab9a..53295e4 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-03-13-1.xml b/archive/entries/2019-03-13-1.xml
new file mode 100644
index 000..ce68948
--- /dev/null
+++ b/archive/entries/2019-03-13-1.xml
@@ -0,0 +1,29 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  PHPerKaigi 2019
+  http://php.net/archive/2019.php#id2019-03-13-1
+  2019-03-13T08:01:54+00:00
+  2019-03-13T08:01:54+00:00
+  http://php.net/ns/news";>2019-03-29
+  
+  http://php.net/conferences/index.php#id2019-03-13-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://phperkaigi.jp/2019/"; 
title="phperkaigi-2019-logo">phperkaigi-2019.png
+  https://phperkaigi.jp/2019/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ PHPerKaigi 2019, Nerima, Tokyo, Japan.
+ 
+ PHPerKaigi is conference for all of the PHPer, that who using php now 
on, who used php in purpose, who want to use in future, and who like php. In 
this we sharing know-how to php and "#love" to it.
+ 
+ The conference consist of talk sessions by public speakers. In 
addition to We have  "Interactive Round Table" discuss specific themes, 
unconference, social gathering and so on for all of developers from all from 
Japan. Let's talking about PHP!
+ 
+ Follow us on twitter https://twitter.com/phperkaigi";>@phperkaigi, https://twitter.com/search?q=%23phperkaigi";>#phperkaigi.
+ 
+ Note:
+ 
+ *Kaigi* means meeting in Japanese.
+ 
+ *PHPer* means PHP lovers.
+
+  
+
diff --git a/images/news/phperkaigi-2019.png b/images/news/phperkaigi-2019.png
new file mode 100644
index 000..dbb5009
Binary files /dev/null and b/images/news/phperkaigi-2019.png differ


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Announce Bulgaria PHP Conference 2019 CFP: archive/archive.xml archive/entries/2019-03-12-3.xml

2019-03-12 Thread Peter Kokot
Commit:f68f0093156c61ffb1f90581f129e57564a9fc1c
Author:Milko Kosturkov  Sun, 10 Mar 2019 
10:36:56 +0200
Committer: Peter Kokot   Tue, 12 Mar 2019 23:36:34 
+0100
Parents:   a5f6cf86727152a72383036df9473ca7b8336c4e
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=f68f0093156c61ffb1f90581f129e57564a9fc1c

Log:
Announce Bulgaria PHP Conference 2019 CFP

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-03-12-3.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index e3012ca..a13ab9a 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-03-12-3.xml b/archive/entries/2019-03-12-3.xml
new file mode 100644
index 000..17cf1ec
--- /dev/null
+++ b/archive/entries/2019-03-12-3.xml
@@ -0,0 +1,32 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Bulgaria PHP Conference 2019
+  http://php.net/archive/2019.php#id2019-03-12-3
+  2019-03-10T10:32:05+02:00
+  2019-03-10T10:32:05+02:00
+  http://php.net/ns/news";>2019-05-08
+  
+  http://php.net/conferences/index.php#id2019-03-12-3"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://www.bgphp.org/"; title="Bulgaria PHP Conference 
2019">bgphp-logo-dark-350.png
+  https://www.bgphp.org/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ We are proud to announce the return of Bulgaria PHP Conference!
+ 
+ The 2019 edition will take place from the 8th to the 
10th of November
+ in the emblematic National Palace of Culture in the heart of Sofia, 
Bulgaria.
+ The conference will consist of a training day and two conference days 
with two tracks,
+ an unConf, a great theme, an awesome party, exquisite food and lot's 
of beer (we take fun really seriously on the Balkans).
+ 
+
+  
+ Follow us on twitter https://twitter.com/bgphpconf";>@bgphpconf, on https://www.bgphp.org/";>www.bgphp.org and on our Facebook page https://www.facebook.com/Bulgaria-PHP-Conference-792916594079571";>https://www.facebook.com/Bulgaria-PHP-Conference-792916594079571
 for more news!
+ 
+
+  
+ Our Call for Papers is now 
open, so, please, do apply and see you in November in Bulgaria!
+ 
+
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Added PHP Russia conference: archive/archive.xml archive/entries/2019-03-12-2.xml images/news/php_russia_2019.png

2019-03-12 Thread Peter Kokot
Commit:a5f6cf86727152a72383036df9473ca7b8336c4e
Author:Alexander Makarov  Tue, 12 Mar 2019 
20:21:01 +0300
Committer: Peter Kokot   Tue, 12 Mar 2019 23:23:41 
+0100
Parents:   5770a34175a71ce59ec8bdf2e3249be0ea4d11e6
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=a5f6cf86727152a72383036df9473ca7b8336c4e

Log:
Added PHP Russia conference

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-03-12-2.xml
  A  images/news/php_russia_2019.png


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index 1bedd46..e3012ca 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-03-12-2.xml b/archive/entries/2019-03-12-2.xml
new file mode 100644
index 000..3852636
--- /dev/null
+++ b/archive/entries/2019-03-12-2.xml
@@ -0,0 +1,24 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  PHP Russia 2019
+  http://php.net/archive/2019.php#id2019-03-12-2
+  2019-03-12T16:51:35+00:00
+  2019-03-12T16:51:35+00:00
+  http://php.net/ns/news";>2019-05-17
+  
+  http://php.net/conferences/index.php#id2019-03-12-2"; 
rel="alternate" type="text/html"/>
+
+  http://php.net/ns/news"; 
link="https://cfp.phprussia.ru/"; title="PHP 
Russia">php_russia_2019.png
+  https://cfp.phprussia.ru/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+  PHP Russia is the only Russian confenrence focused on PHP. It will be 
held in Moscow Main topics are PHP ecosytem (PHP itself, standards, frameworks, 
libraries and OpenSource) and major players experience in building complex 
projects using best practices and modern approaches.
+
+  We expect 500+ attendees and 20+ speakers!
+
+  Our audience consists of applications developers, API developers, 
CTO’s, CEO’s, fullstack developers, etc.
+
+  The program is designed by the developer community, representatives 
of large companies from Runet and around the world, and by tech developers and 
community activists. The selection of talks is multi-layered and complex — the 
Program Committee selects the best talks from the received applications 
unanimously according to several criterias.
+
+  
+
diff --git a/images/news/php_russia_2019.png b/images/news/php_russia_2019.png
new file mode 100644
index 000..2b2e736
Binary files /dev/null and b/images/news/php_russia_2019.png differ


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Web Summer Camp announcement: archive/archive.xml archive/entries/2019-03-12-1.xml

2019-03-12 Thread Peter Kokot
Commit:5770a34175a71ce59ec8bdf2e3249be0ea4d11e6
Author:Ivo Lukac  Tue, 12 Mar 2019 12:55:33 +0100
Committer: Peter Kokot   Tue, 12 Mar 2019 23:17:29 
+0100
Parents:   6e5057d2518a158d509eda3b7158fa706b321062
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=5770a34175a71ce59ec8bdf2e3249be0ea4d11e6

Log:
Web Summer Camp announcement

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-03-12-1.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index a7c2594..1bedd46 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-03-12-1.xml b/archive/entries/2019-03-12-1.xml
new file mode 100644
index 000..bab7134
--- /dev/null
+++ b/archive/entries/2019-03-12-1.xml
@@ -0,0 +1,25 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Web Summer Camp 2019
+  http://php.net/archive/2019.php#id2019-03-12-1
+  2019-03-12T11:48:51+00:00
+  2019-03-12T11:48:51+00:00
+  http://php.net/ns/news";>2019-08-28
+  
+  http://php.net/conferences/index.php#id2019-03-12-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="http://websummercamp.com"; title="Web Summer Camp 
logo">wsc.png
+  http://websummercamp.com"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ With days getting longer and our jackets lighter, we start to look 
forward to meeting you all once again in Rovinj. For the 8th time in a row, we 
are organizing our https://2019.websummercamp.com/";>learn & fun 
summer event. Mark your calendar for August 28th - 30th and join us in 
beautiful Rovinj.
+
+ This year you can expect hands-on and engaging workshops related to 
PHP, Symfony, Javascript and Project Management, as well as fun 
and relaxing after-workshop programme for attendees and their companions.
+
+ If you feel your workshop could add value to the event, we encourage you 
to https://sessionize.com/web-summer-camp-2019/";>submit your 
proposal by April 30th. All the information on this year's topics of our 
interest you can find https://2019.websummercamp.com/call-for-papers";>here.
+
+ And while waiting for Early Bird tickets sale to start, here is a short 
reminder on https://www.netgenlabs.com/Blog/Why-Web-Summer-Camp-of-all-events";>Why 
Web Summer Camp of all events.
+
+ Summer is coming, follow us on https://twitter.com/websummercamp";>@websummercamp and stay tuned!
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: added laracon eu conferences: archive/archive.xml archive/entries/2019-03-11-1.xml archive/entries/2019-03-11-2.xml images/news/laracon-logo.png

2019-03-12 Thread Peter Kokot
Commit:6e5057d2518a158d509eda3b7158fa706b321062
Author:Jeroen Gerits  Mon, 11 Mar 2019 
18:31:32 +0100
Committer: Peter Kokot   Tue, 12 Mar 2019 11:31:54 
+0100
Parents:   5361ac5cd6e1fdc86c6da5d87d7749cf5f4ab71f
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=6e5057d2518a158d509eda3b7158fa706b321062

Log:
added laracon eu conferences

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-03-11-1.xml
  A  archive/entries/2019-03-11-2.xml
  A  images/news/laracon-logo.png


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index 1b4e26a..a7c2594 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,8 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
+  
   
   
   
diff --git a/archive/entries/2019-03-11-1.xml b/archive/entries/2019-03-11-1.xml
new file mode 100644
index 000..9dd176d
--- /dev/null
+++ b/archive/entries/2019-03-11-1.xml
@@ -0,0 +1,17 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Laracon EU 2019 Amsterdam
+  http://php.net/archive/2019.php#id2019-03-11-1
+  2019-03-11T17:26:39+00:00
+  2019-03-11T17:26:39+00:00
+  http://php.net/ns/news";>2019-08-28
+  
+  http://php.net/conferences/index.php#id2019-03-11-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://laracon.eu/2019/"; title="Laracon 
Logo">laracon-logo.png
+  https://laracon.eu/2019/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ Amsterdam is hosting the flagship Laracon EU event from August 28th-30th. 
This years Laracon EU brings a full-day of training workshops (Aug 28) and a 
new format for two days of talks and more.
+
+  
+
diff --git a/archive/entries/2019-03-11-2.xml b/archive/entries/2019-03-11-2.xml
new file mode 100644
index 000..030c28a
--- /dev/null
+++ b/archive/entries/2019-03-11-2.xml
@@ -0,0 +1,17 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Laracon EU 2019 Madrid
+  http://php.net/archive/2019.php#id2019-03-11-2
+  2019-03-11T17:28:17+00:00
+  2019-03-11T17:28:17+00:00
+  http://php.net/ns/news";>2019-05-23
+  
+  http://php.net/conferences/index.php#id2019-03-11-2"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://laracon.eu/2019/"; title="Laracon 
logo">laracon-logo.png
+  https://laracon.eu/2019/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ We re bringing Laracon EU to Madrid on May 23rd for a new one-day event. 
Join speakers Adam Wathan, Matt Stauffer, and many more for a brain-crunching 
day of talks and community celebration.
+
+  
+
diff --git a/images/news/laracon-logo.png b/images/news/laracon-logo.png
new file mode 100644
index 000..3c2d9d8
Binary files /dev/null and b/images/news/laracon-logo.png differ


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Add "Bulgaria PHP Conference 2019" to conferences announcments: archive/archive.xml archive/entries/2019-03-03-1.xml images/news/bgphp-logo-dark-350.png

2019-03-03 Thread Peter Kokot
Commit:a37731ae8bec823446966b251584c67c28912baa
Author:Milko Kosturkov  Sun, 3 Mar 2019 
14:08:05 +0200
Parents:   10d8705cbeaee048af83db9516067419d7fb197c
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=a37731ae8bec823446966b251584c67c28912baa

Log:
Add "Bulgaria PHP Conference 2019" to conferences announcments

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-03-03-1.xml
  A  images/news/bgphp-logo-dark-350.png


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index 149da8d..6df157d 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-03-03-1.xml b/archive/entries/2019-03-03-1.xml
new file mode 100644
index 000..bd20475
--- /dev/null
+++ b/archive/entries/2019-03-03-1.xml
@@ -0,0 +1,25 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Bulgaria PHP Conference 2019
+  http://php.net/archive/2019.php#id2019-03-03-1
+  2019-03-03T13:37:07+02:00
+  2019-03-03T13:37:07+02:00
+  http://php.net/ns/news";>2019-11-08
+  
+  http://php.net/conferences/index.php#id2019-03-03-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://www.bgphp.org/"; title="Bulgaria PHP Conference 
2019">bgphp-logo-dark-350.png
+  https://www.bgphp.org/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ We are proud to announce the return of Bulgaria PHP Conference!
+ The 2019 edition will take place from the 8th to the 10th of November
+ in the emblematic National Palace of Culture in the heart of Sofia, 
Bulgaria.
+ The conference will consist of a training day and two conference days 
with two tracks,
+ an unConf, a great theme, an awesome party, exquisite food and lot's of 
beer (we take fun really seriously on the Balkans).
+ 
+ Follow us on twitter https://twitter.com/bgphpconf";>@bgphpconf, on https://www.bgphp.org/";>www.bgphp.org and on our Facebook page https://www.facebook.com/Bulgaria-PHP-Conference-792916594079571";>https://www.facebook.com/Bulgaria-PHP-Conference-792916594079571
 for more news!
+ 
+ Our Call for Papers will start on the 8th of March, so, please, do 
apply and see you in November in Bulgaria!
+
+  
+
diff --git a/images/news/bgphp-logo-dark-350.png 
b/images/news/bgphp-logo-dark-350.png
new file mode 100644
index 000..23e4387
Binary files /dev/null and b/images/news/bgphp-logo-dark-350.png differ


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Remove PHP 5.6 from "Common searches" list: www/index.php

2019-02-14 Thread Peter Kokot
Commit:7e3870ef1573374f55db5204bf968274f75e1ad0
Author:Gabriel Caruso  Sun, 10 Feb 2019 
19:53:59 -0200
Committer: Peter Kokot   Fri, 15 Feb 2019 02:40:01 
+0100
Parents:   5cd2630a86cd4feaacdd1353f246b234dfe75dc1
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=7e3870ef1573374f55db5204bf968274f75e1ad0

Log:
Remove PHP 5.6 from "Common searches" list

Changed paths:
  M  www/index.php


Diff:
diff --git a/www/index.php b/www/index.php
index 34b69c9..f53b7b6 100644
--- a/www/index.php
+++ b/www/index.php
@@ -47,7 +47,6 @@ if ('/random' === $_SERVER['REQUEST_URI']) {
 $searches = [
 'Most recent open bugs (all)' => '&bug_type=All',
 'Most recent open bugs (all) with patch or pull request' => 
'&bug_type=All&patch=Y&pull=Y',
-'Most recent open bugs (PHP 5.6)' => '&bug_type=All&phpver=5.6',
 'Most recent open bugs (PHP 7.1)' => '&bug_type=All&phpver=7.1',
 'Most recent open bugs (PHP 7.2)' => '&bug_type=All&phpver=7.2',
 'Most recent open bugs (PHP 7.3)' => '&bug_type=All&phpver=7.3',


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Longhorn PHP 2019 Schedule Announcement: archive/archive.xml archive/entries/2019-02-14-1.xml

2019-02-14 Thread Peter Kokot
Commit:a2f28cc2f3b52e1eb0be78b965f1d74a505d2570
Author:Jessica Mauerhan  Thu, 14 Feb 
2019 09:11:04 -0600
Parents:   89b82729c4e1e57945a713e8177a25517175c1d3
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=a2f28cc2f3b52e1eb0be78b965f1d74a505d2570

Log:
Longhorn PHP 2019 Schedule Announcement

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-02-14-1.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index 8f25df0..149da8d 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-02-14-1.xml b/archive/entries/2019-02-14-1.xml
new file mode 100644
index 000..a26f6a5
--- /dev/null
+++ b/archive/entries/2019-02-14-1.xml
@@ -0,0 +1,25 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Longhorn PHP 2019 Schedule
+  http://php.net/archive/2019.php#id2019-02-14-1
+  2019-02-14T15:03:51+00:00
+  2019-02-14T15:03:51+00:00
+  http://php.net/ns/news";>2019-02-14
+  
+  http://php.net/conferences/index.php#id2019-02-14-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://www.longhornphp.com/"; title="Longhorn PHP 
2019">longhornphp.png
+  https://www.longhornphp.com/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ The Longhorn PHP Schedule has been announced - we have an amazing list of 
speakers this year, you won't want to miss it! 
+
+At Longhorn PHP you'll get to learn from and alongside a diverse group of 
developers from all over the region, country, and even the globe. The 
conference will consist of a tutorial day with in-depth workshops, followed by 
two main conference days with multiple tracks of traditional 1 hour sessions, 
and new 30 minute sessions! Register now to take the next step toward leveling 
up your development career!
+ 
+ Early Bird Tickets are on sale until March 15, 2019, so get yours now 
before the price increases!
+ 
+ Dates: May 2nd-4th, 2019  
+
+Website: https://www.longhornphp.com
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] bugs.php.net - PHP version selection

2019-02-10 Thread Peter Kokot
Hello,

This was brought by the pull request to include PHP 7.4 branch and to
remove the old one:
https://github.com/php/web-bugs/pull/74

Couple of questions about PHP versions selection when reporting a bug:
https://bugs.php.net/report.php

Q1: Currently, there are listed also the so called "snaps" which were
once used via snaps.php.net. Today this is not working anymore.
However, there are Windows snapshots. So, are the snaps still relevant
in the version selection when reporting a bug?

Q2: What I'm currently thinking of is to refactor this particular
element to something like this (notice the PHP version selection box):
https://petk.github.io/testing/bugs.php.net/report-bug-2.html
A small step but probably helpful a bit. Even if the site redesign
will be done in the future. Maybe any thoughts here?

Thank you.

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] Add installtion instruction

2019-02-09 Thread Peter Kokot
Hello,

On Sat, 9 Feb 2019 at 18:56, azjezz  wrote:
>
> Today i bought a VPS so i can host the mockups for people to see instead of 
> just looking at the screenshots.

GitHub pages can do that also fine. And they are simpler to use for
the case of mockups maybe. Only thing is to learn and understand
Jekyll themes and the Liquid template engine. Deployment and stability
works like a charm. Or even better one - Sculpin generator (works in
PHP, Twig templating engine, generates static files) [1].

> Another question i have in mind is, after migrating to GIT, is there any plan 
> to switch to markdown instead of XML ? this would be a really great step for 
> the PHP.net website, as we can host the documentation using GitHub Pages 
> without having to worry about deployment etc. and we would just need to make 
> a theme for Jeklly.

To get a better overview, this is the PHP manual in XML sources (a
mirror, not for pull requests) [2].

Migrating the PHP manual sources to Markdown would take a very very
long time (I estimate it in several years). Markdown works ok for
smaller documentations. Where not so many references, links,
additional plugins are required. Markdown has options via custom or
3rd party parsers to make it work a bit like these Sphinx, AsciiDoc
and similar generators. One of the good examples is Pandoc. However,
here I would leave the final decisions to move from XML to something
else to other people who are more suitable and who know what this
means. It is a very big step. Too big for only the website remake
"task". Hosting on GitHub pages - I'm not sure this is something for
PHP.net manual... There is also some dynamics happening there, but
don't take me for granted on this part...

> in the next few days i will host the mock ups, and start writing more about 
> PHP installation in different systems and add the `compile from source` 
> section.
>
> as people would expect something like `apt install php` ( or similar command 
> on other OSs ) when trying to install php and get started, not "download a 
> compiler , x and y libraries then try to compile it"

Important to understand in this concept is also, that a proper
installation chapter wouldn't discriminate against an Alpine Linux. Or
some FreeBSD. Or Fedora based distributions which don't use apt
package management. Can this be done via patches to existing
documentation first maybe or do you think that the docs format need to
be adjusted somehow for this?

We probably would need to define some frames what we'll be doing here
and what even needs to be done in approximate phases. I'm not sure
what would be the best way to go here yet. More later on...

Have a nice day...

[1] https://sculpin.io/
[2] https://github.com/salathe/phpdoc-en

-- 
Peter Kokot

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] Add installtion instruction

2019-02-09 Thread Peter Kokot
Hello,

On Wed, 6 Feb 2019 at 14:17, azjezz  wrote:
>
> Good afternoon.
>
> as some of you may know, i am currently working on a new design for the 
> php.net website and i came across the installation page[1].
>
> the page contains information about "how to compile php from source" but no 
> "how to install it" and i think this is not a good for newbies.
>
> when i started PHP as a kid, i remember using XMAPP on windows, not because i 
> needed Apache or MySQL, but because the PHP site kept telling me that i need 
> `C runtime`, `VC CRT11` and then i should compile the source code and i 
> didn't know how to do that at the time and everything seemed just complicated.
>
> for this, i suggest that w add a new "installation instructions" to the php 
> website, and move the current pages to a new section called "compile from 
> source".
>
> i have added installation instruction page in the mock ups of the new design, 
> you might take a look at it here : 
> https://github.com/azjezz/web-php-mock-ups/blob/master/screenshots/windows-installation.png
>
> [1] :  https://secure.php.net/manual/en/install.php

The mockups in general looks great. Installation chapter itself is in
need of major refactoring for sure. Some things are not relevant
anymore and many are missing. Basically, what you're after in this
step is the way to go probably - to mention more options how to get up
and running fast. This probably needs to be synced with the options in
the manual or if a separate docs for only installation should be done
here. PHP installation itself is a very large topic. Compilation from
source is part of the PHP installation chapter. Also installing PHP on
Solaris, for example is also relevant. Goal of PHP is to be used on
any system, even Android and exotic things such as micro controllers.
How that works in practice at the moment, is another topic but for an
overview maybe.

Few quick tips:
- There is a migration to Git from SVN happening for the PHP manual.
Yes, the PHP manual is still in SVN at the moment. It is built from
the sources in XML files. Doing some major functionality changes to
the manual means also syncing things with this part and how the manual
is generated.
- There was a discussion happening about PHP.net mirrors getting
removed so that's one of the major things to be done probably with the
php.net site before other steps maybe. Mirrors at the moment block the
https migration and usage and upgrading the website code to PHP
7.2/7.3. There is still PHP 5.3 used. And mirrors mean 80+ webservers.

-- 
Peter Kokot

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Bump copyright year to 2019: license/3_01.txt

2019-02-08 Thread Peter Kokot
Commit:89b82729c4e1e57945a713e8177a25517175c1d3
Author:Peter Kokot  Fri, 8 Feb 2019 23:29:05 
+0100
Parents:   0e222e9b1837374bf2c18351f898d650cf38af63
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=89b82729c4e1e57945a713e8177a25517175c1d3

Log:
Bump copyright year to 2019

Changed paths:
  M  license/3_01.txt


Diff:
diff --git a/license/3_01.txt b/license/3_01.txt
index 5a37708..4076fe9 100644
--- a/license/3_01.txt
+++ b/license/3_01.txt
@@ -1,6 +1,6 @@
 
   The PHP License, version 3.01
-Copyright (c) 1999 - 2018 The PHP Group. All rights reserved.
+Copyright (c) 1999 - 2019 The PHP Group. All rights reserved.
 
 
 Redistribution and use in source and binary forms, with or without


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Fix ID: archive/entries/2019-02-07-3.xml

2019-02-07 Thread Peter Kokot
Commit:0e222e9b1837374bf2c18351f898d650cf38af63
Author:Peter Kokot  Fri, 8 Feb 2019 01:00:07 
+0100
Parents:   c4b902b10bec02af62c8e6f2b13e41a448a32002
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=0e222e9b1837374bf2c18351f898d650cf38af63

Log:
Fix ID

Changed paths:
  M  archive/entries/2019-02-07-3.xml


Diff:
diff --git a/archive/entries/2019-02-07-3.xml b/archive/entries/2019-02-07-3.xml
index d8fedc7..71bcafa 100644
--- a/archive/entries/2019-02-07-3.xml
+++ b/archive/entries/2019-02-07-3.xml
@@ -1,7 +1,7 @@
 
 http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
   PHP.Barcelona 2019
-  http://php.net/archive/2019.php#id2019-02-07-1
+  http://php.net/archive/2019.php#id2019-02-07-3
   2019-02-07T15:22:17+00:00
   2019-02-07T15:22:17+00:00
   http://php.net/ns/news";>2019-11-12


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Add PHP.Barcelona 2019 to the conferences list: archive/archive.xml archive/entries/2019-02-07-3.xml images/news/php.barcelona.png

2019-02-07 Thread Peter Kokot
Commit:c4b902b10bec02af62c8e6f2b13e41a448a32002
Author:tλeUniC  Fri, 8 Feb 2019 00:57:44 +0100
Committer: Peter Kokot   Fri, 8 Feb 2019 00:57:44 
+0100
Parents:   17f3a45357b048c22093ee07fff9355245c14f40
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=c4b902b10bec02af62c8e6f2b13e41a448a32002

Log:
Add PHP.Barcelona 2019 to the conferences list

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-02-07-3.xml
  A  images/news/php.barcelona.png


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index 840c60e..8f25df0 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-02-07-3.xml b/archive/entries/2019-02-07-3.xml
new file mode 100644
index 000..d8fedc7
--- /dev/null
+++ b/archive/entries/2019-02-07-3.xml
@@ -0,0 +1,18 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  PHP.Barcelona 2019
+  http://php.net/archive/2019.php#id2019-02-07-1
+  2019-02-07T15:22:17+00:00
+  2019-02-07T15:22:17+00:00
+  http://php.net/ns/news";>2019-11-12
+  
+  http://php.net/conferences/index.php#id2019-02-07-3"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://php.barcelona/"; title="PHP.Barcelona 
2019">php.barcelona.png
+  https://php.barcelona/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ What an incredible 2018 and 2019 for the PHP community! Part of the 
PHP Core Team that was working for Zend left. Some found excellent companies 
and they are rocking most than ever, like Nikita at JetBrains. PHP 7.4 is about 
to be released, and PHP 8 has been branched. Lavarel and Symfony have healthy 
growth. JIT is part of the imminent future, and I/O non-blocking frameworks are 
getting more often adopted in production.
+ We've crafted the best PHP conference possible just for you. To allow 
you to see the future and get ready before nobody else. You'll gather top-notch 
speakers and an awesome community eager to share a lot of knowledge. All of 
this will take place in the very center of the gorgeous city of Barcelona in an 
excellent venue. What are you waiting for? Go get your tickets https://php.barcelona/tickets"; target="_blank">here!
+
+  
+
diff --git a/images/news/php.barcelona.png b/images/news/php.barcelona.png
new file mode 100644
index 000..954f394
Binary files /dev/null and b/images/news/php.barcelona.png differ


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: Add Midwest PHP 2019 to Conferences: archive/archive.xml archive/entries/2019-02-06-1.xml

2019-02-07 Thread Peter Kokot
Commit:17f3a45357b048c22093ee07fff9355245c14f40
Author:Mike Willbanks  Wed, 6 Feb 2019 05:26:13 
-0600
Committer: Peter Kokot   Fri, 8 Feb 2019 00:40:00 
+0100
Parents:   7cc1006cf21fd65945e8a3b48f309fa290f178a6
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=17f3a45357b048c22093ee07fff9355245c14f40

Log:
Add Midwest PHP 2019 to Conferences

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-02-06-1.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index abbde46..840c60e 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -11,6 +11,7 @@
   
   
   
+  
   
   
   
diff --git a/archive/entries/2019-02-06-1.xml b/archive/entries/2019-02-06-1.xml
new file mode 100644
index 000..d574afb
--- /dev/null
+++ b/archive/entries/2019-02-06-1.xml
@@ -0,0 +1,18 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Midwest PHP 2019
+  http://php.net/archive/2019.php#id2019-02-06-1
+  2019-02-06T11:22:01+00:00
+  2019-02-06T11:22:01+00:00
+  http://php.net/ns/news";>2019-03-08
+  
+  http://php.net/conferences/index.php#id2019-02-06-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://2019.midwestphp.org"; title="Midwest PHP 
Conference">midwest-php-logo.png
+  https://2019.midwestphp.org"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+  The Midwest PHP Conference is hosted by the Minnesota PHP User Group 
community through the North Foundation in Bloomington, Minnesota from March 8th 
- 9th, 2019. This is our seventh year and each year the conference continues to 
become better. Our goal is to share best practices, ideas, and techniques about 
building state-of-the-art software applications.
+  The conference is at the Radisson Blu Mall of America in Bloomington, 
Minnesota. We can't think of a better place to connect with friends, old and 
new, than in a relaxed environment with entertainment at your front door, and 
inspiring talks from people doing amazing things.
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] Re: [PHP-DEV] 回复: [PHP-DEV] New website for the PHP project

2019-02-05 Thread Peter Kokot
Hello,

On Wed, 6 Feb 2019 at 01:37, 苏晞 <2823324...@qq.com> wrote:
>
> What the hell are you fucking talk about ,beaches -- 原始邮件 
> --

If I'd run this mailing list, you'd get a several weeks to months mute
now. But luckily that's not the case.

Read the mailing list rules [1] please. The tone and the quality of it
that is sent to these public channels is what makes the discussion
atmosphere and also younger generations learn from such low quality
responses. Keep this in your mind before sending emails or messages.

Thank you.

[1] https://github.com/php/php-src/blob/master/README.MAILINGLIST_RULES

-- 
Peter Kokot

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] Re: [PHP-DEV] New website for the PHP project

2019-02-03 Thread Peter Kokot
re with some advices and all.

>From what I've learned so far with the PHP sites: The websites overall
are very different from one another and some are actually very
complex. The pecl.php.net, bugs.php.net, and the main php.net site are
probably the most complex ones and all written in PHP vanilla way.
After long discussions (regarding the bugs.php.net site), pecl and
bugs sites now include optional Composer for local installation of
some dependencies such as PHPunit, generating fixtures, etc. (not on
production but for local development). So, they are actually going in
the direction of a more modern development. There are also some parts
of php sites that aren't available on GitHub and can't be properly
collaborated on yet (request to make a GH mirror has been submitted).

PECL and bugs sites have received quite a few, very strategic and
future prone changes recently with such step in mind also but it's a
long way to go. Not using some PHP framework for a reason of not
endorsing a framework is actually a really big challenge, but I guess
so it should be and we need to reinvent some required parts on the way
to make this happen. Deployment+production need also some refreshments
but it's a very challenging step from what I understand. For example,
to have this up and running, doing a remake, and doing systems
improvements at the same time.

Few quick suggestions:
- Let's keep the approximate wireframes of the websites as are.
- Let's make a central place for this discussion i.e. the webmaster mailing list
- Let's avoid too big tasks that require a fork + branch checkout +
tons of very difficult and time consuming design/infrastructure/app
changes and then opening a discussion on the webmaster mailing list to
even start considering it. We need to start giving hints and make
decisions before that step if this can be done on time.
- *.php.net sites under one roof maybe sound useful but separate
"services" (as is now) is IMHO a better way into this probably because
different servers, databases, usage cases are present. If one site
fails, others still work (in many cases). Many *.php.net sites
otherwise also use a common repository for a theme [1]. And some are
just too different with established practices.
- https://php.net/community is in my opinion a bit problematic concept
for PHP. PHP can trust its community and ecosystem around it. Mailing
lists, bugs, GitHub and such places work quite ok, but infrastructure
behind probably need a boost.


[1] https://github.com/php/web-shared



--
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: add JestPHP Conference: archive/archive.xml archive/entries/2019-02-01-1.xml images/news/jest-php-logo.png

2019-02-03 Thread Peter Kokot
Commit:19c130b10cdcfb7bc1ced880f339db225be7481f
Author:Gordon Forsythe  Fri, 1 Feb 2019 
12:07:30 -0700
Parents:   a8d2fc94b278f870730c17a1123329e7f625
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=19c130b10cdcfb7bc1ced880f339db225be7481f

Log:
add JestPHP Conference

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-02-01-1.xml
  A  images/news/jest-php-logo.png


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index b7a3e4d..d2fe1a7 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-02-01-1.xml b/archive/entries/2019-02-01-1.xml
new file mode 100644
index 000..8134d70
--- /dev/null
+++ b/archive/entries/2019-02-01-1.xml
@@ -0,0 +1,17 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  JestPHP Conference - February 22nd 2019, Mesa Arizona
+  http://php.net/archive/2019.php#id2019-02-01-1
+  2019-02-01T18:59:28+00:00
+  2019-02-01T18:59:28+00:00
+  http://php.net/ns/news";>2018-12-01
+  
+  http://php.net/conferences/index.php#id2019-02-01-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://jestphp.com/"; title="JestPHP 
Logo">jest-php-logo.png
+  https://jestphp.com/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+ JestPHP is a 1-day, 1-track, affordable, community conference for PHP 
developers in Arizona and beyond. Join us for a day of learning and laughter 
that you will not forget.
+
+  
+
diff --git a/images/news/jest-php-logo.png b/images/news/jest-php-logo.png
new file mode 100644
index 000..baa073b
Binary files /dev/null and b/images/news/jest-php-logo.png differ


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Add dependency injection container: README.md config/container.php config/parameters.php docs/README.md docs/container.md docs/templates.md include/prepend.php include/qu

2019-01-27 Thread Peter Kokot
Commit:5cd2630a86cd4feaacdd1353f246b234dfe75dc1
Author:Peter Kokot  Mon, 24 Dec 2018 03:58:58 
+0100
Parents:   102df8157547bb44eeba9e10e646ed0b6ccb48f7
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=5cd2630a86cd4feaacdd1353f246b234dfe75dc1

Log:
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.

Changed paths:
  M  README.md
  A  config/container.php
  A  config/parameters.php
  M  docs/README.md
  A  docs/container.md
  M  docs/templates.md
  M  include/prepend.php
  M  include/query.php
  M  scripts/cron/email-assigned
  M  scripts/cron/no-feedback
  A  src/Container/Container.php
  A  src/Container/ContainerInterface.php
  A  src/Container/Exception/ContainerException.php
  A  src/Container/Exception/ContainerExceptionInterface.php
  A  src/Container/Exception/EntryNotFoundException.php
  A  src/Container/Exception/NotFoundExceptionInterface.php
  M  src/Repository/PatchRepository.php
  M  src/Utils/PatchTracker.php
  A  tests/Container/ContainerTest.php
  A  tests/Container/MockDependency.php
  A  tests/Container/MockService.php
  M  www/admin/index.php
  M  www/api.php
  M  www/bug-pwd-finder.php
  M  www/bug.php
  M  www/fix.php
  M  www/gh-pull-add.php
  M  www/index.php
  M  www/lstats.php
  M  www/patch-add.php
  M  www/patch-display.php
  M  www/quick-fix-desc.php
  M  www/report.php
  M  www/rpc.php
  M  www/rss/bug.php
  M  www/stats.php
  M  www/vote.php

diff --git a/README.md b/README.md
index 275f64d..d3421a2 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ Source code of this application is structured in the 
following directories:
 ```bash
 /
  ├─ .git/   # Git configuration and source directory
+ ├─ config/ # Application configuration parameters, services...
  ├─ docs/   # Application documentation
  └─ include/# Application helper functions and configuration
 ├─ prepend.php  # Autoloader, DB connection, container, app 
initialization
diff --git a/config/container.php b/config/container.php
new file mode 100644
index 000..5cf2979
--- /dev/null
+++ b/config/container.php
@@ -0,0 +1,84 @@
+set(\PDO::class, function ($c) {
+return new \PDO(
+
'mysql:host='.$c->get('db_host').';dbname='.$c->get('db_name').';charset=utf8',
+$c->get('db_user'),
+$c->get('db_password'),
+[
+\PDO::ATTR_ERRMODE=> \PDO::ERRMODE_EXCEPTION,
+\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
+\PDO::ATTR_EMULATE_PREPARES   => false,
+\PDO::ATTR_STATEMENT_CLASS=> [App\Database\Statement::class],
+]
+);
+});
+
+$container->set(App\Repository\BugRepository::class, function ($c) {
+return new App\Repository\BugRepository($c->get(\PDO::class));
+});
+
+$container->set(App\Repository\CommentRepository::class, function ($c) {
+return new App\Repository\CommentRepository($c->get(\PDO::class));
+});
+
+$container->set(App\Repository\ObsoletePatchRepository::class, function ($c) {
+return new App\Repository\ObsoletePatchRepository($c->get(\PDO::class));
+});
+
+$container->set(App\Repository\PackageRepository::class, function ($c) {
+return new App\Repository\PackageRepository($c->get(\PDO::class));
+});
+
+$container->set(App\Repository\PatchRepository::class, function ($c) {
+return new App\Repository\PatchRepository($c->get(\PDO::class), 
$c->get('uploads_dir'));
+});
+
+$container->set(App\Repository\PullRequestRepository::class, function ($c) {
+return new App\Repository\PullRequestRepository($c->get(\PDO::class));
+});
+
+$container->set(App\Repository\ReasonRepository::class, function ($c) {
+return new App\Repository\ReasonRepository($c->get(\PDO::class));
+});
+
+$container->set(App\Repository\VoteRepository::class, function ($c) {
+return new App\Repository\VoteRepository($c->get(\PDO::class));
+});
+
+$container->set(App\Template\Engine::class, function ($c) {
+return new App\Template\Engine($c->get('templates_dir'));
+});
+
+$container->set(App\Utils\Captcha::class, function ($c) {
+return new App\Utils\Captcha();
+});
+
+$conta

[PHP-WEBMASTER] com web/php: Add laracon online 2019: archive/archive.xml archive/entries/2019-01-22-1.xml

2019-01-25 Thread Peter Kokot
Commit:15acb38183c5afc4a9cdadc2f81f3d2fe165e493
Author:Eric Barnes  Tue, 22 Jan 2019 02:46:27 
+
Committer: Peter Kokot   Sat, 26 Jan 2019 01:33:13 
+0100
Parents:   99662629ba5ecda20fe9648fed47f264933b5acf
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=15acb38183c5afc4a9cdadc2f81f3d2fe165e493

Log:
Add laracon online 2019

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2019-01-22-1.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index 547a609..78202d2 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2019-01-22-1.xml b/archive/entries/2019-01-22-1.xml
new file mode 100644
index 000..b87594b
--- /dev/null
+++ b/archive/entries/2019-01-22-1.xml
@@ -0,0 +1,20 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  Laracon Online
+  http://php.net/archive/2019.php#id2019-01-22-1
+  2019-01-22T02:42:11+00:00
+  2019-01-22T02:42:11+00:00
+  http://php.net/ns/news";>2019-03-06
+  
+  http://php.net/conferences/index.php#id2019-01-22-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/archive/2019.php#id2019-01-22-1"; rel="via" 
type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+https://laracon.net";>Laracon Online is the easiest and 
most affordable way to get the Laracon experience from anywhere in the world. 

+ 
+ We’ve put together a full day of talks featuring some of Laravel’s 
brightest minds, and streaming them directly to your home or office.
+ 
+ These talks are brand new, never before presented at any Laracon and 
tickets are just $12 during early registration. Don't miss the largest Laravel 
event ever!
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Bump Composer dependencies: composer.lock

2019-01-24 Thread Peter Kokot
Commit:102df8157547bb44eeba9e10e646ed0b6ccb48f7
Author:Peter Kokot  Fri, 25 Jan 2019 02:40:54 
+0100
Parents:   e3c4b0ace366b36e0da2bcb7492e8ce643359022
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=102df8157547bb44eeba9e10e646ed0b6ccb48f7

Log:
Bump Composer dependencies

Changed paths:
  M  composer.lock


Diff:
diff --git a/composer.lock b/composer.lock
index 5296c0b..a2bc849 100644
--- a/composer.lock
+++ b/composer.lock
@@ -680,16 +680,16 @@
 },
 {
 "name": "phpunit/phpunit",
-"version": "7.5.1",
+"version": "7.5.2",
 "source": {
 "type": "git",
 "url": "https://github.com/sebastianbergmann/phpunit.git";,
-"reference": "c23d78776ad415d5506e0679723cb461d71f488f"
+"reference": "7c89093bd00f7d5ddf0ab81dee04f801416b4944"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c23d78776ad415d5506e0679723cb461d71f488f";,
-"reference": "c23d78776ad415d5506e0679723cb461d71f488f",
+"url": 
"https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7c89093bd00f7d5ddf0ab81dee04f801416b4944";,
+"reference": "7c89093bd00f7d5ddf0ab81dee04f801416b4944",
 "shasum": ""
 },
 "require": {
@@ -760,7 +760,7 @@
 "testing",
 "xunit"
 ],
-"time": "2018-12-12T07:20:32+00:00"
+"time": "2019-01-15T08:19:08+00:00"
 },
 {
 "name": "sebastian/code-unit-reverse-lookup",
@@ -1370,7 +1370,7 @@
 },
 {
 "name": "Gert de Pagter",
-"email": "backend...@gmail.com"
+"email": "backend...@gmail.com"
 }
 ],
 "description": "Symfony polyfill for ctype functions",


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Replace deprecated Text_Diff PEAR package with Horde Text_Diff: README.md composer.json include/classes/bug_diff_renderer.php include/prepend.php src/Horde/Text/Diff.php

2019-01-24 Thread Peter Kokot
Commit:e3c4b0ace366b36e0da2bcb7492e8ce643359022
Author:Peter Kokot  Wed, 23 Jan 2019 01:13:15 
+0100
Parents:   ae57162e8dce7a000a1e3ea3e05387a9263ef0bc
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=e3c4b0ace366b36e0da2bcb7492e8ce643359022

Log:
Replace deprecated Text_Diff PEAR package with Horde Text_Diff

This patch replaces obsolete Text_Diff PEAR package with newer and still
maintained Horde Text_Diff version 2.2.0 as suggested in the packages
descriptions.

Since bugs.php.net production is not ready for Composer installations yet,
the Text_Diff package is bundled in the Git repository directly. Its
classes are not compliant with PSR-4 yet so the classmap has been used
until future PSR-4 migration and refactorings.

Changed paths:
  M  README.md
  M  composer.json
  D  include/classes/bug_diff_renderer.php
  M  include/prepend.php
  A  src/Horde/Text/Diff.php
  A  src/Horde/Text/Diff/Engine/Native.php
  A  src/Horde/Text/Diff/Engine/Shell.php
  A  src/Horde/Text/Diff/Engine/String.php
  A  src/Horde/Text/Diff/Engine/Xdiff.php
  A  src/Horde/Text/Diff/Exception.php
  A  src/Horde/Text/Diff/Mapped.php
  A  src/Horde/Text/Diff/Op/Add.php
  A  src/Horde/Text/Diff/Op/Base.php
  A  src/Horde/Text/Diff/Op/Change.php
  A  src/Horde/Text/Diff/Op/Copy.php
  A  src/Horde/Text/Diff/Op/Delete.php
  A  src/Horde/Text/Diff/Renderer.php
  A  src/Horde/Text/Diff/Renderer/Context.php
  A  src/Horde/Text/Diff/Renderer/Inline.php
  A  src/Horde/Text/Diff/Renderer/Unified.php
  A  src/Horde/Text/Diff/Renderer/Unified/Colored.php
  A  src/Horde/Text/Diff/ThreeWay.php
  A  src/Horde/Text/Diff/ThreeWay/BlockBuilder.php
  A  src/Horde/Text/Diff/ThreeWay/Op/Base.php
  A  src/Horde/Text/Diff/ThreeWay/Op/Copy.php
  A  src/Utils/Diff.php
  M  www/patch-display.php

diff --git a/README.md b/README.md
index e24aca4..275f64d 100644
--- a/README.md
+++ b/README.md
@@ -11,13 +11,6 @@ This is a unified bug tracking system for PHP hosted online 
at
 composer install
 ```
 
-* Install required dependencies using PEAR:
-
-```bash
-pear channel-update pear.php.net
-pear install --alldeps Text_Diff
-```
-
 * Configuration:
 
 Modify `local_config.php` according to your local development environment.
@@ -45,14 +38,15 @@ Source code of this application is structured in the 
following directories:
  ├─ .git/   # Git configuration and source directory
  ├─ docs/   # Application documentation
  └─ include/# Application helper functions and configuration
-├─ classes/ # PEAR class overrides
 ├─ prepend.php  # Autoloader, DB connection, container, app 
initialization
 └─ ...
  └─ scripts/# Command line development tools and scripts
 ├─ cron/# Various systems scripts to run periodically on 
the server
 └─ ...
  ├─ sql/# Database schema and fixtures
- ├─ src/# Application source code classes
+ └─ src/# Application source code classes
+├─ Horde/   # https://www.horde.org/libraries/Horde_Text_Diff
+└─ ...
  ├─ templates/  # Application templates
  ├─ tests/  # Application automated tests
  ├─ uploads/# Uploaded patch files
diff --git a/composer.json b/composer.json
index cddad87..438518b 100644
--- a/composer.json
+++ b/composer.json
@@ -36,7 +36,8 @@
 "autoload": {
 "psr-4": {
 "App\\": "src/"
-}
+},
+"classmap": ["src/Horde/"]
 },
 "autoload-dev": {
 "psr-4": {
diff --git a/include/classes/bug_diff_renderer.php 
b/include/classes/bug_diff_renderer.php
deleted file mode 100644
index 0071109..000
--- a/include/classes/bug_diff_renderer.php
+++ /dev/null
@@ -1,76 +0,0 @@
-diff = $d;
-   parent::__construct();
-   }
-
-   public function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
-   {
-   $removed = $xlen - $ylen;
-   if ($removed > 0) {
-   return 'Line ' . $xbeg . ' 
(now ' . $ybeg . '), was ' . $xlen . ' lines, now ' . $ylen . ' lines';
-   }
-   }
-
-   public function _added($lines)
-   {
-   self::escapeHTML($lines);
-
-   return ' ' . implode("\n ", $lines) . '';
-   }
-
-   public function _context($lines)
-   {
-   self::escapeHTML($lines);
-
-   return "\n" . parent::_context($lines);
-   }
-
-   public function _deleted($lines)
-   {
-   self::escapeHTML($lines);
-
-   return ' ' . implode("\n ", $lines) . '';
-   }
-
-   public function _changed($orig, $final)
-   {
-   return 

[PHP-WEBMASTER] com web/bugs: Refactor fetching versions: .gitignore README.md composer.json include/php_versions.php src/Utils/Cache.php src/Utils/ComposerScripts.php src/Utils/Versions/Client.php sr

2019-01-06 Thread Peter Kokot
Commit:ae57162e8dce7a000a1e3ea3e05387a9263ef0bc
Author:Peter Kokot  Sun, 16 Dec 2018 09:45:38 
+0100
Parents:   6712d9e13cdc37af96018976ac50b4b1c62b5604
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=ae57162e8dce7a000a1e3ea3e05387a9263ef0bc

Log:
Refactor fetching versions

- Procedural code moved to OOP
- Added unit tests
- Added a more flexible tmp folder location and introduce var folder
  (in production this won't work yet, so we still use /tmp there).
  For local development environments var directory in project root
  is used for faster and easier project setup.
- Added initial extensible PSR-16-alike semi-compatible cache class
  and refactored storing fetched versions.
- The versions list generator is now simpler and a bit more logical
  what is happening. Versions sort order is the same as before.
- Added ComposerScripts utility/service class for creating required
  directories (uploads and var/cache), and configuration file, when
  installing application in development environment.

Changed paths:
  M  .gitignore
  M  README.md
  M  composer.json
  D  include/php_versions.php
  A  src/Utils/Cache.php
  A  src/Utils/ComposerScripts.php
  A  src/Utils/Versions/Client.php
  A  src/Utils/Versions/Generator.php
  A  tests/Utils/CacheTest.php
  A  tests/Utils/Versions/ClientTest.php
  A  tests/Utils/Versions/GeneratorTest.php
  A  tests/fixtures/versions/versions.php
  A  tests/mock/responses/dev-body.txt
  A  tests/mock/responses/stable-body.txt
  M  www/report.php

diff --git a/.gitignore b/.gitignore
index 6c2d011..07c61bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,5 +7,8 @@
 # Local specific PHPUnit configuration
 /phpunit.xml
 
+# Transient and temporary generated files
+/var/
+
 # Generated by Composer
 /vendor/
diff --git a/README.md b/README.md
index 526ee6a..e24aca4 100644
--- a/README.md
+++ b/README.md
@@ -5,12 +5,6 @@ This is a unified bug tracking system for PHP hosted online at
 
 ## Local installation
 
-* Copy configuration and modify it accordingly for your local system:
-
-```bash
-cp local_config.php.sample local_config.php
-```
-
 * Install development dependencies with Composer:
 
 ```bash
@@ -24,6 +18,10 @@ pear channel-update pear.php.net
 pear install --alldeps Text_Diff
 ```
 
+* Configuration:
+
+Modify `local_config.php` according to your local development environment.
+
 * Database:
 
 Create a new MySQL/MariaDB database using `sql/database.sql`, create database
@@ -58,6 +56,7 @@ Source code of this application is structured in the 
following directories:
  ├─ templates/  # Application templates
  ├─ tests/  # Application automated tests
  ├─ uploads/# Uploaded patch files
+ ├─ var/# Transient and temporary generated files
  ├─ vendor/ # Dependencies generated by Composer
  └─ www/# Publicly accessible directory for online 
bugs.php.net
 ├─ css/ # Stylesheets
diff --git a/composer.json b/composer.json
index a4fea73..cddad87 100644
--- a/composer.json
+++ b/composer.json
@@ -42,5 +42,11 @@
 "psr-4": {
 "App\\Tests\\": "tests/"
 }
+},
+"scripts":{
+"post-install-cmd": [
+"App\\Utils\\ComposerScripts::installConfig",
+"App\\Utils\\ComposerScripts::createDirectories"
+]
 }
 }
diff --git a/include/php_versions.php b/include/php_versions.php
deleted file mode 100644
index 8aa07af..000
--- a/include/php_versions.php
+++ /dev/null
@@ -1,106 +0,0 @@
-https://qa.php.net/api.php
-if you want to add a new version, add it there at include/release-qa.php
-the result is cached for an hour in /tmp//tmp/versions.php
-the versions are weighted by the following:
-- major+minor version desc (7>5.4>5.3>master)
-- between a minor version we order by the micro if available: first the qa 
releases: alpha/beta/rc, then the stable, then the Git versions(snaps, Git)
-
-Stable releases are pulled from https://php.net/releases/active.php
-*/
-
-// Custom versions appended to the list
-$custom_versions = [
-   'Next Major Version',
-   'Next Minor Version',
-   'Irrelevant'
-];
-
-if(!file_exists("/tmp/versions.php") || filemtime("/tmp/versions.php") < 
$_SERVER['REQUEST_TIME'] - 3600) {
-   $versions = buildVersions();
-   $versions_data = var_export($versions, true);
-   file_put_contents("/tmp/versions.php", 'https://qa.php.net/api.php?type=qa-releases&format=json&only=dev_versions'));
-
-   $versions = [];
-
-   $date = date('Y-m-d');
-   $default_versions = [
-   "Git-{$date} (snap)",
-   "Git-{$date} (Git)",
-   ];
-
-   foreach ($dev_versions as $dev_version) {
-  

[PHP-WEBMASTER] Re: Stale branches for web/pecl repository

2019-01-04 Thread Peter Kokot
Hello,

On Thu, 13 Dec 2018 at 23:55, Peter Kokot  wrote:
>
> Hello, there are 3 so called stale branches that got stuck:
> https://github.com/php/web-pecl/branches
>
> The "maint":
> https://github.com/php/web-pecl/commits/maint
> and "old_auth":
> https://github.com/php/web-pecl/tree/old_auth
> which are both already fully integrated in the web/pecl master branch.
>
> Should we remove these two from the Git repository?
>
> I'm about to recheck the "next" branch soon:
> https://github.com/php/web-pecl/tree/next
> It seems that a complete site redesign was being done and then moving
> to pickleweb but as I imagine the entire project is too complicated
> for creating a separate branch and discussion after the long and hard
> working commits are done. Mainly, some changes will definitely be
> useful from this branch to integrate to master branch...
>
> Thanks.

To have Git repository maintained and understandable as much as
possible, the "maint" and "old_auth" branches have been removed since
they were only topic, temporary placeholders with all changes already
applied to the master branch and also with ~10 commits work done on
them.

I'll recheck the "next" branch what should be added to master from
there. The work done on it definitely looks ok to me and shouldn't be
neglected.

Thanks.


-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] Dependency injection container for bugs.php.net

2019-01-03 Thread Peter Kokot
Hello,

following previous discussions about the template engine, OOP,
modernizing bugs.php.net application this one is about adding a
minimalistic dependency injection container.

Pull request is in preparation [1]

Short intro:
What are dependencies and what is dependency injection is briefly
described in the attached docs file in the pull request and in
numerous articles and blog posts around the community.

I really can't imagine a PHP application written in OOP without a
dependency injection container these days anymore. Similar approach as
with template layer, this one is written from scratch and follows some
good practices of other DIC implementations out there.

Maybe any thoughts in this regard?

Thank you.

[1] https://github.com/php/web-bugs/pull/70

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Add template engine: README.md docs/README.md docs/templates.md include/prepend.php src/Template/Context.php src/Template/Engine.php templates/layout.php templates/pages/

2019-01-02 Thread Peter Kokot
Commit:068d8514af650469cdc566e4bbcd50d52cd5f7e5
Author:Peter Kokot  Mon, 17 Dec 2018 17:28:48 
+0100
Parents:   14c6ce8cd5511224a9435e42d668ab7f51c1e6ae
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=068d8514af650469cdc566e4bbcd50d52cd5f7e5

Log:
Add template engine

This patch adds an initial simplistic template engine to separate logic
from the presentation.

Basic initial features:
- escaping via Context::noHtml() and Context::e() methods
- blocks
- nesting options using includes and extending layouts
- PHP syntax
- variable scopes dedicated to template scope only
- Appending blocks (when JS files are in need to be appended)
- initial unit and functional tests
- Main index page refactored as an example of usage
- Very short intro docs how to use the template layer
- Thanks to @nhlm for the code review and numerous suggestions to
  improve the usability and code stability,
- Thanks to @KalleZ and for the code review and numerous common sense
  suggestions about templates themselves.
- Thanks to @Maikuolan for the code review and numerous suggestions
  about the usability.
- Moved hash ids redirection to aseparate JavaScript file
- Use location instead of window.location in the JavaScript redirection

Discussions:
- http://news.php.net/php.webmaster/27603
- https://github.com/php/web-bugs/pull/66

Changed paths:
  M  README.md
  A  docs/README.md
  A  docs/templates.md
  M  include/prepend.php
  A  src/Template/Context.php
  A  src/Template/Engine.php
  A  templates/layout.php
  A  templates/pages/index.php
  A  tests/Template/ContextTest.php
  A  tests/Template/EngineTest.php
  A  tests/fixtures/templates/base.php
  A  tests/fixtures/templates/forms/form.php
  A  tests/fixtures/templates/includes/banner.php
  A  tests/fixtures/templates/includes/base.php
  A  tests/fixtures/templates/includes/extends.php
  A  tests/fixtures/templates/includes/variable.php
  A  tests/fixtures/templates/layout.php
  A  tests/fixtures/templates/pages/add_function.php
  A  tests/fixtures/templates/pages/appending.php
  A  tests/fixtures/templates/pages/assignments.php
  A  tests/fixtures/templates/pages/extends.php
  A  tests/fixtures/templates/pages/including.php
  A  tests/fixtures/templates/pages/invalid_variables.php
  A  tests/fixtures/templates/pages/no_layout.rss
  A  tests/fixtures/templates/pages/overrides.php
  A  tests/fixtures/templates/pages/view.php
  M  www/index.php
  A  www/js/redirect.js

diff --git a/README.md b/README.md
index 890ec74..526ee6a 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,7 @@ Source code of this application is structured in the 
following directories:
 ```bash
 /
  ├─ .git/   # Git configuration and source directory
+ ├─ docs/   # Application documentation
  └─ include/# Application helper functions and configuration
 ├─ classes/ # PEAR class overrides
 ├─ prepend.php  # Autoloader, DB connection, container, app 
initialization
@@ -103,3 +104,7 @@ git remote add upstream git://github.com/php/web-bugs
 git config branch.master.remote upstream
 git pull --rebase
 ```
+
+## Documentation
+
+More information about this application can be found in the 
[documentation](/docs).
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 000..1cc4c00
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,3 @@
+# Application documentation
+
+* [Templates](/docs/templates.md)
diff --git a/docs/templates.md b/docs/templates.md
new file mode 100644
index 000..66ca34d
--- /dev/null
+++ b/docs/templates.md
@@ -0,0 +1,197 @@
+# Templates
+
+A simple template engine separates logic from the presentation and provides
+methods for creating nested templates and escaping strings to protect against
+too common XSS vulnerabilities.
+
+It is initialized in the application bootstrap:
+
+```php
+$template = new App\Template\Engine(__DIR__.'/../path/to/templates');
+```
+
+Site-wide configuration parameters can be assigned before rendering so they are
+available in all templates:
+
+```php
+$template->assign([
+'siteUrl' => 'https://bugs.php.net',
+// ...
+]);
+```
+
+Page can be rendered in the controller:
+
+```php
+echo $template->render('pages/how_to_report.php', [
+'mainHeading' => 'How to report a bug?',
+]);
+```
+
+The `templates/pages/how_to_report.php`:
+
+```php
+extends('layout.php', ['title' => 'Reporting bugs']) ?>
+
+start('main_content') ?>
+noHtml($mainHeading) ?>
+
+
+end('main_content') ?>
+
+start('scripts') ?>
+
+end('scripts') ?>
+```
+
+The `templates/layout.php`:
+
+```html
+
+
+
+
+
+PHP Bug Tracking System :: 
+
+
+block('main_content') ?>
+
+
+
+
+block('scripts') ?>

[PHP-WEBMASTER] com web/bugs: Bump Composer dependencies: composer.json composer.lock

2019-01-02 Thread Peter Kokot
Commit:14c6ce8cd5511224a9435e42d668ab7f51c1e6ae
Author:Peter Kokot  Wed, 2 Jan 2019 20:54:32 
+0100
Parents:   422f6e5c3e42770374289ac72a4a25ceca1b6c52
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=14c6ce8cd5511224a9435e42d668ab7f51c1e6ae

Log:
Bump Composer dependencies

- PHPUnit 7.4 upgraded to 7.5
- composer update

Changed paths:
  M  composer.json
  M  composer.lock


Diff:
diff --git a/composer.json b/composer.json
index 39c9f3d..a4fea73 100644
--- a/composer.json
+++ b/composer.json
@@ -31,7 +31,7 @@
 "ext-session": "*"
 },
 "require-dev": {
-"phpunit/phpunit": "^7.4"
+"phpunit/phpunit": "^7.5"
 },
 "autoload": {
 "psr-4": {
diff --git a/composer.lock b/composer.lock
index 7d27340..5296c0b 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies";,
 "This file is @generated automatically"
 ],
-"content-hash": "dc3b11918cde7a2af15820af62cb92af",
+"content-hash": "c4d7d1e13a174de9ebf8016cf7872528",
 "packages": [],
 "packages-dev": [
 {
@@ -680,16 +680,16 @@
 },
 {
 "name": "phpunit/phpunit",
-"version": "7.4.5",
+"version": "7.5.1",
 "source": {
 "type": "git",
 "url": "https://github.com/sebastianbergmann/phpunit.git";,
-"reference": "61d34e8dd6eb3555900f0f2a2fa9e7e570730102"
+"reference": "c23d78776ad415d5506e0679723cb461d71f488f"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/sebastianbergmann/phpunit/zipball/61d34e8dd6eb3555900f0f2a2fa9e7e570730102";,
-"reference": "61d34e8dd6eb3555900f0f2a2fa9e7e570730102",
+"url": 
"https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c23d78776ad415d5506e0679723cb461d71f488f";,
+"reference": "c23d78776ad415d5506e0679723cb461d71f488f",
 "shasum": ""
 },
 "require": {
@@ -734,7 +734,7 @@
 "type": "library",
 "extra": {
 "branch-alias": {
-"dev-master": "7.4-dev"
+"dev-master": "7.5-dev"
 }
 },
 "autoload": {
@@ -760,7 +760,7 @@
 "testing",
 "xunit"
 ],
-"time": "2018-12-03T05:01:24+00:00"
+"time": "2018-12-12T07:20:32+00:00"
 },
 {
 "name": "sebastian/code-unit-reverse-lookup",
@@ -1326,6 +1326,64 @@
 "time": "2016-10-03T07:35:21+00:00"
 },
 {
+"name": "symfony/polyfill-ctype",
+"version": "v1.10.0",
+"source": {
+"type": "git",
+"url": "https://github.com/symfony/polyfill-ctype.git";,
+"reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19";,
+"reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
+"shasum": ""
+},
+"require": {
+"php": ">=5.3.3"
+},
+"suggest": {
+"ext-ctype": "For best performance"
+},
+"type": "library",
+"extra": {
+"branch-alias": {
+"dev-master": "1.9-dev"
+}
+},
+"autoload": {
+"psr-4": {
+"Symfony\\Polyfill\\Ctype\\": ""
+},
+"files": [
+"bootstrap.php"
+ 

[PHP-WEBMASTER] com web/bugs: Refactor repository classes to use vanilla PDOStatement: src/Repository/ObsoletePatchRepository.php src/Repository/PackageRepository.php src/Repository/PatchRepository.ph

2018-12-26 Thread Peter Kokot
Commit:b78a07146df1fdf804df21688a98d98273f12b6b
Author:Peter Kokot  Wed, 26 Dec 2018 22:27:50 
+0100
Parents:   402a43856329884eae5b58e83b656b08a6c2ab01
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=b78a07146df1fdf804df21688a98d98273f12b6b

Log:
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.

Changed paths:
  M  src/Repository/ObsoletePatchRepository.php
  M  src/Repository/PackageRepository.php
  M  src/Repository/PatchRepository.php
  M  src/Repository/PullRequestRepository.php


Diff:
diff --git a/src/Repository/ObsoletePatchRepository.php 
b/src/Repository/ObsoletePatchRepository.php
index 2682cee..f8ff1ae 100644
--- a/src/Repository/ObsoletePatchRepository.php
+++ b/src/Repository/ObsoletePatchRepository.php
@@ -31,7 +31,10 @@ class ObsoletePatchRepository
 WHERE bugdb_id = ? AND obsolete_patch = ? AND 
obsolete_revision = ?
 ';
 
-return $this->dbh->prepare($sql)->execute([$bugId, $patch, 
$revision])->fetchAll();
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$bugId, $patch, $revision]);
+
+return $statement->fetchAll();
 }
 
 /**
@@ -44,6 +47,9 @@ class ObsoletePatchRepository
 WHERE bugdb_id = ? AND patch = ? AND revision = ?
 ';
 
-return $this->dbh->prepare($sql)->execute([$bugId, $patch, 
$revision])->fetchAll();
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$bugId, $patch, $revision]);
+
+return $statement->fetchAll();
 }
 }
diff --git a/src/Repository/PackageRepository.php 
b/src/Repository/PackageRepository.php
index 399..ae64a1a 100644
--- a/src/Repository/PackageRepository.php
+++ b/src/Repository/PackageRepository.php
@@ -46,7 +46,9 @@ class PackageRepository
 
 $sql .= ' ORDER BY parent, disabled, id';
 
-$data = $this->dbh->prepare($sql)->execute($arguments)->fetchAll();
+$statement = $this->dbh->prepare($sql);
+$statement->execute($arguments);
+$data = $statement->fetchAll();
 
 return $this->getNested($data);
 }
@@ -67,7 +69,10 @@ class PackageRepository
 
 $sql .= ' ORDER BY parent, id';
 
-$data = $this->dbh->prepare($sql)->execute($arguments)->fetchAll();
+$statement = $this->dbh->prepare($sql);
+$statement->execute($arguments);
+
+$data = $statement->fetchAll();
 
 return $this->getNested($data);
 }
diff --git a/src/Repository/PatchRepository.php 
b/src/Repository/PatchRepository.php
index 971c1ff..9fd9031 100644
--- a/src/Repository/PatchRepository.php
+++ b/src/Repository/PatchRepository.php
@@ -39,7 +39,10 @@ class PatchRepository
 ORDER BY revision DESC
 ';
 
-return $this->dbh->prepare($sql)->execute([$bugId])->fetchAll();
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$bugId]);
+
+return $statement->fetchAll();
 }
 
 /**
@@ -54,7 +57,10 @@ class PatchRepository
 
 $arguments = [$bugId, $patch, $revision];
 
-return 
$this->dbh->prepare($sql)->execute($arguments)->fetch(\PDO::FETCH_NUM)[0];
+$statement = $this->dbh->prepare($sql);
+$statement->execute($arguments);
+
+return $statement->fetch(\PDO::FETCH_NUM)[0];
 }
 
 /**
@@ -68,7 +74,10 @@ class PatchRepository
 ORDER BY revision DESC
 ';
 
-return $this->dbh->prepare($sql)->execute([$bugId, 
$patch])->fetchAll();
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$bugId, $patch]);
+
+return $statement->fetchAll();
 }
 
 /**
@@ -81,7 +90,10 @@ class PatchRepository
 WHERE bugdb_id = ? AND patch = ? AND revision = ?
 ';
 
-if ($this->dbh->prepare($sql)->execute([$bugId, $name, 
$revision])->fetch(\PDO::FETCH_NUM)[0]) {
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$bugId, $name, $revision]);
+
+if ($statement->fetch(\PDO::FETCH_NUM)[0]) {
 $contents = @file_get_contents($this->getPatchPath($bugId, $name, 
$revision));
 
 if (!$contents) {
diff --git a/src/Repository/PullRequestRepository.php 
b/src/Repository/PullRequestRepository.php
index 89a72ce..0d6bd7e 100644
--- a/src/Repository/PullRequestRepository.php
+++ b/src/Repository/PullRequestRepository.php
@@ -35,6 +35,9 

[PHP-WEBMASTER] com web/bugs: Fix strict types issues: src/Repository/BugRepository.php src/Repository/VoteRepository.php

2018-12-23 Thread Peter Kokot
Commit:402a43856329884eae5b58e83b656b08a6c2ab01
Author:Peter Kokot  Mon, 24 Dec 2018 03:00:41 
+0100
Parents:   fe4c5e81f570c4dfb9c0bc4530bc3d955ab579d4
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=402a43856329884eae5b58e83b656b08a6c2ab01

Log:
Fix strict types issues

This makes sure arrays are always returned when calling
PDOStatement::fetch() in current repository classes.

Changed paths:
  M  src/Repository/BugRepository.php
  M  src/Repository/VoteRepository.php


Diff:
diff --git a/src/Repository/BugRepository.php b/src/Repository/BugRepository.php
index 5ef08f3..d47f0c3 100644
--- a/src/Repository/BugRepository.php
+++ b/src/Repository/BugRepository.php
@@ -51,7 +51,9 @@ class BugRepository
 $statement = $this->dbh->prepare($sql);
 $statement->execute([$id]);
 
-return $statement->fetch();
+$result = $statement->fetch();
+
+return $result === false ? [] : $result;
 }
 
 /**
diff --git a/src/Repository/VoteRepository.php 
b/src/Repository/VoteRepository.php
index e832e7c..1b2aecc 100644
--- a/src/Repository/VoteRepository.php
+++ b/src/Repository/VoteRepository.php
@@ -33,10 +33,6 @@ class VoteRepository
 
 $result = $statement->fetch();
 
-if ($result === false) {
-return [];
-}
-
-return $result;
+return $result === false ? [] : $result;
 }
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] bugs.php.net template layer

2018-12-20 Thread Peter Kokot
Hello,

Current template system in bugs.php.net code is integrated in front
controllers (index.php...) and some separate template files. It
contains several helper functions with globals usage and mixes HTML
with PHP code logic. This makes app code a bit disorganized and less
testable.

I'd suggest to refactor this issue into a:
- separate template engine
- templates folder
- front controllers (PHP files currently residing in the www directory
- index.php...)

The template layer for the bugs.php.net is in progress happening here:
https://github.com/php/web-bugs/pull/66

This introduces two additional classes (so far):
- App\Template (main template engine with render method)
- App\Template\Context (to be able to use $this in the template directly)
- phpunit tests attached
- a quick intro how to use such template layer

Pros:
- still thin and simple enough to understand it quickly (very little
methods used)
- no additional caching required (performance impact is still being measured)
- integrated in the app directly so no dependencies required to
install in this aspect

I didn't want to introduce a 3rd party template engine here because
the app can't use composer installation step when deploying to
production yet neither we might agree on using some piece of template
engine. This patch is still in progress so I just wanted to get some
feedback and opinions at this phase.

Any thoughts?

Thank you.
-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Fix #76720: Contributor aids/readme improvements: README.md

2018-12-19 Thread Peter Kokot
Commit:03b4871fa3d916c662b8a88fec03e8a7c2690079
Author:Peter Kokot  Thu, 20 Dec 2018 06:29:32 
+0100
Parents:   1c04d30518e249088ae4e070bebbaaeb03de9355
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=03b4871fa3d916c662b8a88fec03e8a7c2690079

Log:
Fix #76720: Contributor aids/readme improvements

This fixes mentioned issues together with previous patches done on this
file.

Bugs:
https://bugs.php.net/76720

Changed paths:
  M  README.md


Diff:
diff --git a/README.md b/README.md
index 47fd759..890ec74 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# PHP Bug Tracking System
+# PHP Bug Tracking System
 
 This is a unified bug tracking system for PHP hosted online at
 [bugs.php.net](https://bugs.php.net).
@@ -26,8 +26,8 @@ pear install --alldeps Text_Diff
 
 * Database:
 
-Create a new database using `sql/database.sql`, create database schema
-`sql/schema.sql` and insert fixtures using `sql/fixtures.sql`.
+Create a new MySQL/MariaDB database using `sql/database.sql`, create database
+schema `sql/schema.sql` and insert fixtures using `sql/fixtures.sql`.
 
 ## Tests


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Remove display_bug_success() function: include/functions.php www/bug-pwd-finder.php www/bug.php

2018-12-18 Thread Peter Kokot
Commit:1c04d30518e249088ae4e070bebbaaeb03de9355
Author:Peter Kokot  Tue, 18 Dec 2018 01:47:55 
+0100
Parents:   9a8dbe29c491d31872421f91807667473fedf248
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=1c04d30518e249088ae4e070bebbaaeb03de9355

Log:
Remove display_bug_success() function

The display_bug_success() is a simple wrapper around the echo and has
HTML embedded in it.

Changed paths:
  M  include/functions.php
  M  www/bug-pwd-finder.php
  M  www/bug.php


Diff:
diff --git a/include/functions.php b/include/functions.php
index 767a929..5220f2e 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -697,18 +697,6 @@ function display_bug_error($in, $class = 'errors', $head = 
'ERROR:')
 }
 
 /**
- * Prints a message saying the action succeeded
- *
- * @param string $in   the string to be displayed
- *
- * @return void
- */
-function display_bug_success($in)
-{
-   echo "{$in}\n";
-}
-
-/**
  * Returns array of changes going to be made
  */
 function bug_diff($bug, $in)
diff --git a/www/bug-pwd-finder.php b/www/bug-pwd-finder.php
index b124b22..f0aa2ba 100644
--- a/www/bug-pwd-finder.php
+++ b/www/bug-pwd-finder.php
@@ -70,7 +70,7 @@ echo "Bug Report Password Finder\n";
 display_bug_error($errors);
 
 if ($success) {
-   display_bug_success($success);
+   echo ''.$success.'';
 }
 
 $_SESSION['answer'] = $captcha->getAnswer();
diff --git a/www/bug.php b/www/bug.php
index 3d50389..0fae892 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -596,34 +596,34 @@ switch ($thanks)
 {
case 1:
case 2:
-   display_bug_success('The bug was updated successfully.');
+   echo 'The bug was updated 
successfully.';
break;
case 3:
-   display_bug_success('Your comment was added to the bug 
successfully.');
+   echo 'Your comment was added to the bug 
successfully.';
break;
case 4:
$bug_url = 
"{$site_method}://{$site_url}{$basedir}/bug.php?id={$bug_id}";
-   display_bug_success("
+   echo '
Thank you for your help!
If the status of the bug report you submitted changes, 
you will be notified.
You may return here and check the status or update your 
report at any time.
-   The URL for your bug report is: {$bug_url}.
-   ");
+   The URL for your bug report is: '.$bug_url.'.
+   ';
break;
case 6:
-   display_bug_success('Thanks for voting! Your vote should be 
reflected in the statistics below.');
+   echo 'Thanks for voting! Your vote should 
be reflected in the statistics below.';
break;
case 7:
-   display_bug_success('Your subscribe request has been 
processed.');
+   echo 'Your subscribe request has been 
processed.';
break;
case 8:
-   display_bug_success('Your unsubscribe request has been 
processed, please check your email.');
+   echo 'Your unsubscribe request has been 
processed, please check your email.';
break;
case 9:
-   display_bug_success('You have successfully unsubscribed.');
+   echo 'You have successfully 
unsubscribed.';
break;
case 10:
-   display_bug_success('Your vote has been updated.');
+   echo 'Your vote has been updated.';
break;
 
default:


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Add Vote repository class: src/Repository/VoteRepository.php www/vote.php

2018-12-18 Thread Peter Kokot
Commit:9a8dbe29c491d31872421f91807667473fedf248
Author:Peter Kokot  Wed, 19 Dec 2018 03:11:46 
+0100
Parents:   a1e9fe6f6a7750b008dfe92cf8ecd9ab877b3f67
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=9a8dbe29c491d31872421f91807667473fedf248

Log:
Add Vote repository class

Changed paths:
  A  src/Repository/VoteRepository.php
  M  www/vote.php


Diff:
diff --git a/src/Repository/VoteRepository.php 
b/src/Repository/VoteRepository.php
new file mode 100644
index 000..e832e7c
--- /dev/null
+++ b/src/Repository/VoteRepository.php
@@ -0,0 +1,42 @@
+dbh = $dbh;
+}
+
+/**
+ * Find vote row by bug id and IP.
+ */
+public function findOneByIdAndIp(int $id, string $ip): array
+{
+$sql = 'SELECT bug, ip FROM bugdb_votes WHERE bug = ? AND ip = ? LIMIT 
1';
+
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$id, $ip]);
+
+$result = $statement->fetch();
+
+if ($result === false) {
+return [];
+}
+
+return $result;
+}
+}
diff --git a/www/vote.php b/www/vote.php
index 73f2a9c..e5d6817 100644
--- a/www/vote.php
+++ b/www/vote.php
@@ -1,6 +1,7 @@
 prepare("SELECT bug, ip FROM bugdb_votes WHERE bug = ? AND 
ip = ? LIMIT 1")
-   ->execute([$id, $ip])
-   ->fetch(\PDO::FETCH_BOTH);
-
-if (empty($bug_check)) {
+if (empty((new VoteRepository($dbh))->findOneByIdAndIp($id, $ip))) {
// If the user vote isn't found, create one.
$dbh->prepare("
INSERT INTO bugdb_votes (bug, ip, score, reproduced, tried, 
sameos, samever)


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Move docs comments to repository: src/Repository/CommentRepository.php www/api.php

2018-12-18 Thread Peter Kokot
Commit:a1e9fe6f6a7750b008dfe92cf8ecd9ab877b3f67
Author:Peter Kokot  Wed, 19 Dec 2018 02:49:59 
+0100
Parents:   ad8bc2d5ab343733e57622d0ca063ce96570509d
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=a1e9fe6f6a7750b008dfe92cf8ecd9ab877b3f67

Log:
Move docs comments to repository

Changed paths:
  M  src/Repository/CommentRepository.php
  M  www/api.php


Diff:
diff --git a/src/Repository/CommentRepository.php 
b/src/Repository/CommentRepository.php
index 8f28c4b..18c6944 100644
--- a/src/Repository/CommentRepository.php
+++ b/src/Repository/CommentRepository.php
@@ -39,4 +39,27 @@ class CommentRepository
 
 return $statement->fetchAll();
 }
+
+/**
+ * Find all log comments for documentation.
+ * TODO: Check if this method is still used in the api.php endpoint.
+ */
+public function findDocsComments(int $interval): array
+{
+$sql = "SELECT bugdb_comments.reporter_name, COUNT(*) as count
+FROM bugdb_comments, bugdb
+WHERE comment_type =  'log'
+AND (package_name IN ('Doc Build problem', 'Documentation 
problem', 'Translation problem', 'Online Doc Editor problem') OR bug_type = 
'Documentation Problem')
+AND comment LIKE  '%+Status:  Closed%'
+AND date_sub(curdate(), INTERVAL ? DAY) <= ts
+AND bugdb.id = bugdb_comments.bug
+GROUP BY bugdb_comments.reporter_name
+ORDER BY count DESC
+";
+
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$interval]);
+
+return $statement->fetchAll();
+}
 }
diff --git a/www/api.php b/www/api.php
index 4a07baf..4fbf5bc 100644
--- a/www/api.php
+++ b/www/api.php
@@ -5,6 +5,9 @@
The API itself will probably be abandoned in the future, but here's the 
current URL:
- https://bugs.php.net/api.php?type=docs&action=closed&interval=7
 */
+
+use App\Repository\CommentRepository;
+
 require_once '../include/prepend.php';
 
 $type = isset($_GET['type']) ? $_GET['type']   : 'unknown';
@@ -12,22 +15,10 @@ $action   = isset($_GET['action'])   ? $_GET['action']  
   : 'unknown';
 $interval = isset($_GET['interval']) ? (int) $_GET['interval'] : 7;
 
 if ($type === 'docs' && $action === 'closed' && $interval) {
-
-   $query =
-   "
-   SELECT bugdb_comments.reporter_name, COUNT(*) as count
-   FROM bugdb_comments, bugdb
-   WHERE comment_type =  'log'
-   AND (package_name IN ('Doc Build problem', 'Documentation 
problem', 'Translation problem', 'Online Doc Editor problem') OR bug_type = 
'Documentation Problem')
-   AND comment LIKE  '%+Status:  Closed%'
-   AND date_sub(curdate(), INTERVAL {$interval} DAY) <= ts
-   AND bugdb.id = bugdb_comments.bug
-   GROUP BY bugdb_comments.reporter_name
-   ORDER BY count DESC
-   ";
+   $commentRepository = new CommentRepository($dbh);
+   $rows = $commentRepository->findDocsComments($interval);
 
//@todo add error handling
-   $rows = $dbh->prepare($query)->execute([])->fetchAll();
if (!$rows) {
echo 'The fail train has arrived.';
exit;


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Move bugdb queries to repository: scripts/cron/email-assigned scripts/cron/no-feedback src/Repository/BugRepository.php www/index.php www/stats.php www/vote.php

2018-12-18 Thread Peter Kokot
Commit:ad8bc2d5ab343733e57622d0ca063ce96570509d
Author:Peter Kokot  Wed, 19 Dec 2018 01:47:19 
+0100
Parents:   11fd2afda1fdbb0e0365886cd9cafc7b74dd525f
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=ad8bc2d5ab343733e57622d0ca063ce96570509d

Log:
Move bugdb queries to repository

Changed paths:
  M  scripts/cron/email-assigned
  M  scripts/cron/no-feedback
  M  src/Repository/BugRepository.php
  M  www/index.php
  M  www/stats.php
  M  www/vote.php

diff --git a/scripts/cron/email-assigned b/scripts/cron/email-assigned
index c1977d4..60456a6 100755
--- a/scripts/cron/email-assigned
+++ b/scripts/cron/email-assigned
@@ -1,6 +1,8 @@
 #!/usr/bin/env php
 https://news.php.net/php.webmaster/8828
 */
-$sql = "SELECT id, package_name, bug_type, sdesc, status, assign, 
UNIX_TIMESTAMP(ts1) AS ts_opened, UNIX_TIMESTAMP(ts2) AS ts_changed
-   FROM `bugdb`
-   WHERE length(assign) > 1
-   AND status IN ('Assigned', 'Open', 'Re-Opened', 'Feedback', 
'Analyzed', 'Verified', 'Critical', 'Suspended')
-   ORDER BY id";
-
-$res = $dbh->query($sql);
-
-// Gather up the data
-while ($row = $res->fetch()) {
-   $data[$row['assign']][] = $row;
-}
-
-foreach ($data as $assigned => $binfos) {
+foreach ((new BugRepository($dbh))->findAllAssigned() as $assigned => $binfos) 
{
 
$mbody  = format_email_body($binfos);
$email_user = $assigned . '@php.net';
diff --git a/scripts/cron/no-feedback b/scripts/cron/no-feedback
index 55fb7d6..653ab8d 100755
--- a/scripts/cron/no-feedback
+++ b/scripts/cron/no-feedback
@@ -3,13 +3,11 @@
 
 # this script closes bugs due to lack of feedback.
 
+use App\Repository\BugRepository;
 use App\Repository\ReasonRepository;
 
 require __DIR__.'/../../include/prepend.php';
 
-# date interval to close after
-$after = "7 DAY";
-
 # Set "input" array
 $in = ['status' => 'No Feedback'];
 
@@ -18,15 +16,7 @@ $reasonRepository = new ReasonRepository($dbh);
 
 list($RESOLVE_REASONS, $FIX_VARIATIONS) = 
$reasonRepository->findByProject($site);
 
-$res = $dbh->prepare("
-   SELECT id, package_name, bug_type, email, passwd, sdesc, ldesc, 
php_version,
-   php_os, status, ts1, ts2, assign, UNIX_TIMESTAMP(ts1) AS 
submitted,
-   private, reporter_name, UNIX_TIMESTAMP(ts2) AS modified
-   FROM bugdb
-   WHERE status = 'Feedback' AND ts2 < DATE_SUB(NOW(), INTERVAL {$after})
-")->execute([]);
-
-while ($bug = $res->fetch())
+foreach ((new BugRepository($dbh))->findAllWithoutFeedback() as $bug)
 {
list($mailto, $mailfrom, $bcc, $params) = 
get_package_mail($bug['package_name'], false, $bug['bug_type']);
 
diff --git a/src/Repository/BugRepository.php b/src/Repository/BugRepository.php
index 66ac511..5ef08f3 100644
--- a/src/Repository/BugRepository.php
+++ b/src/Repository/BugRepository.php
@@ -14,6 +14,11 @@ class BugRepository
 private $dbh;
 
 /**
+ * Days when bugs with no feedback get closed.
+ */
+private const FEEDBACK_PERIOD = 7;
+
+/**
  * Class constructor.
  */
 public function __construct(\PDO $dbh)
@@ -48,4 +53,125 @@ class BugRepository
 
 return $statement->fetch();
 }
+
+/**
+ * Find random bug to resolve for a contributor.
+ */
+public function findRandom(): array
+{
+$sql = "SELECT id
+FROM bugdb
+WHERE status NOT IN('Closed', 'Not a bug', 'Duplicate', 
'Spam', 'Wont fix', 'No Feedback')
+AND private = 'N'
+ORDER BY RAND() LIMIT 1
+";
+
+$statement = $this->dbh->prepare($sql);
+$statement->execute();
+
+return $statement->fetch(\PDO::FETCH_NUM);
+}
+
+/**
+ * Find all bugs that have someone assigned to them.
+ */
+public function findAllAssigned(): array
+{
+$sql = "SELECT id, package_name, bug_type, sdesc, status, assign, 
UNIX_TIMESTAMP(ts1) AS ts_opened, UNIX_TIMESTAMP(ts2) AS ts_changed
+FROM `bugdb`
+WHERE length(assign) > 1
+AND status IN ('Assigned', 'Open', 'Re-Opened', 
'Feedback', 'Analyzed', 'Verified', 'Critical', 'Suspended')
+ORDER BY id
+";
+
+$statement = $this->dbh->query($sql);
+
+$data = [];
+
+// Populate data with assign field as array key
+while ($row = $statement->fetch()) {
+$data[$row['assign']][] = $row;
+}
+
+return $data;
+}
+
+   

[PHP-WEBMASTER] com web/bugs: Move lists query to repository class: src/Repository/PackageRepository.php www/admin/index.php

2018-12-18 Thread Peter Kokot
Commit:11fd2afda1fdbb0e0365886cd9cafc7b74dd525f
Author:Peter Kokot  Wed, 19 Dec 2018 02:22:12 
+0100
Parents:   f038854680d7bd625713757555bead86b789e1fe
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=11fd2afda1fdbb0e0365886cd9cafc7b74dd525f

Log:
Move lists query to repository class

Changed paths:
  M  src/Repository/PackageRepository.php
  M  www/admin/index.php


Diff:
diff --git a/src/Repository/PackageRepository.php 
b/src/Repository/PackageRepository.php
index 96392c8..399 100644
--- a/src/Repository/PackageRepository.php
+++ b/src/Repository/PackageRepository.php
@@ -117,4 +117,20 @@ class PackageRepository
 
 return $packages;
 }
+
+/**
+ * Find all package mailing lists.
+ */
+public function findLists(): array
+{
+$sql = "SELECT name, list_email
+FROM bugdb_pseudo_packages
+WHERE project = 'php' AND LENGTH(list_email) > 0
+ORDER BY list_email
+";
+
+$statement = $this->dbh->query($sql);
+
+return $statement->fetchAll();
+}
 }
diff --git a/www/admin/index.php b/www/admin/index.php
index ebb905b..1c2c810 100644
--- a/www/admin/index.php
+++ b/www/admin/index.php
@@ -1,4 +1,7 @@
 query("
-   SELECT name, list_email
-   FROM bugdb_pseudo_packages
-   WHERE project = 'php'
-   AND LENGTH(list_email) > 0
-   ORDER BY list_email
-   ");
-
echo "\n";
-   while ($row = $res->fetch()) {
+   foreach ((new PackageRepository($dbh))->findLists() as $row) {
echo "", $row['name'], ": \n", 
mailto_list(explode(',', $row['list_email'])), "\n";
}
echo "\n";


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Remove unneeded check for database handle presence: scripts/cron/no-feedback

2018-12-18 Thread Peter Kokot
Commit:f038854680d7bd625713757555bead86b789e1fe
Author:Peter Kokot  Tue, 18 Dec 2018 19:55:20 
+0100
Parents:   7203dec380656b953170f5aa63f4d271c2801f65
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=f038854680d7bd625713757555bead86b789e1fe

Log:
Remove unneeded check for database handle presence

This check(s) were once used in previous code for local testings.

Changed paths:
  M  scripts/cron/no-feedback


Diff:
diff --git a/scripts/cron/no-feedback b/scripts/cron/no-feedback
index 25f15b5..55fb7d6 100755
--- a/scripts/cron/no-feedback
+++ b/scripts/cron/no-feedback
@@ -14,44 +14,41 @@ $after = "7 DAY";
 $in = ['status' => 'No Feedback'];
 
 # Update relevant reports
-if ($dbh)
+$reasonRepository = new ReasonRepository($dbh);
+
+list($RESOLVE_REASONS, $FIX_VARIATIONS) = 
$reasonRepository->findByProject($site);
+
+$res = $dbh->prepare("
+   SELECT id, package_name, bug_type, email, passwd, sdesc, ldesc, 
php_version,
+   php_os, status, ts1, ts2, assign, UNIX_TIMESTAMP(ts1) AS 
submitted,
+   private, reporter_name, UNIX_TIMESTAMP(ts2) AS modified
+   FROM bugdb
+   WHERE status = 'Feedback' AND ts2 < DATE_SUB(NOW(), INTERVAL {$after})
+")->execute([]);
+
+while ($bug = $res->fetch())
 {
-   $reasonRepository = new ReasonRepository($dbh);
-
-   list($RESOLVE_REASONS, $FIX_VARIATIONS) = 
$reasonRepository->findByProject($site);
-
-   $res = $dbh->prepare("
-   SELECT id, package_name, bug_type, email, passwd, sdesc, ldesc, 
php_version,
-   php_os, status, ts1, ts2, assign, UNIX_TIMESTAMP(ts1) 
AS submitted,
-   private, reporter_name, UNIX_TIMESTAMP(ts2) AS modified
-   FROM bugdb
-   WHERE status = 'Feedback' AND ts2 < DATE_SUB(NOW(), INTERVAL 
{$after})
-   ")->execute([]);
-
-   while ($bug = $res->fetch())
-   {
-   list($mailto, $mailfrom, $bcc, $params) = 
get_package_mail($bug['package_name'], false, $bug['bug_type']);
-
-   // No feedback message
-   if (isset($FIX_VARIATIONS) && 
isset($FIX_VARIATIONS['nofeedback'][$bug['package_name']])) {
-   $message = 
$FIX_VARIATIONS['nofeedback'][$bug['package_name']];
-   } elseif (isset($RESOLVE_REASONS['nofeedback'])) {
-   $message = $RESOLVE_REASONS['nofeedback']['message'];
-   } else {
-   die('[no-feedback] Could not find resolve reason! (this 
should not happen!)');
-   }
-   bugs_add_comment($bug['id'], $mailfrom, '', $message, 
'comment');
-
-   // Update status
-   $dbh->prepare('
-   UPDATE bugdb
-   SET status = "No Feedback", ts2 = NOW()
-   WHERE id = ?
-   ')->execute([
-   $bug['id'],
-   ]);
-
-   // Send emails
-   mail_bug_updates($bug, $in, $mailfrom, $message);
+   list($mailto, $mailfrom, $bcc, $params) = 
get_package_mail($bug['package_name'], false, $bug['bug_type']);
+
+   // No feedback message
+   if (isset($FIX_VARIATIONS) && 
isset($FIX_VARIATIONS['nofeedback'][$bug['package_name']])) {
+   $message = $FIX_VARIATIONS['nofeedback'][$bug['package_name']];
+   } elseif (isset($RESOLVE_REASONS['nofeedback'])) {
+   $message = $RESOLVE_REASONS['nofeedback']['message'];
+   } else {
+   die('[no-feedback] Could not find resolve reason! (this should 
not happen!)');
}
+   bugs_add_comment($bug['id'], $mailfrom, '', $message, 'comment');
+
+   // Update status
+   $dbh->prepare('
+   UPDATE bugdb
+   SET status = "No Feedback", ts2 = NOW()
+   WHERE id = ?
+   ')->execute([
+   $bug['id'],
+   ]);
+
+   // Send emails
+   mail_bug_updates($bug, $in, $mailfrom, $message);
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Fix SQL string typo: src/Repository/ReasonRepository.php

2018-12-17 Thread Peter Kokot
Commit:7203dec380656b953170f5aa63f4d271c2801f65
Author:Peter Kokot  Tue, 18 Dec 2018 00:28:58 
+0100
Parents:   10b0ad9cbe6a764b72b2fad0ed2ce3d349992d6c
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=7203dec380656b953170f5aa63f4d271c2801f65

Log:
Fix SQL string typo

Changed paths:
  M  src/Repository/ReasonRepository.php


Diff:
diff --git a/src/Repository/ReasonRepository.php 
b/src/Repository/ReasonRepository.php
index c8d74c8..fd4f411 100644
--- a/src/Repository/ReasonRepository.php
+++ b/src/Repository/ReasonRepository.php
@@ -30,7 +30,7 @@ class ReasonRepository
 $arguments = [];
 
 if ($project !== '') {
-$sql = " WHERE (project = ? OR project = '')";
+$sql .= " WHERE (project = ? OR project = '')";
 $arguments[] = $project;
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Refactor bugs_get_bug() to repository: include/functions.php src/Repository/BugRepository.php www/bug.php www/fix.php www/gh-pull-add.php www/patch-add.php www/patch-disp

2018-12-17 Thread Peter Kokot
Commit:10b0ad9cbe6a764b72b2fad0ed2ce3d349992d6c
Author:Peter Kokot  Sun, 16 Dec 2018 20:45:17 
+0100
Parents:   a5b6fa0704230cfb13b1fe592ec0908924ccb1a8
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=10b0ad9cbe6a764b72b2fad0ed2ce3d349992d6c

Log:
Refactor bugs_get_bug() to repository

Changed paths:
  M  include/functions.php
  A  src/Repository/BugRepository.php
  M  www/bug.php
  M  www/fix.php
  M  www/gh-pull-add.php
  M  www/patch-add.php
  M  www/patch-display.php
  M  www/rpc.php
  M  www/rss/bug.php


Diff:
diff --git a/include/functions.php b/include/functions.php
index 5384fb4..767a929 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1423,34 +1423,6 @@ function unsubscribe($bug_id, $hash)
 }
 
 /**
- * Fetch bug data
- *
- * @return mixed array of bug data or object with error info
- */
-function bugs_get_bug($bug_id)
-{
-   global $dbh;
-
-   $query = 'SELECT b.id, b.package_name, b.bug_type, b.email, 
b.reporter_name,
-   b.sdesc, b.ldesc, b.php_version, b.php_os,
-   b.status, b.ts1, b.ts2, b.assign, b.block_user_comment,
-   b.private, b.cve_id,
-   UNIX_TIMESTAMP(b.ts1) AS submitted,
-   UNIX_TIMESTAMP(b.ts2) AS modified,
-   COUNT(bug=b.id) AS votes,
-   IFNULL((SELECT z.project FROM bugdb_pseudo_packages z WHERE 
z.name = b.package_name LIMIT 1), "php") project,
-   SUM(reproduced) AS reproduced, SUM(tried) AS tried,
-   SUM(sameos) AS sameos, SUM(samever) AS samever,
-   AVG(score)+3 AS average, STD(score) AS deviation
-   FROM bugdb b
-   LEFT JOIN bugdb_votes ON b.id = bug
-   WHERE b.id = ?
-   GROUP BY bug';
-
-   return $dbh->prepare($query)->execute([$bug_id])->fetch();
-}
-
-/**
  * Add bug comment
  */
 function bugs_add_comment($bug_id, $from, $from_name, $comment, $type = 
'comment')
diff --git a/src/Repository/BugRepository.php b/src/Repository/BugRepository.php
new file mode 100644
index 000..66ac511
--- /dev/null
+++ b/src/Repository/BugRepository.php
@@ -0,0 +1,51 @@
+dbh = $dbh;
+}
+
+/**
+ * Fetch bug data by bug id.
+ */
+public function findOneById(int $id): array
+{
+$sql = 'SELECT b.id, b.package_name, b.bug_type, b.email, 
b.reporter_name,
+b.sdesc, b.ldesc, b.php_version, b.php_os,
+b.status, b.ts1, b.ts2, b.assign, b.block_user_comment,
+b.private, b.cve_id,
+UNIX_TIMESTAMP(b.ts1) AS submitted,
+UNIX_TIMESTAMP(b.ts2) AS modified,
+COUNT(bug=b.id) AS votes,
+IFNULL((SELECT z.project FROM bugdb_pseudo_packages z 
WHERE z.name = b.package_name LIMIT 1), "php") project,
+SUM(reproduced) AS reproduced, SUM(tried) AS tried,
+SUM(sameos) AS sameos, SUM(samever) AS samever,
+AVG(score)+3 AS average, STD(score) AS deviation
+FROM bugdb b
+LEFT JOIN bugdb_votes ON b.id = bug
+WHERE b.id = ?
+GROUP BY bug
+';
+
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$id]);
+
+return $statement->fetch();
+}
+}
diff --git a/www/bug.php b/www/bug.php
index a41065a..3d50389 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -1,6 +1,7 @@
 findOneById($bug_id);
 }
 
 // DB error
diff --git a/www/fix.php b/www/fix.php
index 9ec7158..f1be1db 100644
--- a/www/fix.php
+++ b/www/fix.php
@@ -1,5 +1,6 @@
 findOneById($bug_id);
 
 if (!is_array($bug)) {
response_header('No Such Bug');
diff --git a/www/gh-pull-add.php b/www/gh-pull-add.php
index c86d4bd..1821d9e 100644
--- a/www/gh-pull-add.php
+++ b/www/gh-pull-add.php
@@ -1,5 +1,6 @@
 findOneById($bug_id))) {
response_header('Error :: invalid bug selected');
display_bug_error("Invalid bug #{$bug_id} selected");
response_footer();
diff --git a/www/patch-add.php b/www/patch-add.php
index 763a011..f0eaf26 100644
--- a/www/patch-add.php
+++ b/www/patch-add.php
@@ -1,5 +1,6 @@
 findOneById($bug_id))) {
response_header('Error :: invalid bug selected');
display_bug_error("Invalid bug #{$bug_id} selected");
response_footer();
diff --git a/www/patch-display.php b/www/patch-display.php
index 1735b1c..863c386 100644
--- a/www/patch-display.php
+++ b/www/patch-display.php
@@ -1,5 +1,6 @@
 findOneById($bug_id))) {
response_header('Error :: invalid bug selected');
display_bug_error("Invalid bug #{$bug_id} selected");
response_footer();
diff --git a/www/rpc.php b/www/rpc.php
index 8297695..1430c7a 100644
--- a/www/rpc.php
+++ b/www/rpc.php
@@ -1,5

[PHP-WEBMASTER] com web/bugs: Refactor get_resolve_reasons() to repository class: include/functions.php scripts/cron/no-feedback src/Repository/ReasonRepository.php www/bug.php www/fix.php www/quick-f

2018-12-17 Thread Peter Kokot
Commit:a5b6fa0704230cfb13b1fe592ec0908924ccb1a8
Author:Peter Kokot  Sun, 16 Dec 2018 18:08:33 
+0100
Parents:   357ba9e05191981d97a0da68c4014217db96eed3
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=a5b6fa0704230cfb13b1fe592ec0908924ccb1a8

Log:
Refactor get_resolve_reasons() to repository class

Changed paths:
  M  include/functions.php
  M  scripts/cron/no-feedback
  A  src/Repository/ReasonRepository.php
  M  www/bug.php
  M  www/fix.php
  M  www/quick-fix-desc.php
  M  www/report.php


Diff:
diff --git a/include/functions.php b/include/functions.php
index e3d9a97..5384fb4 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1422,38 +1422,6 @@ function unsubscribe($bug_id, $hash)
return true;
 }
 
-
-/**
- * Fetch bug resolves
- *
- * @return array array of resolves
- */
-function get_resolve_reasons($project = false)
-{
-   global $dbh;
-
-   $where = '';
-
-   if ($project !== false) {
-   $project = $dbh->quote($project);
-   $where.= "WHERE (project = {$project} OR project = '')";
-   }
-
-   $resolves = $variations = [];
-   $res = $dbh->prepare("SELECT * FROM bugdb_resolves 
$where")->execute([]);
-   if (!$res) {
-   throw new Exception("SQL Error in get_resolve_reasons");
-   }
-   while ($row = $res->fetch()) {
-   if (!empty($row['package_name'])) {
-   $variations[$row['name']][$row['package_name']] = 
$row['message'];
-   } else {
-   $resolves[$row['name']] = $row;
-   }
-   }
-   return [$resolves, $variations];
-}
-
 /**
  * Fetch bug data
  *
diff --git a/scripts/cron/no-feedback b/scripts/cron/no-feedback
index e3154f8..25f15b5 100755
--- a/scripts/cron/no-feedback
+++ b/scripts/cron/no-feedback
@@ -3,6 +3,8 @@
 
 # this script closes bugs due to lack of feedback.
 
+use App\Repository\ReasonRepository;
+
 require __DIR__.'/../../include/prepend.php';
 
 # date interval to close after
@@ -14,7 +16,9 @@ $in = ['status' => 'No Feedback'];
 # Update relevant reports
 if ($dbh)
 {
-   list($RESOLVE_REASONS, $FIX_VARIATIONS) = get_resolve_reasons($site);
+   $reasonRepository = new ReasonRepository($dbh);
+
+   list($RESOLVE_REASONS, $FIX_VARIATIONS) = 
$reasonRepository->findByProject($site);
 
$res = $dbh->prepare("
SELECT id, package_name, bug_type, email, passwd, sdesc, ldesc, 
php_version,
diff --git a/src/Repository/ReasonRepository.php 
b/src/Repository/ReasonRepository.php
new file mode 100644
index 000..c8d74c8
--- /dev/null
+++ b/src/Repository/ReasonRepository.php
@@ -0,0 +1,55 @@
+dbh = $dbh;
+}
+
+/**
+ * Fetch bug resolves.
+ */
+public function findByProject(string $project = ''): array
+{
+$sql = 'SELECT * FROM bugdb_resolves';
+$arguments = [];
+
+if ($project !== '') {
+$sql = " WHERE (project = ? OR project = '')";
+$arguments[] = $project;
+}
+
+$resolves = $variations = [];
+$statement = $this->dbh->prepare($sql);
+$exec = $statement->execute($arguments);
+
+if (!$exec) {
+throw new \Exception('Error when fetching resolve reasons.');
+}
+
+while ($row = $statement->fetch()) {
+if (!empty($row['package_name'])) {
+$variations[$row['name']][$row['package_name']] = 
$row['message'];
+} else {
+$resolves[$row['name']] = $row;
+}
+}
+
+return [$resolves, $variations];
+}
+}
diff --git a/www/bug.php b/www/bug.php
index 29c10f1..a41065a 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -7,6 +7,7 @@ use App\Repository\PackageRepository;
 use App\Repository\PatchRepository;
 use App\Utils\Captcha;
 use App\Repository\PullRequestRepository;
+use App\Repository\ReasonRepository;
 
 // Obtain common includes
 require_once '../include/prepend.php';
@@ -190,7 +191,8 @@ if ($edit && $edit < 3) {
 
 // Fetch RESOLVE_REASONS array
 if ($edit === 1) {
-   list($RESOLVE_REASONS, $FIX_VARIATIONS) = get_resolve_reasons($project);
+   $reasonRepository = new ReasonRepository($dbh);
+   list($RESOLVE_REASONS, $FIX_VARIATIONS) = 
$reasonRepository->findByProject($project);
 }
 
 if (isset($_POST['ncomment']) && !isset($_POST['preview']) && $edit == 3) {
diff --git a/www/fix.php b/www/fix.php
index 963cb43..9ec7158 100644
--- a/www/fix.php
+++ b/www/fix.php
@@ -1,5 +1,7 @@
 findByProject($site);
 
 // Handle reason / comments
 $reason = filter_var($_REQUEST['r&#

[PHP-WEBMASTER] com web/bugs: Move fetching bug comments to a repository class: include/functions.php src/Repository/CommentRepository.php www/bug.php www/rss/bug.php

2018-12-17 Thread Peter Kokot
Commit:357ba9e05191981d97a0da68c4014217db96eed3
Author:Peter Kokot  Sun, 16 Dec 2018 10:07:30 
+0100
Parents:   7dd4451cd5249c45c46e15a1dded596656ed9a2c
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=357ba9e05191981d97a0da68c4014217db96eed3

Log:
Move fetching bug comments to a repository class

Changes:
- This moves fetching bug comments to a dedicated repository class
- It uses vanilla PDO as current direction of the database usage
  is applied in this app.
- When bug_id is set to preview types issues occur due to int type
  hint. Should be refactored more in the future commits.

Changed paths:
  M  include/functions.php
  A  src/Repository/CommentRepository.php
  M  www/bug.php
  M  www/rss/bug.php


Diff:
diff --git a/include/functions.php b/include/functions.php
index 6206db3..e3d9a97 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1483,26 +1483,6 @@ function bugs_get_bug($bug_id)
 }
 
 /**
- * Fetch bug comments
- *
- * @return mixed array of bug comments or object with error info
- */
-function bugs_get_bug_comments($bug_id)
-{
-   global $dbh;
-
-   $query = "
-   SELECT c.id, c.email, c.comment, c.comment_type,
-   UNIX_TIMESTAMP(c.ts) AS added,
-   c.reporter_name AS comment_name
-   FROM bugdb_comments c
-   WHERE c.bug = ?
-   GROUP BY c.id ORDER BY c.ts
-   ";
-   return $dbh->prepare($query)->execute([$bug_id])->fetchAll();
-}
-
-/**
  * Add bug comment
  */
 function bugs_add_comment($bug_id, $from, $from_name, $comment, $type = 
'comment')
diff --git a/src/Repository/CommentRepository.php 
b/src/Repository/CommentRepository.php
new file mode 100644
index 000..8f28c4b
--- /dev/null
+++ b/src/Repository/CommentRepository.php
@@ -0,0 +1,42 @@
+dbh = $dbh;
+}
+
+/**
+ * Fetch bug comments
+ */
+public function findByBugId(int $id): array
+{
+$sql = 'SELECT c.id, c.email, c.comment, c.comment_type,
+UNIX_TIMESTAMP(c.ts) AS added,
+c.reporter_name AS comment_name
+FROM bugdb_comments c
+WHERE c.bug = ?
+GROUP BY c.id ORDER BY c.ts
+';
+
+$statement = $this->dbh->prepare($sql);
+$statement->execute([$id]);
+
+return $statement->fetchAll();
+}
+}
diff --git a/www/bug.php b/www/bug.php
index 502e50a..29c10f1 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -1,6 +1,7 @@
 findByBugId($bug_id) : 
[];
+
 if ($show_bug_info && is_array($bug_comments) && count($bug_comments) && 
$bug['status'] !== 'Spam') {
$history_tabs = [
'type_all' => 'All',
diff --git a/www/rss/bug.php b/www/rss/bug.php
index 3268404..0546820 100644
--- a/www/rss/bug.php
+++ b/www/rss/bug.php
@@ -1,5 +1,7 @@
 findByBugId($bug_id);
 
 if ($format == 'xml') {
header('Content-type: text/xml; charset=utf-8');


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Remove unused styles and web assets: www/css/style.css www/images/box-0.gif www/images/box-1.gif www/images/item.gif www/images/pecl_item.gif www/images/php_item.gif www/

2018-12-17 Thread Peter Kokot
Commit:7dd4451cd5249c45c46e15a1dded596656ed9a2c
Author:Peter Kokot  Sun, 16 Dec 2018 23:20:48 
+0100
Parents:   14f8c07aec4285ee376f5f88a64d3449e1e6b6ef
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=7dd4451cd5249c45c46e15a1dded596656ed9a2c

Log:
Remove unused styles and web assets

Some of these styles and web assets were used in the past when bug
trackings for PECL and PHP were separated. Today PECL bugs are located
in the bugs.php.net also. This patch removes outdated styles and images.

Changed paths:
  M  www/css/style.css
  D  www/images/box-0.gif
  D  www/images/box-1.gif
  D  www/images/item.gif
  D  www/images/pecl_item.gif
  D  www/images/php_item.gif
  D  www/images/spacer.gif


Diff:
diff --git a/www/css/style.css b/www/css/style.css
index 2efd09d..3f6c000 100644
--- a/www/css/style.css
+++ b/www/css/style.css
@@ -80,44 +80,6 @@ td.head-menu a:visited {
text-decoration: none;
 }
 
-/* = Sidebars = */
-
-td.sidebar_left {
-   width: 149px;
-   background-color: #F0F0F0;
-   vertical-align: top;
-   font-size: 90%;
-   border-right: 1px dashed #ccc;
-   padding: 1em 0.3em 0.3em 0.3em;
-}
-
-td.sidebar_right {
-   width: 149px;
-   background-color: #F0F0F0;
-   vertical-align: top;
-   font-size: 90%;
-   border-left: 1px dashed #ccc;
-   padding: 1em 0.3em 0.3em 0.3em;
-}
-
-table.sidebar-releases {
-   font-size: 100%; /* make IE look normal */
-}
-
-ul.side_pages {
-   margin-top: 0.1em;
-   margin-bottom: 1.5em;
-   margin-left: 1em;
-   padding-left: 1em;
-   list-style: url(../images/box-0.gif) square;
-}
-
-li.side_page {
-   text-indent: -0.4em;
-   white-space: nowrap;
-}
-
-
 /* = Footer = */
 
 td.foot-bar {
@@ -153,16 +115,6 @@ table.form-holder {
width: auto;
 }
 
-caption.form-caption {
-   font-weight: bold;
-   color: #FF;
-   background-color: #5b69a6;
-   padding: 0.3em;
-   border-left: 1px solid #FF;
-   border-right: 1px solid #FF;
-   margin-top: 0.5em;
-}
-
 /* Labels on the left side of form and table rows */
 th.form-label_left {
padding: 3px;
@@ -174,16 +126,6 @@ th.form-label_left {
width: 25%;
 }
 
-/* Labels on the top of form and table columns */
-th.form-label_top,
-th.form-label_top_center {
-   padding: 3px;
-   text-align: center;
-   font-weight: bold;
-   color: #FF;
-   background-color: #5b69a6;
-}
-
 td.form-input {
padding: 3px;
text-align: left;
@@ -203,10 +145,6 @@ td.form-input_center input {
font-size: 90%;
 }
 
-input.makeDocBug {
-   background-color: #8CDD81;
-   border: 3px ridge green;
-}
 p.cell_note {
margin-top: 0.3em;
margin-bottom: 0.2em;
@@ -234,34 +172,6 @@ form {
margin-bottom: 0;
 }
 
-submit {
-   border: 0px;
-}
-
-/* === Voting === */
-
-td.vote-active, td.vote-winner {
-   padding: 3px;
-   text-align: left;
-   vertical-align: top;
-   background-color: #ffbbaa;
-}
-
-td.vote-complete {
-   padding: 3px;
-   text-align: left;
-   vertical-align: top;
-   background-color: #bbaaff;
-}
-
-td.vote-inactive {
-   padding: 3px;
-   text-align: left;
-   vertical-align: top;
-   background-color: #e8e8e8;
-}
-
-
 /* === User Submission Responses === */
 
 div.errors,
@@ -377,27 +287,11 @@ a:hover {
color: #33;
 }
 
-th.headrow {
-   text-align: left;
-   border-bottom: 1px solid #000;
-   white-space: nowrap;
-}
-
 th.others {
color: #006600;
text-align: left;
 }
 
-td.textcell {
-   vertical-align: top;
-   padding-left: 1.2em;
-   padding-bottom: 1em;
-}
-
-td.textcell p {
-   margin-top: 0em;
-}
-
 td.ulcell {
vertical-align: top;
 }
@@ -413,12 +307,6 @@ hr {
background-color: #ccc;
 }
 
-.newsDate {
-   font-size: 85%;
-   font-style: italic;
-   color: #66cc66;
-}
-
 code, pre {
font-family: Consolas, Inconsolata, "Liberation Mono", monospace;
font-size: 13px;
@@ -463,40 +351,10 @@ a.small {
text-decoration: none;
 }
 
-.tableTitle {
-   font-weight: bold;
-}
-
-.tableExtras {
-   font-size: 85%;
-   color: #FF;
-}
-
-.tip {
-   border: 1px solid #00c;
-   color: #006;
-   background: #eef;
-   padding: 8px;
-}
-
-ul.spaced li {
-   margin-bottom: 0.75em;
-}
-
 .indent {
margin-left: 20px;
 }
 
-hr.greyline {
-   border-top: thin solid #CC;
-   margin-top: 0px;
-   margin-bottom: 0px;
-}
-
-.underline {
-   text-decoration: underline;
-}
-
 .accesskey {
text-decoration: underline;
 }
@@ -519,12 +377,6 @@ td.content table {
   padding-bottom: 15px;
 }
 
-.headertop {
-   background: #5b69a6;
-}
-.headersep {
-   background: #33;
-}
 .headerbottom {
backgroun

[PHP-WEBMASTER] com web/bugs: Refactor PDO wrapper: include/functions.php include/prepend.php include/query.php scripts/cron/email-assigned scripts/cron/no-feedback src/Database/Database.php src/Datab

2018-12-17 Thread Peter Kokot
Commit:14f8c07aec4285ee376f5f88a64d3449e1e6b6ef
Author:Peter Kokot  Fri, 14 Dec 2018 15:22:18 
+0100
Parents:   3a9021ab3a0ca634023a73f3c4220b67ba386be0
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=14f8c07aec4285ee376f5f88a64d3449e1e6b6ef

Log:
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.

Changed paths:
  M  include/functions.php
  M  include/prepend.php
  M  include/query.php
  M  scripts/cron/email-assigned
  M  scripts/cron/no-feedback
  D  src/Database/Database.php
  M  src/Database/Statement.php
  M  src/Repository/ObsoletePatchRepository.php
  M  src/Repository/PackageRepository.php
  M  src/Repository/PatchRepository.php
  M  src/Repository/PullRequestRepository.php
  M  src/Utils/GitHub.php
  M  src/Utils/PatchTracker.php
  M  www/admin/index.php
  M  www/api.php
  M  www/bug-pwd-finder.php
  M  www/index.php
  M  www/lstats.php
  M  www/report.php
  M  www/stats.php
  M  www/vote.php

diff --git a/include/functions.php b/include/functions.php
index a45cda0..6206db3 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -279,30 +279,6 @@ function spam_protect($txt, $format = 'html')
 }
 
 /**
- * Escape strings so they can be used as literals in queries
- *
- * @param string|array $in data to be sanitized. If it's an array, 
each element is sanitized.
- *
- * @return string|array  the sanitized data
- *
- * @see oneof(), field(), txfield()
- */
-function escapeSQL($in)
-{
-   global $dbh;
-
-   if (is_array($in)) {
-   $out = [];
-   foreach ($in as $key => $value) {
-   $out[$key] = $dbh->escape($value);
-   }
-   return $out;
-   } else {
-   return $dbh->escape($in);
-   }
-}
-
-/**
  * Goes through each variable submitted and returns the value
  * from the first variable which has a non-empty value
  *
@@ -312,7 +288,7 @@ function escapeSQL($in)
  *
  * @return mixed   the value, if any
  *
- * @see escapeSQL(), field(), txfield()
+ * @see field(), txfield()
  */
 function oneof()
 {
@@ -334,7 +310,7 @@ function oneof()
  *
  * @return mixed   the data requested
  *
- * @see escapeSQL(), oneof(), txfield()
+ * @see oneof(), txfield()
  */
 function field($n)
 {
@@ -1075,13 +1051,13 @@ function get_old_comments($bug_id, $all = 0)
 
// skip the most recent unless the caller wanted all comments
if (!$all) {
-   $row = $res->fetchRow(PDO::FETCH_NUM);
+   $row = $res->fetch(\PDO::FETCH_NUM);
if (!$row) {
return '';
}
}
 
-   while (($row = $res->fetchRow(PDO::FETCH_NUM)) && strlen($output) < 
$max_message_length && $count++ < $max_comments) {
+   while (($row = $res->fetch(\PDO::FETCH_NUM)) && strlen($output) < 
$max_message_length && $count++ < $max_comments) {
$email = spam_protect($row[1], 'text');
$output .= "[{$row[0]}] {$email}\n\n{$row[2]}\n\n{$divider}\n";
}
@@ -1091,

Re: [PHP-WEBMASTER] com web/bugs: Added include/classes to the directory structure: README.md

2018-12-16 Thread Peter Kokot
On Sat, 15 Dec 2018 at 22:48, Kalle Sommer Nielsen  wrote:
>
> Commit:3a9021ab3a0ca634023a73f3c4220b67ba386be0
> Author:Kalle Sommer Nielsen  Sat, 15 Dec 2018 
> 22:47:25 +0100
> Parents:   d9ada8ec72dd0e39e42b8e7f9c94f6c6699cc0d0
> Branches:  master
>
> Link:   
> http://git.php.net/?p=web/bugs.git;a=commitdiff;h=3a9021ab3a0ca634023a73f3c4220b67ba386be0
>
> Log:
> Added include/classes to the directory structure
>
> Changed paths:
>   M  README.md
>
>
> Diff:
> diff --git a/README.md b/README.md
> index 92d5955..47fd759 100644
> --- a/README.md
> +++ b/README.md
> @@ -1,4 +1,4 @@
> -# PHP Bug Tracking System
> +# PHP Bug Tracking System
>
>  This is a unified bug tracking system for PHP hosted online at
>  [bugs.php.net](https://bugs.php.net).
> @@ -46,6 +46,7 @@ Source code of this application is structured in the 
> following directories:
>  /
>   ├─ .git/   # Git configuration and source directory
>   └─ include/# Application helper functions and configuration
> +├─ classes/ # PEAR class overrides
>  ├─ prepend.php  # Autoloader, DB connection, container, app 
> initialization
>  └─ ...
>   └─ scripts/# Command line development tools and scripts
>
>
> --
> PHP Webmaster List Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Hello,

this patch added a file with UTF-8 BOM.

Additionally the includes/classes folder should be on the long run
replaced with src and 0 PEAR classes should be overridden in this app.
Text_Diff - what is currently used in this app is not a PEAR class.
It's a deprecated PEAR package...

-- 
Peter Kokot

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Trim trailing whitespaces: include/query.php templates/search-rdf.php www/admin/index.php www/bug.php www/report.php

2018-12-14 Thread Peter Kokot
On Fri, 14 Dec 2018 at 22:45, Lester Caine  wrote:
>
> On 14/12/2018 21:31, Kalle Sommer Nielsen wrote:
> > Den fre. 14. dec. 2018 kl. 21.12 skrev Lester Caine :
> >> Early strip processing removed the various options of 'new line' but
> >> replacing them with a single space was not necessarily the right answer,
> >> which is why many scripts have a manual space at the end of each line of
> >> text. Just explaining why those spaces had originally been the correct
> >> coding style. There has been a debate recently on extending from an 80
> >> character line default, and stripping line feeds to pad out a longer
> >> line length may well need these spaces reinstating ... just a matter of
> >> preferred coding style when working with SQL rather than other scripts.
> >
> > If you found a bug with the patch, then report it at bugs.php.net so
> > we can look into it, if not then please keep the fuzz off the list,
> > thank you
>
> The comment should be read in the same way as with other comments on
> unnecessary changes to the code simply to address a new style of coding!
> But as with other style changes much of the original rational has never
> been documented at all?

Hello,

the trailing whitespace (the first on the list) are actually regularly
cleaned on multiple repositories. That was a just one missed leftover
from the past. I've missed it then because the script to do this is
not so smart yet. None SQL statements in this app will cause issues
with these trailing whitespaces cleaned. Also no file in this
repository needs trailing whitespace anywhere. Has been checked and we
can safely say to trim all.

It's a pedantic thing. Trailing whitespace doesn't belong anywhere in
the code. On certain editors, the previous state of the code, these
were causing constant conflicts with what to commit and what not. Most
of all, these issues scare new contributors. To avoid causing
unnecessary commit changes such as trimmed trailing whitespaces in
these editors, this is actually a contributor friendly solution so the
maintainer of the repository don't need to comment unfriendly pull
requests and commits comments when this comes up. And the other way
around. And it happens quite a lot of times actually.

We're humans and not machines that can notice some whitespace every
time just like that. One of the reasons that this is done manually
from time to time if needed. That's all.

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-14 Thread Peter Kokot
> But why should there be a wrapper in the first place if we use
> straight PDO? The wrapper doesn't add anything besides the exception
> of a better escaping method. If the wrapper is for unit testing, then
> I still wonder why as its already well tested in php-src.

Like Christoph already mentioned about the PDO wrapper being written
prior to all these changes, two main reasons why more abstraction,
wrapping into its own classes, and more:
1 - Chaining methods was implemented (this is one very nice and major
addition actually). With using raw PDO class and object, this would
not be possible:
$dbh->prepare($query)->execute()->fetchAll()
All these statements can be really one liners actually. Even further
in majority of the SQL queries across the apps there is only a single
most important method to be used and can be wrapped into a "run()" or
similar which combines prepare() and execute() and query() when no
arguments are passed.

2 - And further option to extend this more and use an Adapter for
implementing configuration... But this needs to be rechecked a bit.

PDO wrapper is already smart enough and should stay, however it should
be slightly fixed...

Pull request to address this particular issue is in progress here:
https://github.com/php/web-bugs/pull/60

--
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Trim trailing whitespaces: include/query.php templates/search-rdf.php www/admin/index.php www/bug.php www/report.php

2018-12-14 Thread Peter Kokot
Commit:bae5fa6c4428956efd618bf69038f724875b7de5
Author:Peter Kokot  Fri, 14 Dec 2018 15:20:09 
+0100
Parents:   9b248f9ed6a53dcc6400edbc1e0728c25a44cf89
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=bae5fa6c4428956efd618bf69038f724875b7de5

Log:
Trim trailing whitespaces

Changed paths:
  M  include/query.php
  M  templates/search-rdf.php
  M  www/admin/index.php
  M  www/bug.php
  M  www/report.php


Diff:
diff --git a/include/query.php b/include/query.php
index 028f57a..da996d8 100644
--- a/include/query.php
+++ b/include/query.php
@@ -58,7 +58,7 @@ $commented_by = !empty($_GET['commented_by']) ? 
spam_protect($_GET['commented_by
 if (isset($_GET['cmd']) && $_GET['cmd'] == 'display')
 {
$query = '
-   SELECT SQL_CALC_FOUND_ROWS 
+   SELECT SQL_CALC_FOUND_ROWS
bugdb.*,
TO_DAYS(NOW())-TO_DAYS(bugdb.ts2) AS unchanged,
UNIX_TIMESTAMP(ts1) AS submitted,
diff --git a/templates/search-rdf.php b/templates/search-rdf.php
index 68d3e93..496ddfa 100644
--- a/templates/search-rdf.php
+++ b/templates/search-rdf.php
@@ -2,7 +2,7 @@
 header('Content-type: text/xml');
 
 echo '
-http://www.w3.org/2000/08/w3c-synd/style.css"; type="text/css"
 ?>
 http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 
xmlns="http://purl.org/rss/1.0/";
diff --git a/www/admin/index.php b/www/admin/index.php
index e6f381b..f7952a5 100644
--- a/www/admin/index.php
+++ b/www/admin/index.php
@@ -51,8 +51,8 @@ if ($action === 'phpinfo') {
 } elseif ($action === 'list_lists') {
 
$res = $dbh->query("
-   SELECT name, list_email 
-   FROM bugdb_pseudo_packages 
+   SELECT name, list_email
+   FROM bugdb_pseudo_packages
WHERE project = 'php'
AND LENGTH(list_email) > 0
ORDER BY list_email
diff --git a/www/bug.php b/www/bug.php
index 2dbb79c..502e50a 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -1162,10 +1162,10 @@ function do_comment(nd)
 {
$('#comment_filter > .control.active').removeClass("active");
$(nd).addClass("active");
-   
+
$.cookie('history_tab', nd.id, { expires: 365 });
-   
-   if (nd.id == 'type_all') { 
+
+   if (nd.id == 'type_all') {
$('#comments_view > .comment:hidden').show('slow');
} else {
$('#comments_view > .comment').each(function(i) {
diff --git a/www/report.php b/www/report.php
index 4ff4869..017cea1 100644
--- a/www/report.php
+++ b/www/report.php
@@ -117,7 +117,7 @@ if (isset($_POST['in'])) {
 
foreach ($possible_duplicates as $row) {
$resolution = $dbh->prepare("
-   SELECT comment 
+   SELECT comment
FROM bugdb_comments
WHERE bug = ?
ORDER BY id DESC


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-13 Thread Peter Kokot
On Wed, 12 Dec 2018 at 21:11, Peter Kokot  wrote:
>
> On Wed, 12 Dec 2018 at 11:43, Christoph M. Becker  wrote:
> >
> > On 12.12.2018 at 05:32, Kalle Sommer Nielsen wrote:
> >
> > > Den ons. 12. dec. 2018 kl. 05.23 skrev Peter Kokot :
> > >>
> > >> Wait... Why do we then even have use statements in PHP if we can always
> > >> require_once a class file where needed and we're done with it. Your
> > >> explanation of requiring only files from a pool of files sounds very 
> > >> simple
> > >> and even something to go implement it (read undo). However:
> > >>
> > >> require_once 'User.php';
> > >> require_once 'Repository/User.php';
> > >
> > > I think you misunderstood, or perhaps I phrased myself poorly. It's
> > > the same clutter in the top of a file is what I meant to make a point
> > > about as thats how I read your response initially.
> >
> > Namespaces and imports (`use`) are not directly related to auto-loading
> > vs. manual loading (`require`).
> >
> > >> PDO wrapper is in need of something better. I didn't want it to refactor 
> > >> it
> > >> yet what it should be for a unit testeable piece of code.
> > >
> > > But why should there be a wrapper in the first place if we use
> > > straight PDO? The wrapper doesn't add anything besides the exception
> > > of a better escaping method. If the wrapper is for unit testing, then
> > > I still wonder why as its already well tested in php-src.
> >
> > The PDO wrapper was already there before Peter started extensive work on
> > the bug tracker; certainly, as already suggested in the class' doc block
> > comment, it could be removed *sometime*.
> >
> > Let's face it, the bugtracker is (or has been a few weeks ago) legacy
> > code, at least according to Michael Feather's definition (“To me, legacy
> > code is simply code without tests.”[1])  It's hard to impossible to unit
> > test procedural code, so it seems not unreasonable to me to rewrite it
> > to something that can be unit tested, if there are resources to do so.
> >
> > The argument “we shouldn't use an autoloader, since it is often misused
> > to load static classes” is moot, since there don't seem to be any static
> > classes.  The point Sara made a while ago on internals, namely that
> > php.net shouldn't use a framework to not endorse any particular
> > framework[2] is valid, but in my opinion, that does not necessarily
> > apply to Composer and PHPUnit, since both are de-factor standards in the
> > PHP community for a long time (and to my knowledge, there are no still
> > maintained alternatives).  Of course, we could roll our own, but I see
> > no point in re-inventing the wheel here.
> >
> > Anyhow, since these changes are apparenlty controversial, it might be
> > sensible to apply them in a feature branch, and to present a “final”
> > version as pull-request.  On the other hand, I understand that it would
> > be very frustrating to spend days on such a pull-request, which is
> > finally rejected or even ignored.
> >
> > [1] Feathers, Michael. Working Effectively with Legacy Code (Robert C.
> > Martin Series) (Kindle-Position229). Pearson Education. Kindle-Version.
> > [2] <https://externals.io/message/103048#103049>
> >
> > --
> > Christoph M. Becker

Hello, assuming that we want to at least test some code in the app and
install locally some dependency, here is a quick explanation why
autoloader matters and is actually required in cases of applications
such as bugs.php.net (logins, database access, uploading files and
more):
https://github.com/petk/autoloading-tutorial

1.) The php-5.2 folder contains what was aimed in this conversation
also I think:
No namespaces and no autoloading would require to have the most
difficult testing and most legacy looking code available.

2.) The "no-autoloader" folder has example with namespaces and no autoloader:
- Similar issue with testing code and as soon as library class is required

3.) The "autoloader" folder contains autoloader and namespaces
- the testing example is much more simplified and usable than all previous ones

Now, if we imagine adding more classes in the application, yes, more
complexity comes, but also more flexibility with testing, and using
the code across the app. Currently we have functions used, mixing SQL,
HTML, and PHP code in same files. Not to mention globals in some
functions which is also an issue.

Something like this.

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] Stale branches for web/pecl repository

2018-12-13 Thread Peter Kokot
Hello, there are 3 so called stale branches that got stuck:
https://github.com/php/web-pecl/branches

The "maint":
https://github.com/php/web-pecl/commits/maint
and "old_auth":
https://github.com/php/web-pecl/tree/old_auth
which are both already fully integrated in the web/pecl master branch.

Should we remove these two from the Git repository?

I'm about to recheck the "next" branch soon:
https://github.com/php/web-pecl/tree/next
It seems that a complete site redesign was being done and then moving
to pickleweb but as I imagine the entire project is too complicated
for creating a separate branch and discussion after the long and hard
working commits are done. Mainly, some changes will definitely be
useful from this branch to integrate to master branch...

Thanks.
-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] pecl.php.net download proxy script

2018-12-13 Thread Peter Kokot
Hello,

a question about the pecl.php.net site that might be stopping server upgrades.

The extension download URL endpoint is:
https://pecl.php.net/get/operator

This is a PHP proxy download script that do some checks and outputs
non standard header for Apache webserver and mod_xsendfile to offer a
direct file download as it was a static file. That way there is very
little performance overhead and option that request goes through a PHP
script.

However, this mod_xsendfile isn't maintained anymore. And installation
on today's Linux distros might not be so trivial anymore without
patching the module's C code and compiling it manually. Overall, I'm
not sure if using non standard Apache modules here is a good approach
for production. Not to mention the portability of the app for the
local testing environments.

What would be the absolute right way to go here? A PHP only proxy
downloader endpoint would be sufficient? Do you think performance
would suffer greatly?

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] PECL Admin access

2018-12-12 Thread Peter Kokot
On Wed, 12 Dec 2018 at 03:44, Peter Kokot  wrote:
>
> On Tue, 11 Dec 2018 at 10:50, Derick Rethans  wrote:
> >
> > On Mon, 10 Dec 2018, Peter Kokot wrote:
> >
> > > On Mon, 10 Dec 2018 at 20:19, Derick Rethans  wrote:
> > > >
> > > > I think with your changes to pecl web, you might inadvertently have
> > > > disabled admin access? I used to be able to approve accounts, but
> > > > the link is now longer there.
> > >
> > > Checking it out... I've tested login locally just now and it should
> > > work. On PHP 5.6 and later versions... The link to the administration
> > > where user requests are listed should be this:
> > > https://pecl.php.net/admin/ (and also listed for the accounts with
> > > admin privileges)
> > >
> > > Is there anything visible on that link? Or is the login disabled
> > > completely?
> >
> > That links gives me:
> >
> > ERROR:
> >
> > Insufficient Privileges
> >
> >
> > But, I can login properly, upload releases, etc.
>
> Hello, issue located, will be resolved shortly:
> https://github.com/php/web-pecl/pull/70

Hello, according to my checking this one should now work. Let me know
if it doesn't.

--
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-12 Thread Peter Kokot
On Wed, 12 Dec 2018 at 11:43, Christoph M. Becker  wrote:
>
> On 12.12.2018 at 05:32, Kalle Sommer Nielsen wrote:
>
> > Den ons. 12. dec. 2018 kl. 05.23 skrev Peter Kokot :
> >>
> >> Wait... Why do we then even have use statements in PHP if we can always
> >> require_once a class file where needed and we're done with it. Your
> >> explanation of requiring only files from a pool of files sounds very simple
> >> and even something to go implement it (read undo). However:
> >>
> >> require_once 'User.php';
> >> require_once 'Repository/User.php';
> >
> > I think you misunderstood, or perhaps I phrased myself poorly. It's
> > the same clutter in the top of a file is what I meant to make a point
> > about as thats how I read your response initially.
>
> Namespaces and imports (`use`) are not directly related to auto-loading
> vs. manual loading (`require`).
>
> >> PDO wrapper is in need of something better. I didn't want it to refactor it
> >> yet what it should be for a unit testeable piece of code.
> >
> > But why should there be a wrapper in the first place if we use
> > straight PDO? The wrapper doesn't add anything besides the exception
> > of a better escaping method. If the wrapper is for unit testing, then
> > I still wonder why as its already well tested in php-src.
>
> The PDO wrapper was already there before Peter started extensive work on
> the bug tracker; certainly, as already suggested in the class' doc block
> comment, it could be removed *sometime*.
>
> Let's face it, the bugtracker is (or has been a few weeks ago) legacy
> code, at least according to Michael Feather's definition (“To me, legacy
> code is simply code without tests.”[1])  It's hard to impossible to unit
> test procedural code, so it seems not unreasonable to me to rewrite it
> to something that can be unit tested, if there are resources to do so.
>
> The argument “we shouldn't use an autoloader, since it is often misused
> to load static classes” is moot, since there don't seem to be any static
> classes.  The point Sara made a while ago on internals, namely that
> php.net shouldn't use a framework to not endorse any particular
> framework[2] is valid, but in my opinion, that does not necessarily
> apply to Composer and PHPUnit, since both are de-factor standards in the
> PHP community for a long time (and to my knowledge, there are no still
> maintained alternatives).  Of course, we could roll our own, but I see
> no point in re-inventing the wheel here.
>
> Anyhow, since these changes are apparenlty controversial, it might be
> sensible to apply them in a feature branch, and to present a “final”
> version as pull-request.  On the other hand, I understand that it would
> be very frustrating to spend days on such a pull-request, which is
> finally rejected or even ignored.
>
> [1] Feathers, Michael. Working Effectively with Legacy Code (Robert C.
> Martin Series) (Kindle-Position229). Pearson Education. Kindle-Version.
> [2] <https://externals.io/message/103048#103049>
>
> --
> Christoph M. Becker

Quite a lot of different things are being discussed here. I'll see if
I can address them all in the near future or one by one...

I just wanted to add some more logical Composer pros (without any dep at all):
- required PHP extensions are listed in the composer.json
- required PHP version is listed in the composer.json
- project meta data is listed in the composer.json

I assume that suggesting things like dependency injection container
(DIC) or a template engine (in PHP style, not something reinvented and
not using Twig/Blade syntax) to split presentation level with XSS
dangers on every step and business logic a bit would cause similar
galactic level conflicts?

Otherwise I appreciate every single feedback actually here. It is
quite welcome to hear something at least than not hear anything :)
-- 
Peter Kokot

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-11 Thread Peter Kokot
Wait... Why do we then even have use statements in PHP if we can always
require_once a class file where needed and we're done with it. Your
explanation of requiring only files from a pool of files sounds very simple
and even something to go implement it (read undo). However:

require_once 'User.php';
require_once 'Repository/User.php';

PDO wrapper is in need of something better. I didn't want it to refactor it
yet what it should be for a unit testeable piece of code.

On Wed, 12 Dec 2018, 04:56 Kalle Sommer Nielsen  Den ons. 12. dec. 2018 kl. 00.56 skrev Peter Kokot :
> > Is there any existing example currently used somewhere? I'm not sure I
> > fully understand this but there might be something on this. With this,
> > use statements are not utilized I assume and it goes a bit away from
> > modern OOP coding practices where each file will still need to have
> > require_once statements for every required class. Yes?
> >
> > Would code look nicer or more complicated than this example?
>
> Well conceptionally the same could be said about a long list of "use
> X\Y\Z;" vs a require_once statement. I mean sure an autoloader is
> convinent but it also depends on the actual OOP usage (see below
> comments for example)
>
> > - PSR-4 compliant Autoloader class:
> > https://github.com/php/web-bugs/blob/master/src/Autoloader.php
> > - Requiring a single auoloader on a single place in the app (this is
> > dual loader because of lack of Composer in production):
> > https://github.com/php/web-bugs/blob/master/include/prepend.php
>
> Well they would look just about the same, because what essentially
> being done is to separate the small bits and pieces from the prepend
> script into multiple files is how I understand the argument here. I
> mean sure the prepend script is not pretty, but its a bootstraper.
>
> The database class improvements[1] should be straight PDO for the most
> part:
> - Passing the statement class should be done with the other set of $options
> - Instead of implementing methods like queryAll(), the statement fetch
> methods etc, the code using it should have been updated instead since
> we are not using MDB2 anymore anyway, so no need to emulate that
> naming
> - The statement execute method chaining is nice but again the code
> should be just updated to reflect PDO
> - The PDO quote method is a bit tricker, but instead a simple
> procedural function could be implemented to wrap around it in 3 lines,
> which would fit functions.php as database access is pretty much used
> on every page in www/
> - Only loaded once in the bootstraper and it is on pretty much every
> request (because of the authentication check for the navigational
> links if you are logged in)
>
> Similar to what Levi stated in a mail earlier, many projects just
> implement classes with static methods because it can be easily
> autoloaded. Many of these classes just implement "static" methods  for
> the sake of autoloading (or so it seems)[2], like:
> - \App\Repository\ObsoletePatchRepository - Have a constructor to
> shave off a single argument for two methods
> - \App\Repository\PackageRepository - Same as above (array keys for
> the constant array is even redudant)
> - \App\Repository\PatchRepository - Same for a database handle, it
> uses a global constant to set a constant value of a property for a
> private method thats only called once in a non loop
> - \App\Repository\PullRequestRepository - Same for a dabase handle
>
> (Besides I find the "Repository" suffix odd considering they are all
> in the "\App\Repository" namespace anyway, but its irrelevant)
>
> I didn't look too much at the other classes. I get abstracting some
> things to make it more flawless, is good. The uploading API in PHP is
> kinda interesting to the the least, but we only really allow uploads
> in one place (patches), but isn't 200+ lines of abstraction for one
> place to upload files, including special methods purely for testing, a
> bit overkill?
>
>
> [1]
> https://git.php.net/?p=web/bugs.git;a=commit;h=73062503a65bfa62d5f2f365ee99269225580bb9
> [2]
> https://git.php.net/?p=web/bugs.git;a=tree;f=src;h=7b80bef6e77759c469295827e920d92b4216f87d;hb=HEAD
>
>
>
> --
> regards,
>
> Kalle Sommer Nielsen
> ka...@php.net
>
> --
> PHP Webmaster List Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


>


Re: [PHP-WEBMASTER] PECL Admin access

2018-12-11 Thread Peter Kokot
On Tue, 11 Dec 2018 at 10:50, Derick Rethans  wrote:
>
> On Mon, 10 Dec 2018, Peter Kokot wrote:
>
> > On Mon, 10 Dec 2018 at 20:19, Derick Rethans  wrote:
> > >
> > > I think with your changes to pecl web, you might inadvertently have
> > > disabled admin access? I used to be able to approve accounts, but
> > > the link is now longer there.
> >
> > Checking it out... I've tested login locally just now and it should
> > work. On PHP 5.6 and later versions... The link to the administration
> > where user requests are listed should be this:
> > https://pecl.php.net/admin/ (and also listed for the accounts with
> > admin privileges)
> >
> > Is there anything visible on that link? Or is the login disabled
> > completely?
>
> That links gives me:
>
> ERROR:
>
> Insufficient Privileges
>
>
> But, I can login properly, upload releases, etc.

Hello, issue located, will be resolved shortly:
https://github.com/php/web-pecl/pull/70


-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-11 Thread Peter Kokot
On Wed, 12 Dec 2018 at 00:29, Levi Morrison  wrote:
>
> On Tue, Dec 11, 2018 at 2:01 PM Peter Kokot  wrote:
> >
> > On Tue, 11 Dec 2018 at 21:33, Levi Morrison  wrote:
> > >
> > > On Tue, Dec 11, 2018 at 8:16 AM Derick Rethans  wrote:
> > > >
> > > > On Tue, 11 Dec 2018, Christoph M. Becker wrote:
> > > >
> > > > > On 11.12.2018 at 13:42, Kalle Sommer Nielsen wrote:
> > > > >
> > > > > > Den man. 10. dec. 2018 kl. 23.01 skrev Christoph M. Becker 
> > > > > > :
> > > > > >
> > > > > >> It seems to me that it might be valuable to agree on a common
> > > > > >> coding standard for *all* php.net PHP scripts, not only the web
> > > > > >> related ones, but also the helper scripts in php-src, etc.
> > > > > >> Therefore, it might be appropriate to discuss this on internals@.
> > > > > >> Perhaps we should even have an RFC about this.
> > > > > >
> > > > > > Perhaps, but I think its still a unified agreement from way back to
> > > > > > use PEAR CS for any PHP at php.net, what I think we should do is to
> > > > > > better advertise it for new contributors (I think opening the
> > > > > > discussion about a potential new CS is gonna be way too political
> > > > > > for practical no reason).
> > > > >
> > > > > PEAR CS has been fine, but it seems to me that it's pre PHP 5.3, if
> > > > > not even pre PHP 5.0.  Consider, for instance, the naming
> > > > > conventions[1], which completely ignore the possibility of
> > > > > namespacing.  And they mandate: “Private class members are preceded by
> > > > > a single underscore.” Furthermore, the header comment blocks[2] are
> > > > > too picky (and don't even support PHP 7[3]).
> > > > >
> > > > > If we want to go with PEAR CS, we should point out exceptions to these
> > > > > rules, and perhaps amend the PEAR CS slightly for our purposes.
> > > >
> > > > Sorry, but PEAR is from 1999. The PHP world has moved on now, and it
> > > > makes perfect sense to use common PHP development practises. This
> > > > includes not reinventing the wheel by (re-)using Composer packages, and
> > > > using a CS standard that people currently writing PHP code are familiar
> > > > with. And that means using PSR-x. We'd want to encourage new people
> > > > stepping up and helping out like Peter is doing, and using modern
> > > > practises is going to help with that. People like shiny, and not 20 year
> > > > old legacy apps.
> > > >
> > > > cheers,
> > > > Derick
> > > >
> > > > --
> > > > https://derickrethans.nl | https://xdebug.org | https://dram.io
> > > > Like Xdebug? Consider a donation: https://xdebug.org/donate.php,
> > > > or become my Patron: https://www.patreon.com/derickr
> > > > twitter: @derickr and @xdebug
> > > >
> > > > --
> > > > PHP Webmaster List Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > > First, thanks Peter for actually spending some time on these projects.
> > > We all know they need more attention.
> > >
> > > Second, the vast majority of the changes I've seen made are changes
> > > for change's sake. These are likely to cause bugs which is a step in
> > > the wrong direction. I would much prefer that we do not do this. Can
> > > we please make these changes while we are also looking into bug fixes
> > > or enhancements?
> > >
> > > Third, my opinion is that PHP.net should not be using an auto-loader.
> > > I've seen tons of projects that have classes that contain only static
> > > methods, and they do this because now it can be easily autoloaded.
> > > This is backwards -- the design should dictate how code is loaded, not
> > > the other way around. Therefore, it does not matter if the site uses
> > > PSR-4 or not.
> > >
> > > Fourth, I will probably not participate much more in this discussion.
> > > It's prone to arguments and debates which I just don't have time for
> > > right now.
> > >
> > > Good luck, Peter, and I hope everyone has enjoyable end-of-year holidays.
> >
> > A lack of aut

Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-11 Thread Peter Kokot
On Tue, 11 Dec 2018 at 21:33, Levi Morrison  wrote:
>
> On Tue, Dec 11, 2018 at 8:16 AM Derick Rethans  wrote:
> >
> > On Tue, 11 Dec 2018, Christoph M. Becker wrote:
> >
> > > On 11.12.2018 at 13:42, Kalle Sommer Nielsen wrote:
> > >
> > > > Den man. 10. dec. 2018 kl. 23.01 skrev Christoph M. Becker 
> > > > :
> > > >
> > > >> It seems to me that it might be valuable to agree on a common
> > > >> coding standard for *all* php.net PHP scripts, not only the web
> > > >> related ones, but also the helper scripts in php-src, etc.
> > > >> Therefore, it might be appropriate to discuss this on internals@.
> > > >> Perhaps we should even have an RFC about this.
> > > >
> > > > Perhaps, but I think its still a unified agreement from way back to
> > > > use PEAR CS for any PHP at php.net, what I think we should do is to
> > > > better advertise it for new contributors (I think opening the
> > > > discussion about a potential new CS is gonna be way too political
> > > > for practical no reason).
> > >
> > > PEAR CS has been fine, but it seems to me that it's pre PHP 5.3, if
> > > not even pre PHP 5.0.  Consider, for instance, the naming
> > > conventions[1], which completely ignore the possibility of
> > > namespacing.  And they mandate: “Private class members are preceded by
> > > a single underscore.” Furthermore, the header comment blocks[2] are
> > > too picky (and don't even support PHP 7[3]).
> > >
> > > If we want to go with PEAR CS, we should point out exceptions to these
> > > rules, and perhaps amend the PEAR CS slightly for our purposes.
> >
> > Sorry, but PEAR is from 1999. The PHP world has moved on now, and it
> > makes perfect sense to use common PHP development practises. This
> > includes not reinventing the wheel by (re-)using Composer packages, and
> > using a CS standard that people currently writing PHP code are familiar
> > with. And that means using PSR-x. We'd want to encourage new people
> > stepping up and helping out like Peter is doing, and using modern
> > practises is going to help with that. People like shiny, and not 20 year
> > old legacy apps.
> >
> > cheers,
> > Derick
> >
> > --
> > https://derickrethans.nl | https://xdebug.org | https://dram.io
> > Like Xdebug? Consider a donation: https://xdebug.org/donate.php,
> > or become my Patron: https://www.patreon.com/derickr
> > twitter: @derickr and @xdebug
> >
> > --
> > PHP Webmaster List Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> First, thanks Peter for actually spending some time on these projects.
> We all know they need more attention.
>
> Second, the vast majority of the changes I've seen made are changes
> for change's sake. These are likely to cause bugs which is a step in
> the wrong direction. I would much prefer that we do not do this. Can
> we please make these changes while we are also looking into bug fixes
> or enhancements?
>
> Third, my opinion is that PHP.net should not be using an auto-loader.
> I've seen tons of projects that have classes that contain only static
> methods, and they do this because now it can be easily autoloaded.
> This is backwards -- the design should dictate how code is loaded, not
> the other way around. Therefore, it does not matter if the site uses
> PSR-4 or not.
>
> Fourth, I will probably not participate much more in this discussion.
> It's prone to arguments and debates which I just don't have time for
> right now.
>
> Good luck, Peter, and I hope everyone has enjoyable end-of-year holidays.

A lack of autoloader means also lack of OOP then. Back to complete
functional programming for bugs.php.net and pecl.php.net? I'm not sure
I even know how to code like that anymore :)

-- 
Peter Kokot

--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-11 Thread Peter Kokot
> On a similar topic I feel very strongly against using any PSR's for php.net.

This then means not using PSR-4, and not using Composer. How will PHP
sites solve issue of dependencies then and how to unit test this code?

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/bugs: Refactor get_pseudo_packages() to repository class: include/functions.php include/query.php src/Database/Database.php src/Repository/PackageRepository.php www/bug.php www

2018-12-10 Thread Peter Kokot
Commit:9b248f9ed6a53dcc6400edbc1e0728c25a44cf89
Author:Peter Kokot  Mon, 10 Dec 2018 01:41:56 
+0100
Parents:   0173592272937e4c8c480da9932bbd418aef69eb
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=9b248f9ed6a53dcc6400edbc1e0728c25a44cf89

Log:
Refactor get_pseudo_packages() to repository class

Changes:
- get_pseudo_packages() function is moved to its own repository class.
- Database::queryAll() removed since it is not used and the method
  arguments don't match the number of used arguments anymore
- Project types configuration is moved to repository class for now.
- Some unused items removed
- Some template changes and show_project_options() helper function
  integrated in the view layer directly since it is used in a simplified
  way.

Changed paths:
  M  include/functions.php
  M  include/query.php
  M  src/Database/Database.php
  A  src/Repository/PackageRepository.php
  M  www/bug.php
  M  www/lstats.php
  M  www/patch-display.php
  M  www/report.php
  M  www/search.php
  M  www/stats.php

diff --git a/include/functions.php b/include/functions.php
index 8f35fe2..04ec1bb 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -33,11 +33,6 @@ $bug_types = [
'Security' => 'Sec Bug'
 ];
 
-$project_types = [
-   'PHP'   => 'php',
-   'PECL'  => 'pecl'
-];
-
 // Used in show_state_options()
 $state_types = [
'Open'  => 2,
@@ -192,70 +187,6 @@ function bugs_authenticate (&$user, &$pw, &$logged_in, 
&$user_flags)
}
 }
 
-/**
- * Fetches pseudo packages from database
- *
- * @param string   $projectdefine what project 
pseudo packages are returned
- * @param bool $return_disabledwhether to return read-only 
items, defaults to true
- *
- * @return array   array of pseudo packages
- */
-function get_pseudo_packages($project, $return_disabled = true)
-{
-   global $dbh, $project_types;
-
-   $pseudo_pkgs = $nodes = $tree = [];
-   $where = '1=1';
-   $project = strtolower($project);
-
-   if ($project !== false && in_array($project, $project_types)) {
-   $where .= " AND project IN ('', '$project')";
-   }
-   if (!$return_disabled) {
-   $where.= " AND disabled = 0";
-   }
-
-   $data = $dbh->queryAll("SELECT * FROM bugdb_pseudo_packages WHERE 
$where ORDER BY parent, disabled, id", null, PDO::FETCH_ASSOC);
-
-   // Convert flat array to nested strucutre
-   foreach ($data as &$node)
-   {
-   $node['children'] = [];
-   $id = $node['id'];
-   $parent_id = $node['parent'];
-   $nodes[$id] =& $node;
-
-   if (array_key_exists($parent_id, $nodes)) {
-   $nodes[$parent_id]['children'][] =& $node;
-   } else {
-   $tree[] =& $node;
-   }
-   }
-
-   foreach ($tree as $data)
-   {
-   if (isset($data['children'])) {
-   $pseudo_pkgs[$data['name']] = [$data['long_name'], 
$data['disabled'], []];
-   $children = &$pseudo_pkgs[$data['name']][2];
-   $long_names = [];
-   foreach ($data['children'] as $k => $v) {
-   $long_names[$k] = strtolower($v['long_name']);
-   }
-   array_multisort($long_names, SORT_ASC, SORT_STRING, 
$data['children']);
-   foreach ($data['children'] as $child)
-   {
-   $pseudo_pkgs[$child['name']] = 
["{$child['long_name']}", $child['disabled'], null];
-   $children[] = $child['name'];
-   }
-
-   } elseif (!isset($pseudo_pkgs[$data['name']])) {
-   $pseudo_pkgs[$data['name']] = [$data['long_name'], 
$data['disabled'], null];
-   }
-   }
-
-   return $pseudo_pkgs;
-}
-
 /* Primitive check for SPAM. Add more later. */
 function is_spam($string)
 {
@@ -529,40 +460,6 @@ function show_limit_options($limit = 30)
 }
 
 /**
- * Prints bug project 's for use in a 
- *
- * Options include "PHP" and "PECL".
- *
- * @param string   $currentbug's current project
- * @param bool $allwhether or not 'All' should be an option
- *
- * @retun void
- */
-function show_project_options($current = 'php', $all = false)
-{
-   gl

[PHP-WEBMASTER] com web/bugs: Add contributing procedure: README.md

2018-12-10 Thread Peter Kokot
Commit:0173592272937e4c8c480da9932bbd418aef69eb
Author:Peter Kokot  Tue, 11 Dec 2018 02:04:27 
+0100
Parents:   001a1dbe21cf6b61c6cc8d45afaa2d5c8cb7c6e7
Branches:  master

Link:   
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=0173592272937e4c8c480da9932bbd418aef69eb

Log:
Add contributing procedure

Changed paths:
  M  README.md


Diff:
diff --git a/README.md b/README.md
index 799e64b..92d5955 100644
--- a/README.md
+++ b/README.md
@@ -69,3 +69,36 @@ Source code of this application is structured in the 
following directories:
  ├─ phpunit.xml.dist# PHPUnit's default XML configuration
  └─ ...
 ```
+
+## Contributing
+
+Issues with the application and new feature requests can be reported to
+[bugs.php.net](https://bugs.php.net) and discussed by sending message to the
+[webmaster mailing list](http://news.php.net/php.webmaster) to the address
+php-webmaster@lists.php.net.
+
+Application source code is located in the
+[git.php.net](https://git.php.net/?p=web/bugs.git) repository.
+
+Contributions can be done by forking the [GitHub 
mirror](https://github.com/php/web-bugs)
+repository and sending a pull request.
+
+```bash
+git clone g...@github.com:your-username/web-bugs
+cd web-bugs
+git checkout -b patch-1
+git add .
+git commit -m "Describe changes"
+git push origin patch-1
+```
+
+A good practice is to also set the upstream remote in case the upstream master
+branch updates. This way your master branch will track remote upstream master
+branch of the root repository.
+
+```bash
+git checkout master
+git remote add upstream git://github.com/php/web-bugs
+git config branch.master.remote upstream
+git pull --rebase
+```


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] PECL Admin access

2018-12-10 Thread Peter Kokot
On Mon, 10 Dec 2018 at 20:19, Derick Rethans  wrote:
>
> Hi,
>
> I think with your changes to pecl web, you might inadvertently have
> disabled admin access? I used to be able to approve accounts, but the
> link is now longer there.
>
> cheers,
> Derick
>

Checking it out... I've tested login locally just now and it should
work. On PHP 5.6 and later versions... The link to the administration
where user requests are listed should be this:
https://pecl.php.net/admin/
(and also listed for the accounts with admin privileges)

Is there anything visible on that link? Or is the login disabled completely?


--
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/master: Refactor long array() syntax to short []: entry/event.php entry/subscribe.php entry/svn-account.php entry/user-note.php entry/user-notes-vote.php fetch/allusers.php

2018-12-10 Thread Peter Kokot
Hello,

> Why? Please tell me it's not change for change's sake.

It unfortunately is, yes :/. I understand that this app is not ready
for stepping into the 2019 and PHP 7.3 yet but by refactoring these
smaller things step by step is one way to deal with the later bigger
and more problematic things such as removed PHP core extensions and
security...

Thanks for your understanding and support.

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-10 Thread Peter Kokot
> But there still have not been any discussion on the webmaster list,
> which is where we discuss such things at all, that is what baffles me
> the most that such a move has not even been mentioned here, which is
> where the development of the website systems takes place.

Acknowledged. Sorry for not forwarding this here sooner. I kind of
assumed this was resolved and is only waiting for a merge and
adjustments. Then, let's see what we can do here then about that if
anyone disagrees with using Composer locally (please note that using
Composer in production will need a discussion if not even omitting it
as a deployment step altogether because it's not a trivial task for
server nor a deployment). I can reopen this discussion for sure and we
can go through it.

> That is fine and all that PEAR itself is getting obsolete, but if we
> break down the dependencies then its all native PHP besides the
> Text_Diff component you mentioned. I don't really think anyone uses
> this as a standalone bug tracker anyway as its so baked into the
> PHP.net systems and not customizable so I kinda fail to see the point
> when its only running on one machine. I'm sorry for the blantness but
> it seems a bit pointless to me. I mean sure if you are installing and
> developing locally but its such a minority.

Option to install development dependencies locally, for example
phpunit and some other possible things (database fixtures etc) is
actually a major bonus feature for this app. We can also hook travis
CI into this one day and more. Theoretically, you can install entire
app locally with only a single "composer install" and it takes care of
several steps for the contributor. I understand that this is an
installation used on bugs.php.net only but this doesn't mean that
convenience of setting such app locally or in a Docker container
should be omitted with removing Composer.

> As for CS, we have always refered to the PEAR Coding standards[1]
> (with a minor exception to the examples in the PHP documentation as
> noted in the tutorial[2]), and I don't see any discussion about
> changing this anywhere on the discussions nor making it for web/bugs
> only so far.
>
> I don't want this to come out as too negative, whilst I do appreciate
> the care being taken to update the system, I just prefer we do it with
> discussions where we all can chime in, I do miss most of them as I'm
> only subbed to the php-src on github (webmaster ML is the official).
>
> [1] http://pear.php.net/manual/en/standards.php
> [2] http://doc.php.net/tutorial/style.php

You don't come negative. Thanks for this info and pointing it out.
And, I think that's mostly solved then and it's very the same as PEAR
coding standards. Actually, PEAR's coding style would be a great
addition in the current files. Current .editorconfig file uses exactly
the same configuration as PEAR's instructions:
- spaces as indentation, no tabs
- LF as line ending
- UTF-8 file encoding
- final new lines are also mentioned in a way
(The only additionaly feature is trailing whitespaces trim which is
something logical on its own, I think)

The EditorConfig doesn't deal with anything else here actually :)
other tools like code fixers etc. can be adjusted to use something
like PEAR's coding style also but that's none of the changes mentioned
yet nor even planned from my side as some sort of conspiracy or
anything. I just locally run php-cs-fixer on the code that I produce
from time to time. That's it.


-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-WEBMASTER] com web/bugs: Add .editorconfig file: .editorconfig

2018-12-10 Thread Peter Kokot
Hello,

On Mon, 10 Dec 2018 at 09:07, Kalle Sommer Nielsen  wrote:
> Where and when was all this decided and discussed to move forward with
> composer usage and all these other improvements? Don't get me wrong,
> it's not that I do not appreciate the activity and work going into the
> website code but I have not seen anywhere where this was posted on the
> webmaster list and agreed with the other active webmasters.
>
> I myself am not keen on this as we have notoriously been reliant on
> our own infrastructure (PEAR), but no that its almost safe to say its
> 'dead', there should be a discussion and debate first before radical
> changes out of the 'blue'.
>
> regards,
>
> Kalle Sommer Nielsen
> ka...@php.net

Composer has been under discussion over a year now, so it's a pretty
logical choice I think. I'm not sure if there's anything else besides
Composer today out there that can install dependencies in such a
breeze...
https://github.com/php/web-bugs/pull/27

PEAR dependencies themselves have been made obsolete also in some commits here:
http://git.php.net/?p=web/bugs.git;a=commit;h=23298a123688443276f60143c1261f85a85873fe

and mostly also by the fact that none of these dependencies produce
warning-free outputs anymore. There is currently only one dependency
used in bugs.php.net and that is Text_Diff which doesn't work ok on
today's PHP versions. It's even deprecated and horde's Diff should be
used.

Now, installing any dependency for production actually is not yet
possible because the deployment step needs an additional composer
install step somewhere here:
https://github.com/php/systems

About the additional EditorConfig file and its configurations, those
were picked by current majority of open source code style in the
community out there. We can reinvent the PSR-2 code style again but I
would really like to avoid doing that. Running the php-cs-fixer tool
is very simple and works out of the box without any additional
configuration file. Basically, the sensible defaults are pretty
standard for the PHP code so it's nothing so drastic. Currently,
bugs.php.net code uses somewhere around 3 coding styles together with
a free-style which is definitely not going anywhere in any organized
direction as I see it. Something like that.

-- 
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/php: added phpkonf istanbul php conference 2019 call for papers: archive/archive.xml archive/entries/2018-12-10-1.xml

2018-12-10 Thread Peter Kokot
Commit:6cec1c9600b23259c52d302aa015d5d1181872a3
Author:Emir Karşıyakalı  Mon, 10 Dec 
2018 14:54:27 +0300
Committer: Peter Kokot   Mon, 10 Dec 2018 15:05:01 
+0100
Parents:   dbc3ea2583bee83b14dc724e2b9bc2bff129d3ac
Branches:  master

Link:   
http://git.php.net/?p=web/php.git;a=commitdiff;h=6cec1c9600b23259c52d302aa015d5d1181872a3

Log:
added phpkonf istanbul php conference 2019 call for papers

Changed paths:
  M  archive/archive.xml
  A  archive/entries/2018-12-10-1.xml


Diff:
diff --git a/archive/archive.xml b/archive/archive.xml
index c590dfb..8676887 100644
--- a/archive/archive.xml
+++ b/archive/archive.xml
@@ -9,6 +9,7 @@
 http://php.net/contact
 php-webmaster@lists.php.net
   
+  
   
   
   
diff --git a/archive/entries/2018-12-10-1.xml b/archive/entries/2018-12-10-1.xml
new file mode 100644
index 000..300f506
--- /dev/null
+++ b/archive/entries/2018-12-10-1.xml
@@ -0,0 +1,23 @@
+
+http://www.w3.org/2005/Atom"; 
xmlns:default="http://php.net/ns/news";>
+  PHPKonf Istanbul PHP Conference 2019 - Call for Papers
+  http://php.net/archive/2018.php#id2018-12-10-1
+  2018-12-10T09:00:00+00:00
+  2018-12-10T09:00:00+00:00
+  http://php.net/ns/news";>2019-01-31
+  
+  http://php.net/conferences/index.php#id2018-12-10-1"; 
rel="alternate" type="text/html"/>
+  http://php.net/ns/news"; 
link="https://cfp.phpkonf.org/"; title="PHPKonf Istanbul PHP Conference 
2019">phpkonf_2015.png
+  https://cfp.phpkonf.org/"; rel="via" type="text/html"/>
+  
+http://www.w3.org/1999/xhtml";>
+PHPKonf 2019 is an annual PHP oriented conference in Istanbul, 
Turkey and will take place on Saturday, 4th of May, 2019.
+
+ The https://cfp.phpkonf.org/";>call for papers for the 
PHPKonf 2019 Istanbul PHP conference is open! If you have a burning desire to 
hold forth about PHP, DevOps, databases, JavaScript, or any other web 
development topics, we want to see your proposals. Call for Papers is open only 
from December 10, 2018 to January 31, 2019, so hurry. An added benefit: we will 
cover your travel and hotel.
+ 
+ You’ll have 45 minutes for the talk, with 35 minutes for your topic 
and 10 minutes for Q&A. We can’t wait to see your proposals! Check out the 
http://2018.phpkonf.org/";>last conference to get an idea of what 
to expect.
+ 
+ Follow us on https://twitter.com/istanbulphp";>Twitter to 
stay updated with news from the PHPKonf crew.
+
+  
+


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WEBMASTER] com web/master: Refactor long array() syntax to short []: entry/event.php entry/subscribe.php entry/svn-account.php entry/user-note.php entry/user-notes-vote.php fetch/allusers.php fet

2018-12-09 Thread Peter Kokot
Commit:0e511803a5fdc430897d53e76d4eaeea407f1e1e
Author:Peter Kokot  Mon, 10 Dec 2018 03:26:03 
+0100
Parents:   bce0f6fa023edad1b61285bea51b554a00ab488b
Branches:  master

Link:   
http://git.php.net/?p=web/master.git;a=commitdiff;h=0e511803a5fdc430897d53e76d4eaeea407f1e1e

Log:
Refactor long array() syntax to short []

Since app is using PHP 5.4+ already, the longer `array()` syntax can be
refactored to shorter `[]`.

Changed paths:
  M  entry/event.php
  M  entry/subscribe.php
  M  entry/svn-account.php
  M  entry/user-note.php
  M  entry/user-notes-vote.php
  M  fetch/allusers.php
  M  fetch/cvsauth.php
  M  fetch/events.php
  M  fetch/user-notes-rss.php
  M  fetch/user-notes.php
  M  fetch/user-profile.php
  M  fetch/user.php
  M  forgot.php
  M  github-webhook.php
  M  include/functions.inc
  M  include/languages.inc
  M  include/login.inc
  M  include/note-reasons.inc
  M  include/spam-lib.inc
  M  manage/challenge-response.php
  M  manage/event.php
  M  manage/github.php
  M  manage/mirrors.php
  M  manage/user-notes.php
  M  manage/users.php
  M  network/status/index.php
  M  scripts/conference_teaser
  M  scripts/countries.inc
  M  scripts/event_listing
  M  scripts/ip-to-country
  M  scripts/mirror-summary
  M  scripts/mirror-test
  M  scripts/pregen_flickr
  M  scripts/pregen_news
  M  scripts/rss_parser

diff --git a/entry/event.php b/entry/event.php
index 80c4899..2fc07ad 100644
--- a/entry/event.php
+++ b/entry/event.php
@@ -3,7 +3,7 @@
 $mailto = 'php-webmaster@lists.php.net';
 #$mailto = 'j...@apache.org';
 
-$re = array(
+$re = [
 1 => 'First',
 2 => 'Second',
 3 => 'Third',
@@ -11,8 +11,8 @@ $re = array(
-1 => 'Last',
-2 => 'Second to Last',
-3 => 'Third to Last'
-  );
-$cat = array("unknown", "User Group Event", "Conference", "Training");
+];
+$cat = ["unknown", "User Group Event", "Conference", "Training"];
 
 function day($in) {
   return strftime('%A',mktime(12,0,0,4,$in,2001));
@@ -23,7 +23,7 @@ function day($in) {
 @mysql_select_db("phpmasterdb")
   or die("failed to select database");
 
-$valid_vars = 
array('sdesc','ldesc','email','country','category','type','url','sane','smonth','sday','syear','emonth','eday','eyear','recur','recur_day');
+$valid_vars = 
['sdesc','ldesc','email','country','category','type','url','sane','smonth','sday','syear','emonth','eday','eyear','recur','recur_day'];
 foreach($valid_vars as $k) {
   $$k = isset($_REQUEST[$k]) ? mysql_real_escape_string($_REQUEST[$k]) : false;
 }
diff --git a/entry/subscribe.php b/entry/subscribe.php
index 7500cc5..350a11d 100644
--- a/entry/subscribe.php
+++ b/entry/subscribe.php
@@ -22,7 +22,7 @@ if (!is_emailable_address($_POST['email'])) {
 }
 
 // Check request mode
-if (!in_array($_POST['request'], array("subscribe", "unsubscribe"))) {
+if (!in_array($_POST['request'], ["subscribe", "unsubscribe"])) {
 die("Invalid request mode");
 }
 
diff --git a/entry/svn-account.php b/entry/svn-account.php
index a27d22b..5b14fd8 100644
--- a/entry/svn-account.php
+++ b/entry/svn-account.php
@@ -4,7 +4,7 @@ require dirname(__FILE__) . '/../include/email-validation.inc';
 require dirname(__FILE__) . '/../include/cvs-auth.inc';
 require dirname(__FILE__) . '/../include/functions.inc';
 
-$valid_vars = array('name','email','username','passwd','note','group','yesno');
+$valid_vars = ['name','email','username','passwd','note','group','yesno'];
 foreach($valid_vars as $k) {
 if(isset($_REQUEST[$k])) $$k = $_REQUEST[$k];
 }
@@ -50,7 +50,7 @@ $username = strtolower($username);
 # placed in qmail-smtpd's badmailfrom to block future emails.) some of these
 # latter addresses were used as examples in the documentation at one point,
 # which means they appear on all sorts of spam lists.
-if 
(in_array($username,array('nse','roys','php','foo','group','core','webmaster','web','aardvark','zygote','jag','sites','er','sqlite','cvs2svn','nobody','svn','git','root')))
+if 
(in_array($username,['nse',&#

  1   2   >