Yii2 dev digest #6 Mar'14

After the long break here (unfortunately recent situation in my country do not lead to a good productivity), I am glad to announce the next digest.
In any case it seems that Yii2 developments is going close to the Beta and only a few big breaking changes were made in the last month ;)
And yes - Russian version of this digest is available (see the link above) !

Read more ...

Blog update #Feb'14 - Multilingual articles, sharing, kudos, seo optimisation

release

It has been a long time without a big update here, but not today. Today is the release day :)

  • Blog now support 3 languages - English (default), Russian and German. Now I will try to make all big posts in Russian too. German - is for my self motivation. In some time I should get enough knowledge of this great language to write IT post in it.
  • Posts and Notes are translated using different techniques in Yii2, it was a good experience
  • Share buttons - I have tried to make very light widget without tonnes of JS. Btw. need to prettify it and post to packagist.
  • Kudos - these cool smileys in the bottom on full text of the article. Don't know why, but I like it, just a quick and lazy "Thank you" button. Made it with localStorage to store vote status, so it does not pollute requests with Cookies. Also should be on packagist soon.
  • Automated deploy script - thanks to Davert and his Robo. As you can see on screenshot - it works. And I will definitely use it in future.
  • Lots of fixes inside and in HTML layout, but who cares ... :)

Read more ...

Faker - generating test data for database

Faker is a library that provide a set of generators for data types like fake name, address, number, IP, email, lorem ipsum text etc. - all generic data that is needed to create semi-real database content. Usually it has variations for different popular languages. All data is human-readable and taken from library, a lot of different combinations creates semi-unique data set.

It is needed mostly on testing and demonstration stages. Nobody likes to see a list of users like "test1", "Johnny35" etc. with posts "Test1", "Another test 35".

Implementation

PHP usage example

$faker = Faker\Factory::create();

// generate data by accessing properties
echo $faker->name;
  // 'Lucy Cechtelar';
echo $faker->address;
  // "426 Jordy Lodge
  // Cartwrightshire, SC 88120-6700"
echo $faker->text;
  // Sint velit eveniet. Rerum atque repellat voluptatem quia rerum. Numquam excepturi
  // beatae sint laudantium consequatur. Magni occaecati itaque sint et sit tempore. Nesciunt ...
for ($i=0; $i < 5; $i++) {
  echo $faker->name, "\n";
}
  // Adaline Reichel
  // Dr. Santa Prosacco DVM
  // Noemy Vandervort V
  // Lexi O'Conner
  // Gracie Weber

NB! Yii2 Framework has a Faker fixtures extensions


Ievgen
Kuzminov "iJackUA"
Web Team Lead
at MobiDev (Kharkiv, Ukraine)
Code in PHP and Ruby, play with JS/Node.JS, evaluate Elixir, explore databases, use Ubuntu and MacOS, think about IT people and management

Notes


Ansistrano- ansistrano.deploy and ansistrano.rollback are Ansible Galaxy roles to easily manage the deployment process for scripting applications such as PHP, Python and Ruby. It's an Ansible port for Capistrano.