gnat42
Repos
52
Followers
6
Following
4

Events

gnat42 create tag 4.0.1
Created at 4 days ago

Added IssuedAt to default JWT token

Release of new version 4.0.1

Created at 4 days ago
gnat42 create tag 4.0.0
Created at 5 days ago

Release of new version 4.0.0

Created at 5 days ago

Convert to lcobucci/jwt 4.0

Added New configuration mechanism

Created at 5 days ago
issue comment
deptrac.yaml file examples - and init command broken

I don't know what to tell you. At this point in time, it works regardless of whether its deptrac: or parameters: ??

Created at 1 week ago
issue comment
Check if the file exists prior to checking if its writable

I'm happy for the fix to be in more than anything. You've got it all done so go ahead and merge your work!

Created at 1 week ago

Added mysql oom_score_adj to stop the kernel from killing mysql

Created at 1 week ago

Added NGINX prometheus exporter

Created at 1 week ago

Updated php-fpm-exporter to setup systemd service Group= parameter

Created at 2 weeks ago

Added prometheus php-fpm exporter

Updated mysql exporter

Created at 2 weeks ago

Update PHP role

Only install epel for non fedora distros

Adjust packages for epel vs fedora installations

Fix default packages

InfluxDB role

Added prometheus mysql exporter

Added prometheus node exporter

Created at 2 weeks ago

Release v2.0.16

Added spec file artifacts

Added systemd timer to clean file directories

Created at 2 weeks ago
issue comment
Error/Crash on PHP 8.1

If I take a failed run and do nothing and ask the system to re-run all the tests then it works. Must have some kind of cache at play

Created at 3 weeks ago
issue comment
deptrac.yaml file examples - and init command broken

Well, I'm as confident as I can be.

// composer.json
    "qossmic/deptrac-shim": "^0.24.0",

and

[gnat@msi]$ ./vendor/bin/deptrac --version
deptrac 0.24.0
Created at 3 weeks ago
closed issue
deptrac.yaml file examples - and init command broken

Hello,

First off thank you for maintaining/developing this library. I had version 0.10.2 (via deptrac-shim) installed for quite awhile and upgraded recently to 0.24.0. When I did the upgrade I couldn't get anything to work from the old file. I looked at the examples I could find and most were something along the lines of

deptrac:
   paths: ...

When I modified mine, it complained it couldn't find anything to handle deptrac (something along those lines). Took a bit of digging around, switching versions using this repository directly for me to get it figured out. I tried the init command but that got me an error about not being able to create the file. Once I worked around that issue I could see what the default file was which is as follows:

parameters:
   paths: ...

Once I made that change my original config file functioned as expected.

I can submit some PRs but there are quite a few examples I wasn't entirely sure how mine is wrong. So, if the examples are infact no longer accurate, I can submit a PR but thought I would ask first.

Also the init command seemed broken unless the file already exists. For example in Supportive/File/Dumper.php it creates a new SplFileInfo.php using the file path. And then here you check if its writeable but the file doesn't exist so it isn't. Again if a PR would help I can submit one to test if the file already exists before the writeable test etc.

Created at 3 weeks ago
issue comment
deptrac.yaml file examples - and init command broken

I've filed two separate PRs #981 and #982

Created at 3 weeks ago
pull request opened
Check if the file exists prior to checking if its writable

When calling deptrac init if the file doesn't exist then isWritable is false and we error out. The SplFileInfo->isFile() "Checks if the file referenced by this SplFileInfo object exists and is a regular file." So if it exists and is a file but is not writeable then throw an error otherwise allow the file to be created and populated.

It would likely also be smart to add more error checking here. Such as checking if the dirname($target) exists and is writeable and if not try to create it or something.

Created at 3 weeks ago
pull request opened
Sync docs with actual file behaviour

The system expects the config yaml file to start with 'parameters:' not 'deptrac:' this updates the docs to match

Created at 3 weeks ago
create branch
gnat42 create branch patch-2-create-file
Created at 3 weeks ago
create branch
gnat42 create branch patch-1-docs
Created at 3 weeks ago
Created at 3 weeks ago
issue comment
Error/Crash on PHP 8.1

Hello,

Ok, so I finally got the issue figured out and can now run phpstan on php-8.1 with my extension installed. I've got another weird error that isn't exactly an error, and feel free to say you don't know. However I'm getting a weird behaviour. Locally when I run phpstan, no errors. When it runs in CI it complains. I fix what it complains about and then it complains about something else. Locally no errors.

For example, run 1 when pushed to and run through the CI:

$ ./vendor/bin/phpstan analyse --memory-limit=-1 --no-progress
Note: Using configuration file /builds/project/phpstan.neon.
 ------ ----------------------------------------------------------------------- 
  Line   ..../MergeHandler/BeneficiaryGroupHandler.php     
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Unsafe access to private property              
         ....\\MergeHandler\\BeneficiaryGroupHandle  
         r\:\:\$nwords through static\:\:\.$# in path                           
         /builds/project/MergeHandler/BeneficiaryGroupHandler.php 
         was not matched in reported errors.             
 ------ ----------------------------------------------------------------------- 
....

I fixed all of those (even though locally when run it didn't complain) and push and get

Note: Using configuration file /builds/project/phpstan.neon.
 ------ ----------------------------------------------------------------------- 
  Line   ...Events/Subscribers/AbstractStepSubscriber.php    
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Variable \$Step in PHPDoc tag @var does not    
         match assigned variable \$step\.$# in path                             
         /builds/project/.../Events/Subscribers/AbstractStepSubscriber.php 
         was not matched in reported errors.            
 ------ ----------------------------------------------------------------------- 
 [ERROR] Found 1 error

Fixed that and then I get this

Note: Using configuration file /builds/project/phpstan.neon.
 ------ ----------------------------------------------------------------------- 
  Line   .../Events/WillDocumentEvent.php                          
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Method                                         
         ...\\Events\\WillDocumentEvent\:\:getType\(\)        
         should return string\|null but returns int\|null\.$# in path           
         /builds/project/.../Events/WillDocumentEvent.php 
         was not matched in reported errors.                                  
 ------ ----------------------------------------------------------------------- 

Any pointers/ideas would be appreciated.

Created at 3 weeks ago
opened issue
deptrac.yaml file examples - and init command broken

Hello,

First off thank you for maintaining/developing this library. I had version 0.10.2 (via deptrac-shim) installed for quite awhile and upgraded recently to 0.24.0. When I did the upgrade I couldn't get anything to work from the old file. I looked at the examples I could find and most were something along the lines of

deptrac:
   paths: ...

When I modified mine, it complained it couldn't find anything to handle deptrac (something along those lines). Took a bit of digging around, switching versions using this repository directly for me to get it figured out. I tried the init command but that got me an error about not being able to create the file. Once I worked around that issue I could see what the default file was which is as follows:

parameters:
   paths: ...

Once I made that change my original config file functioned as expected.

I can submit some PRs but there are quite a few examples I wasn't entirely sure how mine is wrong. So, if the examples are infact no longer accurate, I can submit a PR but thought I would ask first.

Also the init command seemed broken unless the file already exists. For example in Supportive/File/Dumper.php it creates a new SplFileInfo.php using the file path. And then here you check if its writeable but the file doesn't exist so it isn't. Again if a PR would help I can submit one to test if the file already exists before the writeable test etc.

Created at 3 weeks ago
PHP-8.0 support

This latest push (Sep 8) fixes the issue.

Created at 3 weeks ago

PHP-8.0 support

PHP 8.1 support

Created at 3 weeks ago

PHP-8.0 support

Created at 3 weeks ago
PHP-8.0 support

One more bit of information for people using this patch. Reflection is broken with these changes. For example with the following simple extension

#include <phpcpp.h>

/**
 *  Counter class that can be used for counting
 */
class Counter : public Php::Base
{
private:
    /**
     *  The initial value
     *  @var    int
     */
    int _value = 0;

public:
    /**
     *  C++ constructor and destructor
     */
    Counter() = default;
    virtual ~Counter() = default;

    /**
     *  Update methods to increment or decrement the counter
     *  Both methods return the NEW value of the counter
     *  @return int
     */
    Php::Value increment() { return ++_value; }
    Php::Value decrement() { return --_value; }

    /**
     *  Method to retrieve the current counter value
     *  @return int
     */
    Php::Value value() const { return _value; }

    Php::Value test(Php::Parameters &params) {
       return _value;
    }
};

/**
 *  tell the compiler that the get_module is a pure C function
 */
extern "C" {

    /**
     *  Function that is called by PHP right after the PHP process
     *  has started, and that returns an address of an internal PHP
     *  strucure with all the details and features of your extension
     *
     *  @return void*   a pointer to an address that is understood by PHP
     */
    PHPCPP_EXPORT void *get_module() 
    {
        // static(!) Php::Extension object that should stay in memory
        // for the entire duration of the process (that's why it's static)
        static Php::Extension extension("gnat", "1.0");

	Php::Namespace myNamespace("Counter");

        Php::Class<Counter> counter("Counter");
        counter.method<&Counter::increment> ("increment");
        counter.method<&Counter::decrement> ("decrement");
        counter.method<&Counter::value>     ("value");

	counter.method<&Counter::test>("test", Php::Public, { 
            Php::ByVal("date", "\\DateTime", true, false),
            Php::ByRef("date2", "\\DateTime", true, false),
            Php::ByVal("something", Php::Type::Numeric),
            Php::ByVal("something2", Php::Type::Array),
            Php::ByVal("output", Php::Type::String),
            Php::ByVal("dpi", Php::Type::Numeric,false)
        });
        // add the class to the extension
        //extension.add(std::move(counter));

	myNamespace.add(counter);//("PDF");

	extension.add(myNamespace);

        // return the extension
        return extension;
    }
}

and the following php

<?php

use \Counter\Counter;

$refClass = new ReflectionClass(Counter::class);
echo Counter::class."\n";
foreach ($refClass->getMethods() as $method) {
    echo "\n\nMethod: " . $method->getName() . "\n";
    foreach ($method->getParameters() as $parameter) {
        echo "\tParameter: " . $parameter->getName() . "\n";
        $type = $parameter->getType();
        if (!$type) {
	        echo "\tType: null type\n";
	        continue;
	    }

        echo "\tType: " . $type->getName() . "\n";
	    echo "\t\tBuiltIn: ".($type->isBuiltIn() ? 'Y':'N')."\n";
	    echo "\t\tAllowNull: ".($type->allowsNull() ? 'Y':'N')."\n";
    }
}

return;

The output is as follows on PHP 8.x.

// snip....
Method: test
        Parameter: ?\DateTime
        Type: object
                BuiltIn: Y
                AllowNull: Y
        Parameter: ?\DateTime
        Type: object
                BuiltIn: Y
                AllowNull: Y
        Parameter: something
        Type: int
                BuiltIn: Y
                AllowNull: N
        Parameter: something2
        Type: array
                BuiltIn: Y
                AllowNull: N
        Parameter: output
        Type: string
                BuiltIn: Y
                AllowNull: N
        Parameter: dpi
        Type: int
                BuiltIn: Y
                AllowNull: N

On php 7.x the is Parameter: date, type ?\DateTime... I'm trying to find out what's going on but everything I've seen so far is correct.

Anyone with suggestions would be appreciated.

Created at 3 weeks ago