PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Mar 22, 2023 02:12
anyone have luck with nginx unit loading php extensions? i've got extension_dir set to /usr/lib64/php/modules in the ini settings, but when i start unitd it logs a bunch of PHP Warning: PHP Startup: Unable to load dynamic library 'foo' (tried: /opt/remi/php81/root/usr/lib64/php/modules/foo which is seemingly ignoring the folder i set
Oct 11, 2022 22:19
anyone know in Laravel, how to apply a global middleware on all routes from a package. In lumen $this->app->middleware($middleware); works, but laravel doesn't seem to have that
Apr 8, 2020 17:42
I tried error_reporting(E_ALL);
Apr 8, 2020 17:41
`$foo = 'bar'; echo $foo[0];` breaks on ubuntu `v7.3.16-1+ubuntu18.04.1+deb.sury.org+1` but I can't get the `Uninitialized string offset: 0` notice on my local machine `PHP 7.4.2 (cli) (built: Jan 22 2020 06:30:58) ( NTS )` on osx
I'm trying to create a test case that proves the exception in production, but phpunit just ignores it locally
Aug 6, 2019 22:06
0
Q: How do I make my regular expression less greedy?

MoakMy regular expression that already captures the data in a way that's satisfactory in 90% of cases, except when it gets overeager and instead of matching twice it matches both occurrences of a match In a pseudo pattern I'm trying to capture #{rank} in {category} My existing patern #([0-9,]+)\s...

Aug 6, 2019 21:48
than @ircmaxell looking that up now
Aug 6, 2019 21:48
so when it matches #2 in #metoo merch #4 in women fashion I was actually hoping for #2 in #metoo merch and secondly #4 in women fashion
Aug 6, 2019 21:47
A pseudo pattern is #{rank} in {category}
Aug 6, 2019 21:46
My regular expression that already captures the data in a way that's satisfactory in 90% of cases, except when it gets overeager and instead of matching twice it matches both occurrences of a match
Aug 6, 2019 21:39
So I should ask it on the site?
Aug 6, 2019 21:38
Not sure I can frame it in a way that's generically helpful for everyone...
Aug 6, 2019 21:37
Yea like it's just a debug question
Aug 6, 2019 21:36
my pattern is too greedy and I need it to match twice
Aug 6, 2019 21:36
need help with a Regex, to specific for stack overflow regex101.com/r/GaiFEl/1
Aug 20, 2018 15:57
@PeeHaa Yea, that's true, should really be separating these
Aug 20, 2018 15:45
@Danack nice idea thanks
Aug 20, 2018 15:41
is there way to mark a phpunit test as unessential via markup? so when it errors instead it gives a warning or something. Every now and then a test fails due to to stripe/paypal or other third party apis throwing 500 errors
Jul 18, 2018 15:43
phpcbf --standard=PSR2 src is that I was looking foor
Jul 18, 2018 15:35
Is there a PSR-2 formatter for the command line? (to run tasks automatically) PHPBeautifier hasn't been touched in 8 years. PHPStorm can do it but I'm trying to automate this.
Jul 13, 2018 18:28
cheers @tereško
Jul 13, 2018 18:27
k, actually my question was more intending to be:

$values = function_that_returns_array();
foreach ($values as $value) {
// vs()
foreach (function_that_returns_array() as $value) {
Jul 13, 2018 18:21
@Code4R7 cuz I'm not using $value
Jul 13, 2018 18:19
@LeviMorrison cheers
Jul 13, 2018 18:17
is there a recommendation for a standard?
Jul 13, 2018 18:16
    $keys = array_keys($params);
    foreach ($keys as $key) {
        // vs
    foreach (array_keys($params) as $key) {
Jan 30, 2018 17:02
Weird my IDE is highlighting the composer files from the troubled package
Jan 30, 2018 17:01
Jan 30, 2018 16:56
it creates the vendor during installation when it's being pulled in as dependency
Jan 30, 2018 16:55
@tereško that's what I meant, vendor is not committed to the repository, it's in the gitignore.
Jan 30, 2018 16:51
I have a private repository which does not have a vendor directory, when I pull it in via composer it installs and creates the vendor directory within that package, this causes me to have vendor/guzzlehttp and vendor/mypackage/vendor/guzzlehttp - any ideas what this could be caused by?
Nov 14, 2017 19:32
It's not coming in through packagist
Nov 14, 2017 19:32
maybe it builds the vendor because it is a private package...
Nov 14, 2017 19:27
Nov 14, 2017 19:26
Nov 14, 2017 19:25
I pull it via
```

"repositories": [
{
"type": "git",
"url": "[email protected]:snagshout/mws-laravel.git"
}
],
```
Nov 14, 2017 19:25
it's private
Nov 14, 2017 19:25
oh right
Nov 14, 2017 19:24
nope
Nov 14, 2017 19:22
Anyone know why my composer package would bring in its own vendor folder when running composer install?
Jan 17, 2017 18:00
I'm claiming http 419 - Come back later
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Jul 15, 2022 15:57
maybe symlinking the dist folder in your node_modules?
Jul 15, 2022 15:56
Does anyone know of a way of developing and making changes to package while it's being used in your dev environment? Like a site using a dependency that you are developing. Rather than packaging pushing and checking if your changes work in the context of the greater application.
Apr 5, 2018 16:17
I'll check the email stuff
Apr 5, 2018 16:17
Thanks!
Apr 5, 2018 16:15
@Luggage I mean usually there is a helpful yellow banner asking if I want to make a PR with the new branch. On one repo that banner never appears @SterlingArcher
Apr 5, 2018 16:12
Any github pros here? When I push a new branch my repos I get a yellow banner asking me to start a pull request. However on one repo (private) it's not doing so. I need to make a PR manually, is there a config that needs to be set?
 

Java

Dedicated to the discussion of the Java programming language a...
Jan 17, 2017 18:02
Interesting, thanks @Unihedro, I think I'm going to claim 419 - Come back later with the return time in the error message
Jan 17, 2017 17:52
like, a resource is being used by others and will be free at a given point in time
Jan 17, 2017 17:52
Not rate limiting though