With Java and C++ experience (especially if it was web based Java) you shouldn’t have much trouble getting into PHP. I originally came to PHP from a mixture of C/C++ and I immediately felt right at home with the language.
There’s a lot of global methods that have the same names as their C based equivalent which I found pretty helpful.
If you’re looking for something OO heavy, I’d recommend checking out Symfony. If you’re more interested in something closer to Rails, I’d recommend checking out Laravel. Both frameworks are excellent it really comes down to how you want to build something which is better.
It might be good to create a small "sample.txt" file that contains a small sample of the training data.
If anyone is curious what the training data looks like, they can just look at the sample.txt file instead of nearly crashing their computer loading the full training file like I did!
Docker runs in a virtual machine on Mac meaning it is actually very slow compared to running natively/valet.
The local docker version is only ever going to have one user though so it doesn’t really matter that much and the productivity increase is more than worth it.
Use Symfony or Laravel. These frameworks will handle setting up database (as well as queue, email, caching, etc) for you so you can focus on building an application
PHPStorm team, You have a great product most of the time, but as soon as you force me to change my UI I will start looking for an alternative.
The current UI is perfectly fine and every change you have ever made to it has made it worse. Please stop trying to optimize for a problem that doesn't exist and continue focussing on shipping features that make my job easier instead of making it harder.
Any reason why they are moving away from doctrine/dbal to a custom solution? Seems like an odd choice for a dev team that already seems pretty resource limited
I’ve build a route optimizer for a bus system before. Internally it used dykstras algorithm (https://en.m.wikipedia.org/wiki/Dijkstra%27s_algorithm) to determine the shortest path. The tricky part was figuring out the correct heuristic for what is considered “best path”.
For example, one problem the algorithm had was it could shave seconds/minutes off your A-B route all you had to do was transfer across four busses, but if you just stayed on the current bus, you would get there at almost exactly the same time haha.
That’s a cool way of handling this problem but not very useful in my case as the XML documents I work with are not a standard structure that you know about ahead of time. Is there any plans to add in wildcard support for variable sections of a document?
While your method here certainly works, you could very easily accomplish this abstraction with a bog standard PHP class, no external library needed. The less external dependencies you have, the less work required to maintain an application, so I always try to avoid using them when I can.
Or, since you’re already pulling in composer libs, you could also just pull in a templating library and make this even simpler without having to do any of the steps listed here
You know what’s worse than thinking/realizing your code is crap? Thinking your code is amazing and that it cannot be improved in any way.
These are the two traits I’ve seen in every best and worst programmer I’ve ever met. A good general rule that I follow is that if you can’t go back to a project you worked on a few years back and be completely ashamed of the work you did then you are no longer improving
Action classes work by using the laravel IOC (dependency injection) to automatically load the class, along with any dependencies that action might have, by specifying the dependencies in the constructor of your action.
Sometimes, you might see that an action class might have another action class as a dependency, which might have its own actions as dependencies, etc. This means that the laravel IOC has to traverse through multiple levels of code files as well as all dependencies of those code files in order to instantiate your action.
The Laravel IOC works pretty well but isn’t exactly the speediest process in the world. Not a big deal when instantiating a couple things in a controller method, but performance can really can really add up if it needs to start traversing complicated scenarios.
Thankfully there’s an easy solution. Just use the bind method of the service container to tell the IOC exactly how to load these actions. That way the expensive traversal process can be bypassed completely.
If Symfony is really dying then you can expect that 30% pay increase to continue to increase as Symfony developers become more and more rare.
you can always move back to Laravel in the future, I’d personally take the pay raise
That is not what traits are meant to be used for. Take a look at Action controllers it sounds more like what you want
Cool project
Ahh okay, so this is not a replacement for Octane, it will actually be consuming it. Very interesting!
API Platform is a great product so I can safely assume this will be too.
Does FrankenPHP currently work with Laravel? Particularly the worker mode
Hi Hazgui, before submitting something like this I suggest
creating a readme.md file at the root of the codebase that explains what problems this code solves, and why it is useful to someone
replace the placeholder Wordpress doc block with something that explains what this plugin is used for and why it is useful.
You also might get more help by posting this to the Wordpress subreddit instead of this one.
Best of luck with your open source software.
Hi Colin, I was actually reading the source code for CommonMark a few months ago and remember seeing your name in there a lot.
Thanks a lot for this! I'll take a look and at the very least maybe I can learn from the regex and reuse it for my purposes
Hi nyamsprod, congrats on the release and thanks for supporting the community.
Question for you since you clearly know a lot about URIs. What would you say is the best way of extracting a URI substring from a larger string?
By that I mean you have a string that may or may not contain a URI, how would you go about detecting and returning this URI substring?
With Java and C++ experience (especially if it was web based Java) you shouldn’t have much trouble getting into PHP. I originally came to PHP from a mixture of C/C++ and I immediately felt right at home with the language.
There’s a lot of global methods that have the same names as their C based equivalent which I found pretty helpful.
If you’re looking for something OO heavy, I’d recommend checking out Symfony. If you’re more interested in something closer to Rails, I’d recommend checking out Laravel. Both frameworks are excellent it really comes down to how you want to build something which is better.
Very helpful tools but I was clicking on the files within my browser on GitHub in this case
Cool project.
It might be good to create a small "sample.txt" file that contains a small sample of the training data.
If anyone is curious what the training data looks like, they can just look at the sample.txt file instead of nearly crashing their computer loading the full training file like I did!
I prefer PHP unit but at the end of the day, if PEST gets more people writing tests I’m all for it
Docker runs in a virtual machine on Mac meaning it is actually very slow compared to running natively/valet.
The local docker version is only ever going to have one user though so it doesn’t really matter that much and the productivity increase is more than worth it.
Use Symfony or Laravel. These frameworks will handle setting up database (as well as queue, email, caching, etc) for you so you can focus on building an application
I inherited a project using backpack and I wouldn’t recommend it to my worst enemy
PHPStorm team, You have a great product most of the time, but as soon as you force me to change my UI I will start looking for an alternative.
The current UI is perfectly fine and every change you have ever made to it has made it worse. Please stop trying to optimize for a problem that doesn't exist and continue focussing on shipping features that make my job easier instead of making it harder.
Any reason why they are moving away from doctrine/dbal to a custom solution? Seems like an odd choice for a dev team that already seems pretty resource limited
Might wanna delete this post and try again once DNS has propagated.
Your link doesn’t work
I’ve build a route optimizer for a bus system before. Internally it used dykstras algorithm (https://en.m.wikipedia.org/wiki/Dijkstra%27s_algorithm) to determine the shortest path. The tricky part was figuring out the correct heuristic for what is considered “best path”.
For example, one problem the algorithm had was it could shave seconds/minutes off your A-B route all you had to do was transfer across four busses, but if you just stayed on the current bus, you would get there at almost exactly the same time haha.
That’s a cool way of handling this problem but not very useful in my case as the XML documents I work with are not a standard structure that you know about ahead of time. Is there any plans to add in wildcard support for variable sections of a document?
Example #[STR(‘/first/second/*/fourth’)]
While your method here certainly works, you could very easily accomplish this abstraction with a bog standard PHP class, no external library needed. The less external dependencies you have, the less work required to maintain an application, so I always try to avoid using them when I can.
Or, since you’re already pulling in composer libs, you could also just pull in a templating library and make this even simpler without having to do any of the steps listed here
You know what’s worse than thinking/realizing your code is crap? Thinking your code is amazing and that it cannot be improved in any way.
These are the two traits I’ve seen in every best and worst programmer I’ve ever met. A good general rule that I follow is that if you can’t go back to a project you worked on a few years back and be completely ashamed of the work you did then you are no longer improving
Action classes work by using the laravel IOC (dependency injection) to automatically load the class, along with any dependencies that action might have, by specifying the dependencies in the constructor of your action.
Sometimes, you might see that an action class might have another action class as a dependency, which might have its own actions as dependencies, etc. This means that the laravel IOC has to traverse through multiple levels of code files as well as all dependencies of those code files in order to instantiate your action.
The Laravel IOC works pretty well but isn’t exactly the speediest process in the world. Not a big deal when instantiating a couple things in a controller method, but performance can really can really add up if it needs to start traversing complicated scenarios.
Thankfully there’s an easy solution. Just use the bind method of the service container to tell the IOC exactly how to load these actions. That way the expensive traversal process can be bypassed completely.
https://laravel.com/docs/8.x/container#binding-basics
If I remember later on when I’m at a keyboard, I’ll post an example of what I mean
Action classes can call service methods internally giving you the best of both worlds!
Side note: If you wanna use actions make sure you tell the IOC how to load them using a provider as I’ve seen them get pretty performance heavy.