Monthly Archiv: October, 2020

Mezon Security Provider (New)

Package:
Mezon Security Provider
Summary:
Store authenticated user data using sessions
Groups:
Libraries, PHP 5, User Management
Author:
Alexey Dodonov
Description:
This package can be used to store authenticated user data using sessions...

Read more at https://www.phpclasses.org/package/11792-PHP-Store-authenticated-user-data-using-sessions.html

mezon-security-provider (New)

Package:
mezon-security-provider
Summary:
Store authenticated user data using sessions
Groups:
Libraries, PHP 5, User Management
Author:
Alexey Dodonov
Description:
This package can be used to store authenticated user data using sessions...

Read more at https://www.phpclasses.org/package/11792-PHP-Store-authenticated-user-data-using-sessions.html

Step-debugging linked composer dependencies with PhpStorm

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.

Directory layout

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.

Linked directories in composer

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

Setting up PhpStorm

We create a PhpStorm project for ./main-app and then add plug-one to it as a "content root":

  • Go to Preferences -> Directories
  • Click "+ Add Content Root" add add {full path}/plugin-one
  • Click "Apply" and then "OK" to close the Preferences dialog

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:

  • In the Project tree view, find the main-app/vendor/client/plugin-one folder and select it
  • Right click -> Mark Directory As -> Excluded

The folder will now be coloured orange, so we know it's excluded.

Set-up for debugging

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.

  • Go to Preferences -> Languages & Frameworks -> PHP -> Servers
  • Add a new entry:
    • Name: {dev-hostname-for-main-app}
    • Host: {dev-hostname-for-main-app}
    • Port: 8888 (or whatever)
    • Debugger: Xdebug (of course!)
    • [✓] Use path mappings
    • In the File/Directory list set up these mappings:
      • {full path on local disk}/main-app => /var/www/html/main-app
      • {full path on local disk}/plugin-one => /var/www/html/plugin-one

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.

Start debugging

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!

Fin

This worked for me, hopefully it'll work for you too if you have a similar situation!

Bring the Latest News and Information to Your App with mediastack Sponsored

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 Home Page

Implement Top News Sources from Around the World

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:

Access to 7,500+ News Services

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.

mediastack News Service Listing

Real-Time and Historical News

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.

A Scalable JSON REST API

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.

It’s Easy to Get Started

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.

mediastack Code Examples

Get Your Free mediastack API Key

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.

Community News: Latest PECL Releases (10.06.2020)

Latest PECL Releases:

  • uuid 1.2.0
    - raise warnings on bad input value with PHP 7

    • promote warnings to ValueError with PHP 8
    • add type hinting with PHP 8
    • fix bug #66982 uuid_mac checks wrong bit/byte for valid MAC address
  • mongodb 1.8.1
    ** Bug * [PHPC-1683] - Collect error labels from writeConcernErrors in libmongoc bulk write replies * [PHPC-1687] - Session::commitTransaction() leaks reply document on success
  • pdo_sqlsrv 5.9.0preview1
    [Added] - Support for PHP 8.0 RC 1 - Support for Ubuntu 20.04 and Alpine 3.12 - Support for GB18030 locale [#1115]( https://github.com/microsoft/msphpsql/pull/1115) - Feature Request [#924](https://github.com/microsoft/msphpsql/issues/924) - extended PDO errorinfo to include [additional odbc messages if available](https://github.com/microsoft/msphpsql/wiki/Features#pdoErrorInfo) - pull request [#1133]( https://github.com/microsoft/msphpsql/pull/1133) - [Data Classification with rank info](https://github.com/microsoft/msphpsql/wiki/Features#dataClass), which requires [MS ODBC Driver 17.4.2+](https://docs.microsoft.com/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver15) and [SQL Server 2019](https://www.microsoft.com/sql-server/sql-server-2019) or an Azure SQL instance that supports it [Removed] - Dropped support for Ubuntu 19.10 and Debian 8. [Fixed] - Pull Request [#1127](https://github.com/microsoft/msphpsql/pull/1127) - removal of TSRMLS macros in preparation for PHP 8 by remicollet - Pull Request [#1136](https://github.com/microsoft/msphpsql/pull/1136) - improved performance when handling decimal numbers as inputs or outputs and removed unncessary conversions for numeric values - Pull Request [#1143](https://github.com/microsoft/msphpsql/pull/1143) - if an exception occurs when executing a query, will not change the output parameters - Pull Request [#1144](https://github.com/microsoft/msphpsql/pull/1144) - use the correct C types when binding output parameters with integer values - Pull Request [#1146](https://github.com/microsoft/msphpsql/pull/1146) - improved performance when fetching numbers using client buffers - Issue [#1170](https://github.com/microsoft/msphpsql/issues/1170) - when fetching large data types such as ntext will check more than only the display size - pull request [#1172](https://github.com/microsoft/msphpsql/pull/1172) [Limitations] - No support for inout / output params when using sql_variant type - No support for inout / output params when formatting decimal values - In Linux and macOS, setlocale() only takes effect if it is invoked before the first connection. Attempting to set the locale after connecting will not work - Always Encrypted requires [MS ODBC Driver 17+](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server) - Only Windows Certificate Store and Azure Key Vault are supported. Custom Keystores are not yet supported - Issue [#716](https://github.com/Microsoft/msphpsql/issues/716) - With Always Encrypted enabled, named parameters in subqueries are not supported - Issue [#1050](https://github.com/microsoft/msphpsql/issues/1050) - With Always Encrypted enabled, insertion requires the column list for any tables with identity columns - [Always Encrypted limitations](https://docs.microsoft.com/sql/connect/php/using-always-encrypted-php-drivers#limitations-of-the-php-drivers-when-using-always-encrypted) [Known Issues] - This preview release requires ODBC Driver 17.4.2 or above. Otherwise, a warning about failing to set an attribute may be suppressed when using an older ODBC driver. - Connection pooling on Linux or macOS is not recommended with [unixODBC](http://www.unixodbc.org/) < 2.3.7 - When pooling is enabled in Linux or macOS - unixODBC <= 2.3.4 (Linux and macOS) might not return proper diagnostic information, such as error messages, warnings and informative messages - due to this unixODBC bug, fetch large data (such as xml, binary) as streams as a workaround. See the examples [here](https://github.com/Microsoft/msphpsql/wiki/Features#pooling)
  • sqlsrv 5.9.0preview1
    [Added] - Support for PHP 8.0 RC 1 - Support for Ubuntu 20.04 and Alpine 3.12 - Support for GB18030 locale [#1115]( https://github.com/microsoft/msphpsql/pull/1115) - [Data Classification with rank info](https://github.com/microsoft/msphpsql/wiki/Features#dataClass), which requires [MS ODBC Driver 17.4.2+](https://docs.microsoft.com/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver15) and [SQL Server 2019](https://www.microsoft.com/sql-server/sql-server-2019) or an Azure SQL instance that supports it [Removed] - Dropped support for Ubuntu 19.10 and Debian 8. [Fixed] - Pull Request [#1127](https://github.com/microsoft/msphpsql/pull/1127) - removal of TSRMLS macros in preparation for PHP 8 by remicollet - Pull Request [#1136](https://github.com/microsoft/msphpsql/pull/1136) - improved performance when handling decimal numbers as inputs or outputs and removed unncessary conversions for numeric values - Pull Request [#1143](https://github.com/microsoft/msphpsql/pull/1143) - if an exception occurs when executing a query, will not change the output parameters - Pull Request [#1144](https://github.com/microsoft/msphpsql/pull/1144) - use the correct C types when binding output parameters with integer values - Pull Request [#1146](https://github.com/microsoft/msphpsql/pull/1146) - improved performance when fetching numbers using client buffers - Pull Request [#1165](https://github.com/microsoft/msphpsql/pull/1165) - setting query timeout without using LOCK TIMEOUT, which saves an extra trip to the server - Issue [#1170](https://github.com/microsoft/msphpsql/issues/1170) - when fetching large data types such as ntext will check more than only the display size - pull request [#1172](https://github.com/microsoft/msphpsql/pull/1172) [Limitations] - No support for inout / output params when using sql_variant type - No support for inout / output params when formatting decimal values - In Linux and macOS, setlocale() only takes effect if it is invoked before the first connection. Attempting to set the locale after connecting will not work - Always Encrypted requires [MS ODBC Driver 17+](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server) - Only Windows Certificate Store and Azure Key Vault are supported. Custom Keystores are not yet supported - Issue [#716](https://github.com/Microsoft/msphpsql/issues/716) - With Always Encrypted enabled, named parameters in subqueries are not supported - Issue [#1050](https://github.com/microsoft/msphpsql/issues/1050) - With Always Encrypted enabled, insertion requires the column list for any tables with identity columns - [Always Encrypted limitations](https://docs.microsoft.com/sql/connect/php/using-always-encrypted-php-drivers#limitations-of-the-php-drivers-when-using-always-encrypted) [Known Issues] - This preview release requires ODBC Driver 17.4.2 or above. Otherwise, a warning about failing to set an attribute may be suppressed when using an older ODBC driver. - Connection pooling on Linux or macOS is not recommended with [unixODBC](http://www.unixodbc.org/) < 2.3.7 - When pooling is enabled in Linux or macOS - unixODBC <= 2.3.4 (Linux and macOS) might not return proper diagnostic information, such as error messages, warnings and informative messages - due to this unixODBC bug, fetch large data (such as xml, binary) as streams as a workaround. See the examples [here](https://github.com/Microsoft/msphpsql/wiki/Features#pooling)
  • APCu 5.1.19
    - Fixed apcu_store() with integer keys (#388). - Made apc.use_request_time=0 the default (#391). - Made apcu compatible with PHP 8.0.
  • dbase 7.1.0RC2
    New features
    • Full fledged arginfo is available under PHP 8 (Remi Collet)
    • Calling dbase functions with wrong parameter types/values throws TypeExceptions and ValueExceptions, respectively, instead of raising warnings under PHP 8 (Remi Collet)

    Bug Fixes

    • Fixed #80156 (Incomplete records may be written)
  • dbase 7.1.0RC1
    New features
    • Full fledged arginfo is available under PHP 8 (Remi Collet)
    • Calling dbase functions with wrong parameter types/values throws TypeExceptions and ValueExceptions, respectively, instead of raising warnings under PHP 8 (Remi Collet)

    Bug Fixes

    • Fixed #80156 (Incomplete records may be written)
  • maxminddb 1.8.0
    * Fixes for PHP 8.0. Pull Request by Remi Collet. GitHub #108.
  • translit 0.7.1
    - Added support for PHP 8.0 (Remi Collet)
  • zip 1.19.1
    - encode parameter is optional (PHP 8) - deprecate procedural API with PHP 8 - promote warning to exception (PHP 8) - Fixed bug #79678 Build fails due to undeclared ZIP_RDONLY - add ZipArchive::CM_ZSTD constant (since libzip 1.8.0)

Xdebug Update: September 2020

Xdebug Update: September 2020

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:

Xdebug 3

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_hostxdebug.client_host

  • xdebug.remote_portxdebug.client_port

  • xdebug.remote_connect_backxdebug.discover_client_host

  • xdebug.remote_addr_headerxdebug.client_discovery_header

I hope that these new names are easier to explain, and of course the upgrade guide explains the changes too.

Releases

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.

Truncated by Planet PHP, read more at the original (another 1282 bytes)

How Freelance Designers Can Thrive in a Tough Economy

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.

Look for Problems to Solve

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.

A person using a laptop computer.

Revisit Your Finances

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.

Financial information displayed on a computer screen.

Explore Opportunities for Recurring Revenue

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.

A neon sign depicting a handshake.

Stay Patient

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 person wearing a wristwatch.

Look Beyond Mere Survival

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.

Powered by Gewgley