Mezon Security Provider (New)
Read more at https://www.phpclasses.org/package/11792-PHP-Store-authenticated-user-data-using-sessions.html
One project I'm working on has multiple separate parts in different git repositories that are brought into the main project using linked composer directories. I needed to get step debugging working in PhpStorm and this is the approach I took.
My project is laid out on disk like this:
.
├── main-app/
│ ├── public/
│ ├── src/
│ ├── tests/
│ ├── vendor/
│ └── composer.json
└── plugin-one/
├── src/
└── tests/
As you can see I have main-app and plugin-one which are the two sets of source code that I need to work on.
We need to set up ./plugin-one/ as a composer dependency of ./main-app/ such that it appears under ./main-app/vendor/client/plugin-one/, but set-up so that we can edit the original files and have main-app pick up the changes.
This is done by setting up a repository in our composer.json that points to the relevant path using a symlink. These are know as Path repositories and look like this in ./main-app/composer.json:
"repositories": [
{
"type": "path",
"url": "../plugin-one"
"options": {
"symlink": true
}
},
]
I can then set my require like this:
"require": {
"client/plugin-one": "@dev",
},
The net result is that ./main-app/vendor/client/plugin-one is a symlink to ./plugin-one
We create a PhpStorm project for ./main-app and then add plug-one to it as a "content root":
We now have the same source code in the project twice (once in ./plugin-one and once in ./main-app/vendor/client/plugin-one), so we need to excluded the vendor directory:
The folder will now be coloured orange, so we know it's excluded.
PhpStorm now knows about our source code, so next we need to map it to the server. I'm using Docker for this project, but it's the for any remote-like project.
The key bit for this article is that path mapping section. The "/var/www/html" is whatever the correct path is on your Docker/Vagrant/whatever host.
Finally, click the menu item Run -> Start Listening for PHP Debug Connections. Note that if this is already selected, then the menu item does not exist and the menu item Stop Listening for PHP Debug Connections is in its place.
You can now set breakpoints in plugin-one/src/whatever.php and PhpStorm will stop on them.
If you are debugging a website using a browser then get the relevant Xdebug extension for Chrome or Firefox.
If it's an API, then you'll need to set a cookie to enable Xdebug for the request:
curl --cookie 'XDEBUG_SESSION=PHPSTORM; path=/' "http://{dev-hostname-for-main-app}:8888/foo/bar"
Translate to your API client of choice!
This worked for me, hopefully it'll work for you too if you have a similar situation!
The world moves quickly. That’s why having access to the latest news and information has never been more important.
What’s more, users have developed high expectations when it comes to staying in the know. They want up-to-the-minute news about the subjects that affect their daily lives. Not to mention a healthy dose of sports and entertainment as well.
For developers, wrangling all of this content can be a challenge. Bringing top-notch information to your website or mobile app is a must – but where do you start?
mediastack is the answer! This free REST API helps you deliver worldwide news and blog posts in real-time. It’s never been easier to give your users what they’re looking for.
Let’s take a look at how mediastack works and what it can offer your applications.
mediastack is a powerful, scalable solution for tapping into the world’s top news sources. Use it display breaking news, track your brand or to keep your audience entertained. This API has so much to offer, including:
Sources matter – and mediastack gives you access to the very best. Content from top names such as CNN, Time, BBC, Al Jazeera, ESPN and many more are available.
In all, there are more than 7,500 services from over 50 countries and 13 languages. This enables you to serve up information that is relevant to your readers – wherever they are.
Whether you’re looking to share the latest news or look back at a moment in time, mediastack has you covered.
Real-time coverage is updated once a minute, so you’ll never miss out on what’s happening. Meanwhile, historical data is there for readers to explore news from days past.
When it comes to serving up news and information, speed and reliability are paramount. Thankfully, you can rely on mediastack to provide a JSON REST API that can handle whatever you throw at it.
Their API has the power to handle millions of requests per minute. And, with an uptime of nearly 100%, you can rest assured that the service will be there when you need it most.
Security is also a top priority. All paid-plan traffic utilizes 256-bit HTTPS encryption to protect both you and your users.
mediastack makes it easy to get up-and-running. Their API is thoroughly documented and simple to implement no matter which programming language you’re using.
Use the included 3-Step Quickstart Guide and you’ll be making API calls in less than a minute. If you have a question or need help, mediastack’s friendly support staff will be happy to assist you.
Ready to bring a world of compelling content to your users? mediastack is the JSON REST API you can trust to do it right. The service is easy to implement, high-performing and secure. Plus, it gives you access to over 7,500 top news sources.
Best of all, you can get started for free. Sign up for your free API key today and experience the awesome power of mediastack.
The post Bring the Latest News and Information to Your App with mediastack <span class="sponsored_text">Sponsored</span> appeared first on Speckyboy Design Magazine.
Latest PECL Releases:
Bug Fixes
Bug Fixes
The post Interview with Miriam Schwab and Zeev Suraski appeared first on Voices of the ElePHPant.
Another monthly update where I explain what happened with Xdebug development in this past month. These will be published on the first Tuesday after the 5th of each month.
Patreon and GitHub supporters will get it earlier, on the first of each month.
I am currently looking for more funding.
You can become a patron or support me through GitHub Sponsors I am currently 59% towards my $1,000 per month goal.
If you are leading a team or company, then it is also possible to support Xdebug through a subscription.
In September, I worked on Xdebug for about 60 hours, with funding being around 70 hours. I worked mostly on the following things:
This month I mostly focussed on getting Xdebug 3 in shape for a first beta release, with all the new configuration names in place. There are now only a few tasks before I can release Xdebug 3.0.0beta1. I plan to release this around PHP 8.0RC2.
The main changes that I made was to rename the following four configuration settings, mostly to get "rid" of the remote naming:
xdebug.remote_host
→ xdebug.client_host
xdebug.remote_port
→ xdebug.client_port
xdebug.remote_connect_back
→ xdebug.discover_client_host
xdebug.remote_addr_header
→ xdebug.client_discovery_header
I hope that these new names are easier to explain, and of course the upgrade guide explains the changes too.
Although RC1 of PHP 8 is released today, there are still numerous items still in flux. In September there were various changes due to PHP 8's new named parameters. This mostly has an effect on Xdebug's tests, where these names are exposed as part of tracing or debugging tests. Because there are still changes, I am delaying Xdebug 3.0.0beta1 until PHP 8.0RC2.
Other API changes also meant that I had to make changes in Xdebug. Most notably related to code coverage, where PHP 8 will emit fewer Op codes and now (finally!) creates ASSIGN operations on the correct line (which makes Xdebug's breakpoint resolving feature less necessary).
There were two Xdebug releases in September. 2.9.7 changes the step debugger to set up TCP Keepalive probes. This results in better time-out management in case network connections between Xdebug and an IDE drops.
Unfortunately this patch caused compilation issues on FreeBSD where some OS specific flags are different (but the same as OSX, which Xdebug did handle correctly). A fix for this, as well as a fix for path/branch coverage with foreach loops resulted in the 2.9.8 release. I expect to create one more release related to the TCP Keepalive addition as the current release still does not compile for AIX.
Beyond this, I do not expect any more release of the Xdebug 2.9 series unless security or crash bugs are present.
Beyond fixing an off-by-one error in host name generation, I did not write any code for Xdebug Cloud. However, work is ongoing on a web site, and JetBrains is also working on supporting Xdebug Cloud in PhpStorm. Reports state that a prototype is now working. With one IDE soon to support Xdebug Cloud I am also sharing the protocol changes with other IDE/debug client authors before I make it part of the DBGp specification.
Truncated by Planet PHP, read more at the original (another 1282 bytes)
Economies rise and fall. It’s a cycle that can impact all of us in both positive and negative ways. But freelancers can be particularly vulnerable to these shifts.
Working as a solo web designer means that you’re always fending for yourself. Still, an economic downturn makes survival all the more challenging. Things can become precarious before you know it.
It doesn’t have to be all doom and gloom, though. Tough times can actually be a great opportunity to experiment and find (or redefine) your niche.
Whether the economy has your business sputtering or not, it’s important to think about ways you can kickstart growth in your own little corner of the web. And we’re here to help. Today, we’ll offer up some ideas that empower you to do more than just weather the storm.
The head-spinning pace of web development is one way to ensure that we remain essential workers in the online space. Something as (seemingly) simple as your favorite CMS upgrading a JavaScript library can cause all sorts of havoc.
Of course, there are plenty of other examples. Websites running any sort of legacy code are likely going to face incompatibilities at some point. Not to mention that plugins, themes and other tools we rely on don’t last forever.
Proactively looking for these types of issues on your client’s websites can be a solid source of revenue. This is a subject we should be thinking about anyway, as being inattentive to this evolution risks that something will break.
But it’s not just a matter of fixing old code. You might also explore other challenges your clients are facing. Perhaps there was a feature they really could have benefited from that wasn’t feasible a few years ago. Maybe it’s time to revisit the subject?
The main idea is to look for areas to repair or otherwise improve. It’s more than likely you’ll find a few things to keep your business going in the short-term.
Whether you’re already feeling the pinch of a downturn or want to be prepared just in case, it’s a good time to look at your money situation.
The first thing to review is your expenses – especially recurring ones. Are you spending money wisely? Things like web hosting, marketing services or even software licensing may be bleeding your bank account dry. When you have less money coming in, some of these items could be seen as unnecessary.
Now, this doesn’t mean you have to cut out each item completely. There may be some cases where simply downgrading an account level can save you some cash while still providing value.
It’s not always about cutting back, though. This could also be an opportunity to invest in areas that could make you more money now and in the future. Tools or even online educational courses have the potential to do that.
The most important part of this is knowing where you stand. From there, you can make decisions that can have a positive impact on your bottom line.
Recurring revenue is something that can carry you through tough times. It’s money you can depend on – bringing at least some level of certainty to your business.
Among the most common ways to gain recurring revenue is to partner up with another firm on a freelance/contract basis. Maybe it’s another freelancer who could use some extra help, or an agency that needs someone within your specialty.
These opportunities may start on a trial basis – which is smart. It’s always best to see what type of synergy the relationship brings. If things work out, you could have a long-term partner that provides a steady stream of income.
Then there is also the possibility of selling a product or service with some recurring revenue. A downturn could be the perfect chance to finally build that app or plugin you’ve been thinking about, or write the eBook that has been rattling around in your head.
What’s more, you can take on these projects in a way that suits your needs. You could, for example, provide regular updates to that app or even spruce up your writing as technology changes. Or, it might simply be a case of bringing in some passive income from your hard work.
Ideally, this will allow you to diversify your earnings. The more reliable sources of money you can procure, the better you’ll be able to maintain economic certainty.
Maintaining patience may just be the hardest thing on this list. Especially so in the face of a downtrodden economy. Yet it is no less vital.
Mind you, we’re not talking about just sitting around, waiting for things to happen. Rather, it’s a matter of carrying out your vision and not wavering in a challenging time.
In practice this means going after the types of clients that are the best fit for you and your business. If you’re looking for a certain sweet spot when it comes to project size and revenue, don’t be afraid to seek out the right opportunity. That is, as long as you can afford to do so.
Avoid settling for projects you don’t want to do – unless it’s an absolute necessity. Otherwise, you may book yourself into a corner and not be able to take advantage when the perfect fit does come along.
A difficult stretch for the economy doesn’t have to be a bad omen for your freelance web design business. While the potential for a negative impact is there, you may not feel the effects nearly as much as a larger business would.
Why is that? Freelancers have a level of flexibility that makes it possible to adjust as needed. So, even losing a big client is something you can recover from. That might not be the case for big companies with physical locations and employees to account for.
It’s an opportunity you need to seize. If something’s not working, change it. Take it upon yourself to be proactive and develop symbiotic relationships with other firms. Help your existing clients up their game.
There are so many ways to keep bringing in much-needed cash. Do it well and you may even find yourself ahead of your previous earnings pace.
Yes, it’s a challenge. But it’s one you can meet head-on.
The post How Freelance Designers Can Thrive in a Tough Economy appeared first on Speckyboy Design Magazine.