Modern PHP, soft skills, productivity and time management.

Tag: symfony (Page 1 of 2)

[Edit] How to deploy Symfony app with Capistrano 3 on cheap OVH VPS

tl;dr

If you want to deploy Symfony app using Capistrano 3 to cheap OVH VPS then you’ll need to write a simple task to set proper permissions.

Edit: unfortunately, there was still a little problem with permissions and I made deployment semi-automatic.


I have a very cheap VPS in OVH, it costs only about $2 per month. It is perfect for my needs, I have my blog there, I have my friend’s blog as well. And now I want to move my wife’s portfolio from (even cheaper :P) shared hosting to this VPS.

Until now deploy to shared hosting looked like this:

  1. open FTP
  2. go to portfolio directory
  3. move changed files
  4. app/console cache:clear

Nightmare.

Fortunately, I had access to SSH on my hosting (not popular thing) so I could try to automate this process a little bit. But because I already have VPS then the better idea was to move the portfolio there and use some tool for deployment.

The portfolio is written using Symfony 2 framework so the best idea is to use Capistrano. I had some experience with Capifony which is pretty old, unmaintained customization for Capistrano 2 (which is also quite old). I don’t want to use old stuff. So the goal is easy: deploy Symfony 2 app using Capistrano 3 to OVH, cheap VPS.
Continue reading

Symfony

Another contribution to Symfony merged! \o/

My Pull Request has been accepted by Symfony docs guy and will be merged soon. This is a minor change, but I think it’s a good idea to improve anything we see that can be improved.

This particular change was created because I’ve seen at least 3 programmers getting parameters in service not from injection but from the container. Hope it helps them to understand how to use parameters in a good way 🙂

PR can be seen here: https://github.com/symfony/symfony-docs/pull/8399

Feels good ?

How to make cool progressbar in Symfony command?

If you’re writing commands in Symfony then you probably know the ProgressBar component. It’s useful tool showing the current state of operations and, more importantly, ETA and used memory. Cool.

If you’ll go to the official ProgressBar component page then at the beginning you’ll see a very cool progress bar, with colors, icons, changing status messages, but… If you’ll look a little further you’ll see a sad, black and white progress bar, that is far from a “promise” made at the beginning 🙁

Heads up! We’ll make it like this 🙂
Continue reading

First attempt to Selenium and PHPUnit

This is a simple tutorial how to set up Selenium test with PHPUnit and phantomjs for easy and fast testing.

Today I wanted to learn something about Selenium. It’s very popular testing tool for any application that can be launched using a web browser, regardless of programming language or technology. I don’t know it very much, in fact, I know only how to set it up and write the simplest test 😉 But I want to share my today’s experiences because I cannot find any simple tutorial and had to glue together scripts, setting and libraries from all across the internet 😉

If you don’t like reading tutorials and want rather dig into example code I created the repository on GitHub where you can find everything I talk about here.
Continue reading

How to start developing in Symfony with only PHP installed?

This blog post will contain useful information for those, who want to start developing in Symfony without setting up a server (like apache or nginx) or installing docker.

PHP from version 5.4 has built in server. You can run it by executing in console php -S 127.0.0.1:8000 in your projects directory. When you go to this address (of course you can change the port and 127.0.0.1 to localhost) you’ll see the main page of your project.

Continue reading

PHPyths Buster: Annotations

I was working on a project in C# and ASP.NET MVC once. It was a long time ago. I can remember how happy I was. Earlier I was creating a project in PHP in the worst way: on an own framework. It was all old, shitty PHP. With big routing arrays, custom validation services, and ancient template engine, Smarty2.

When I started to create a project in ASP.NET I was astonished how many great features it has. One of them were annotations.
Continue reading

PHPyths Buster: Displaying reminders

Previously I’ve made a connection to Evernote and display list of all notes. Nice. But the project is about managing reminders, so let’s go to work!

Receiving reminders

First of all, I want to display only notes with reminders. It could be done using `NoteFilter`. It’s enough to add just one line:

`$nFilter->words = “reminderTime:* -reminderDoneTime:*”;`
Continue reading

PHPyths Buster: Evernote SDK [update]

It’s time to do some Evernote configuration.

To write an application that needs connection with Evernote I need a developer account. I have one, so in fact, you need it 😉

Credentials

Go to https://dev.evernote.com/doc/ and click “Get an API key” button and fill the form with your data. You’ll get Consumer Key and Consumer Secret needed to connect with Evernote.

Now I suggest you create a test account in https://sandbox.evernote.com/. It allows you to test your application using test account so you won’t mess up your real notes.
Continue reading

PHPyths Buster: Basic application

Ok, we have installed environment, everything works fine so we can start creating our app!

As you may remember I want to write simple application extending Evernote by simplify displaying reminders and do some daily action on some specific notes.

I’ll start with displaying the notes. By now I don’t need connection with Evernote itself, so I’ll create some dummy notes in PHP.

The model

Let’s start with the model for note. Model is the special type of PHP class which describes all data for the note. I need for sure: `id`, `title`, `description`, `remind at` date and maybe `created at` date. It is enough for now if the application will require some more information I’ll add it to the model. Continue reading

« Older posts

© 2024 Krzych Jończyk

Theme by Anders NorenUp ↑