Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!
Strony WWWSerwery VPSDomenyHostingDarmowy Hosting CBA.pl

Archive for the ‘WEB and PHP Development’ Category

Tomas Vortuba: How to Test Private Services in Symfony

Tomas Vortuba: How to Test Private Services in Symfony

Tomas Vortuba has a tutorial posted to his site showing you how to test private services in Symfony in unit tests for pre-4.1 Symfony installations (it has been resolved via simpler testing methods in Symfony 4.1 with the FrameworkBundle).

2 versions of Symfony are affected by this dissonance between services and tests. Do you use Symfony 3.4 or 4.0? Do you want to test your services, but struggle to get them in a clean way?

Today we look at possible solutions.

He starts with an example of the error you’d face if you tried to pull a service directly from the container that was marked as private. While you can specifically make it public in the yaml configuration, this potentially means doing that for all of the services you need to test. While this might work for smaller projects, it’s unmaintainable for larger ones. He then shares some other options that could help resolve the issue including the one he ended up on: a compiler pass. He gets into a bit of detail on the changes this would require and where the "magic" is that lets it work.

Source: http://www.phpdeveloper.org/news/26215

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Developing Laravel Packages with Local Composer Dependencies

Laravel News: Developing Laravel Packages with Local Composer Dependencies

On the Laravel News site they’ve posted a tutorial sharing some helpful hints for the Laravel users out there about developing package locally without having to release it and wait to pull the latest version back down.

Developing Composer packages locally through a local file symlink speeds up development immensely when you want to create Laravel packages and try them out on a real application. I was reading about a fancy bash alias by Caleb Porzio, which is a bash alias inspired by npm link.

I have been working on improving my local workflow for taking a Laravel package from development to release, and I often find myself installing my dependency through the GitHub repo, and then continue running composer update over and over as I update things because I am lazy.

I thought I’d document my workflow for developing new and existing Laravel packages and running them in a real Laravel application, all locally.

He then walks you through the process of creating a package locally and the changes you’ll need to make for your Laravel instance to recognize it:

  1. Create the package directory, Composer configuration and service provider
  2. Linking the package to Laravel via a Composer configuration update

Then, when you run a composer require on the example package, it is discovered as a local repository and pulled in for autoloading.

Source: http://www.phpdeveloper.org/news/26214

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Developing Laravel Packages with Local Composer Dependencies

Laravel News: Developing Laravel Packages with Local Composer Dependencies

On the Laravel News site they’ve posted a tutorial sharing some helpful hints for the Laravel users out there about developing package locally without having to release it and wait to pull the latest version back down.

Developing Composer packages locally through a local file symlink speeds up development immensely when you want to create Laravel packages and try them out on a real application. I was reading about a fancy bash alias by Caleb Porzio, which is a bash alias inspired by npm link.

I have been working on improving my local workflow for taking a Laravel package from development to release, and I often find myself installing my dependency through the GitHub repo, and then continue running composer update over and over as I update things because I am lazy.

I thought I’d document my workflow for developing new and existing Laravel packages and running them in a real Laravel application, all locally.

He then walks you through the process of creating a package locally and the changes you’ll need to make for your Laravel instance to recognize it:

  1. Create the package directory, Composer configuration and service provider
  2. Linking the package to Laravel via a Composer configuration update

Then, when you run a composer require on the example package, it is discovered as a local repository and pulled in for autoloading.

Source: http://www.phpdeveloper.org/news/26214

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Developing Laravel Packages with Local Composer Dependencies

Laravel News: Developing Laravel Packages with Local Composer Dependencies

On the Laravel News site they’ve posted a tutorial sharing some helpful hints for the Laravel users out there about developing package locally without having to release it and wait to pull the latest version back down.

Developing Composer packages locally through a local file symlink speeds up development immensely when you want to create Laravel packages and try them out on a real application. I was reading about a fancy bash alias by Caleb Porzio, which is a bash alias inspired by npm link.

I have been working on improving my local workflow for taking a Laravel package from development to release, and I often find myself installing my dependency through the GitHub repo, and then continue running composer update over and over as I update things because I am lazy.

I thought I’d document my workflow for developing new and existing Laravel packages and running them in a real Laravel application, all locally.

He then walks you through the process of creating a package locally and the changes you’ll need to make for your Laravel instance to recognize it:

  1. Create the package directory, Composer configuration and service provider
  2. Linking the package to Laravel via a Composer configuration update

Then, when you run a composer require on the example package, it is discovered as a local repository and pulled in for autoloading.

Source: http://www.phpdeveloper.org/news/26214

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Exakat Blog: Weird operators in PHP

Exakat Blog: Weird operators in PHP

On the Exakat blog there’s a new post sharing some of the weird operators in PHP that you may have not known existed. These are ones outside of the normal = or . that can really do some odd things.

If you read the PHP documentation, you will learn about a ton of operators. If you haven’t learnt about PHP operators, go do that first, we’ll wait for you.

Operators are usually made up with strange symbols, like !, -, =>, <=>, ^ or ~. Really, some are plain readable like and, while some are merely an missed attempt at being readable, and actually hide a double personnality, like xor.

You probably think you know PHP’s documentation in and out, but there is always more to learn. So I dove deep into the core of PHP code, and looked some special PHP operators that are lesser known, but very useful in your daily coding.

There’s ten of the odd operators on their list including:

  • the "b" operator for strings
  • the "left object" operator
  • constant names with * and %

Check out the full post for the details (and code examples) on each of these and more.

Source: http://www.phpdeveloper.org/news/26213

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Site News: Popular Posts for This Week (05.18.2018)

Site News: Popular Posts for This Week (05.18.2018)

Popular posts from PHPDeveloper.org for the past week:

Source: http://www.phpdeveloper.org/news/26212

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Site News: Blast from the Past – One Year Ago in PHP (05.17.2018)

Site News: Blast from the Past – One Year Ago in PHP (05.17.2018)

Here’s what was popular in the PHP community one year ago today:

Source: http://www.phpdeveloper.org/news/26211

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Matt Sparks: Building a PHP Framework Series (Parts 1-4)

Matt Sparks: Building a PHP Framework Series (Parts 1-4)

On this site Matt Sparks has posted the first few parts of a series covering the creation of a custom framework. Why? Well, as he explains in part one of the series:

So with all of that being said, it begs the question: why on Earth would you want to do this?

The extremely short answer: I want to. The less short answer: A PHP framework encompasses many of the areas I want to learn more about.

The first four posts of the series are already on his site (with more to come):

Matt does a great job of laying out some of the fundamentals behind frameworks including structure, design patterns, and commonalities between frameworks. You can follow along with his progress on the project on the AnalyzePHP GitHub repositories.

Source: http://www.phpdeveloper.org/news/26210

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

PHPUgly Podcast: Episode #105 – Exposed Source

PHPUgly Podcast: Episode #105 – Exposed Source

The PHPUgly podcast, hosted by PHP community members Eric Van Johnson, John Congdon and Thomas Rideout, has posted their latest episode: Episode #105 – Exposed Source.

Topics mentioned in this show include:

You can listen to this latest episode either using the in-page audio player or by downloading the mp3 directly. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter for the latest updates when new shows are released.

Source: http://www.phpdeveloper.org/news/26209

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Introducing View Components in Laravel, an alternative to View Composers

Laravel News: Introducing View Components in Laravel, an alternative to View Composers

On the Laravel News site there’s a new post covering a refactoring of view handling that’s possible with recent versions of the framework: using view components instead of view composers..

In software development, one of the “best practices” is to create reusable code that can be implemented in different parts of your application if needed. [...] View composers allow you to move the logic outside your controller and pass the data to the specified set of views. [Using view components instead of composers lets you] reuse complex components using dynamic data on any view within your application.

To help illustrate the difference they set up a scenario of a blog with a "highlights" sidebar based on data from an API response. With view composers you could extract this logic out of the controllers and add it more automatically to the view itself. They point out that this can work for a majority of the situations there’s another method that is even more flexible: a reusable component implemented directly on the view. He provides the complete code showing an examples of this components, including a custom Blade directive.

Source: http://www.phpdeveloper.org/news/26208

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>