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ł!

Archive for Maj, 2017

Site News: Popular Posts for This Week (05.26.2017)

Site News: Popular Posts for This Week (05.26.2017)

Popular posts from PHPDeveloper.org for the past week:

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

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

Site News: Popular Posts for This Week (05.26.2017)

Site News: Popular Posts for This Week (05.26.2017)

Popular posts from PHPDeveloper.org for the past week:

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

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

SitePoint PHP Blog: Re-Introducing Symfony Console – CLI PHP for the Uninitiated!

SitePoint PHP Blog: Re-Introducing Symfony Console – CLI PHP for the Uninitiated!

The SitePoint PHP blog has posted a tutorial from author Claudio Ribeiro that wants to re-introduce you to the Symfony Console package, a component of the larger Symfony framework that makes it easier to create and work with command-line PHP scripts.

As software developers, we often feel the need to resort to command line tools. These kinds of tools are helpful when we need to do a sort of recurring task like migrating data, performing imports, or creating cron jobs.

The Symfony Console component tool provides us with a simple framework to create our own command line tools. Unlike many components in Symfony, this is a standalone package and is used by the likes of Laravel‘s Artisan and many other famous PHP packages.

The tutorial then walks you through the installation process, via Composer, and the creation of a new command. With this simple base created, he then adds in actual functionality, building out a command to hash and verify a password string. They show how to use the command and an example of its output. Next up, he creates another command example, this time verifying the password hash provided as an argument. The tutorial wraps up with a look at testing your console comamnds with PHPUnit tests via the included CommandTester functionality.

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

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

SitePoint PHP Blog: Re-Introducing Symfony Console – CLI PHP for the Uninitiated!

SitePoint PHP Blog: Re-Introducing Symfony Console – CLI PHP for the Uninitiated!

The SitePoint PHP blog has posted a tutorial from author Claudio Ribeiro that wants to re-introduce you to the Symfony Console package, a component of the larger Symfony framework that makes it easier to create and work with command-line PHP scripts.

As software developers, we often feel the need to resort to command line tools. These kinds of tools are helpful when we need to do a sort of recurring task like migrating data, performing imports, or creating cron jobs.

The Symfony Console component tool provides us with a simple framework to create our own command line tools. Unlike many components in Symfony, this is a standalone package and is used by the likes of Laravel‘s Artisan and many other famous PHP packages.

The tutorial then walks you through the installation process, via Composer, and the creation of a new command. With this simple base created, he then adds in actual functionality, building out a command to hash and verify a password string. They show how to use the command and an example of its output. Next up, he creates another command example, this time verifying the password hash provided as an argument. The tutorial wraps up with a look at testing your console comamnds with PHPUnit tests via the included CommandTester functionality.

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

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

SitePoint PHP Blog: Re-Introducing Symfony Console – CLI PHP for the Uninitiated!

SitePoint PHP Blog: Re-Introducing Symfony Console – CLI PHP for the Uninitiated!

The SitePoint PHP blog has posted a tutorial from author Claudio Ribeiro that wants to re-introduce you to the Symfony Console package, a component of the larger Symfony framework that makes it easier to create and work with command-line PHP scripts.

As software developers, we often feel the need to resort to command line tools. These kinds of tools are helpful when we need to do a sort of recurring task like migrating data, performing imports, or creating cron jobs.

The Symfony Console component tool provides us with a simple framework to create our own command line tools. Unlike many components in Symfony, this is a standalone package and is used by the likes of Laravel‘s Artisan and many other famous PHP packages.

The tutorial then walks you through the installation process, via Composer, and the creation of a new command. With this simple base created, he then adds in actual functionality, building out a command to hash and verify a password string. They show how to use the command and an example of its output. Next up, he creates another command example, this time verifying the password hash provided as an argument. The tutorial wraps up with a look at testing your console comamnds with PHPUnit tests via the included CommandTester functionality.

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

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

Sebastian De Deyne: TypeScript With Laravel Mix

Sebastian De Deyne: TypeScript With Laravel Mix

In a post to his site Sebastian De Deyne shows how to use Laravel Mix to work with Typescript right alongside other packages and libraries included in your mix configuration.

In a recent Spatie project we decided to give TypeScript a shot for the business critical part of a new application. TypeScript provides static analysis to reduce the chance of introducing bugs, to have self-documenting code, and to improve our tooling (autocompletion!)

We’ve been happily using Laravel Mix since it’s release with Laravel 5.4. Luckily, extending Mix isn’t too hard with some webpack knowledge. [...] As long as you’ve configured an appropriate loader, you could import anything from a plain old JavaScript file to an animated gif. This means that if we want to support TypeScript with Laravel Mix, we don’t need to change any configuration, we only need to add the ability to bundle TypeScript files.

The remainder of the article is broken down into the four steps (and a bonus) for getting Mix and TypeScript playing together nicely:

  • Install The Necessary Dependencies
  • Configure TypeScript
  • Configure Laravel Mix
  • Write Some TypeScript!

The bonus at the end shows how to use this working setup to go one step further and use TypeScript in the Vue.js components in your Laravel application.

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

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

thePHP.cc: Testing Keeps Me From Getting Things Done

thePHP.cc: Testing Keeps Me From Getting Things Done

On thePHP.cc site they have a new post that tries to refute a common claim from developers when it comes to testing: testing keeps me from getting things done. The post is a response to an email to the group about testing asking where the real value is in applications versus libraries/tools.

To successfully develop software means to work target-oriented. These targets should be derived from acceptance criteria that are reconciled with the business. Without clear targets – we mean at a task level, not project or annual targets – the developer runs the risk of getting lost in work. Most importantly, he does not know when he is done with a task.

It is prudent to document and verify acceptance criteria through automated tests. One way or another, the targets have to be defined before production code gets written. This is test-driven development, whether you want to call it that or not.

The response goes on to talk about how, with tests written after the code has already been written (legacy code), it’s not always clear what the original intent was resulting in lost context. It also compares two of the main types of testing – integration and unit – and the place each has in an overall testing strategy.

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

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

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

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

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

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

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

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

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

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

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

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

SitePoint PHP Blog: How to Use Laravel Mix in Non-Laravel Projects

SitePoint PHP Blog: How to Use Laravel Mix in Non-Laravel Projects

The SitePoint PHP blog has posted a new tutorial for those developers out there that like the idea of the Laravel Mix functionality for defining Webpack builds but aren’t using the rest of the framework for their application.

If you, like me, just want to get up and running on a project as quickly as possible, you probably don’t want to spend time configuring build tools like Webpack. Laravel Mix solves this problem, and makes asset compiling incredibly easy, but what if you want to use it on a non-Laravel project? This article shows you how to accomplish that.

[...] Laravel Mix, formerly Elixir, could be defined as an API wrapper for Webpack. It has a fluent syntax and is generally easy to use. Setting up versioning, hot reloading, and asset building/compiling is a breeze and requires only a single configuration file and a few lines of code.

The post starts off with the requirements you’ll need to create the build – besides the Mix code, naturally (NPM and Node). He includes the commands to get the required packages installed and how to create the initial Webpack "mix" file. They then add a few packages to be installed, create assets to be compiled and run the tool to perform the actual build. There’s also a section about "cache busting" and, finally, setting up a local index file to test out the result. The tutorial ends with a few other helpful commands you might want to use during your development.

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

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