logotype
  • Home
  • Home
    • Homepage 1
    • Homepage 2
    • Homepage 3
    • Homepage 4
    • Homepage 5
    • Homepage 6
    • Homepage 7
    homepage 1

    Main home(01)

    homepage 2

    Creative agency(02)

    homepage 3

    Minimal agency(03)

    homepage 4

    Digital company(04)

    homepage 5

    Design company(05)

    homepage 6

    Minimal studio(06)

    homepage 7

    Portfolio minimal(07)

    homepage coming soon2

    In development(08)

  • About
  • Services
    • Website Design And Development
    • MOBILE APPS
    • MANAGEMENTS AND ASSIST
  • Blog
  • Contact
  • Pages
    • About us
    • Our team
    • Services
    • History
    • Philosophy
    • FAQ’s
    • Typography
    • Elements
    • Page 404
    • Coming soon
    • Mega menu page
  • Blog
    • Blog listing
    • Blog grid
      • 2 columns
      • 2 col + sidebar
      • 3 columns
      • 4 col wide
    • Masonry grid
      • 2 columns
      • 2 col + sidebar
      • 3 columns
      • 4 col wide
    • Blog singles
      • Standard
      • Video
      • Quote
      • Gallery
      • Link
      • Audio
    • Single layouts
      • Overlay image
      • Title first
      • Image first
  • Portfolio
    • Grid
      • 2 columns
      • 3 columns
      • 4 col wide
      • 5 col wide
    • Masonry
      • Grid 1
      • Grid 2
      • Grid 3
    • Gallery
    • Single
  • Shop
    • Cart
    • Checkout
    • My account
    • Wishlist
    Shop
    • Products Grid
    • Single Product
    • Cart
    • Checkout
    • Wishlist
    • Login - Register
    • Help Center
  • Contacts
    Contacts
    address:
    27 Division St, NY 10002 USA
    email:
    burido@mail.com
    phone:
    +1 800 123 456 78
    X-twitterFacebook-fInstagram
    Get in Touch

    Your email address will not be published. Required fields are marked *

Get in Touch
logotype
  • Home
  • Home
    • Homepage 1
    • Homepage 2
    • Homepage 3
    • Homepage 4
    • Homepage 5
    • Homepage 6
    • Homepage 7
    homepage 1

    Main home(01)

    homepage 2

    Creative agency(02)

    homepage 3

    Minimal agency(03)

    homepage 4

    Digital company(04)

    homepage 5

    Design company(05)

    homepage 6

    Minimal studio(06)

    homepage 7

    Portfolio minimal(07)

    homepage coming soon2

    In development(08)

  • About
  • Services
    • Website Design And Development
    • MOBILE APPS
    • MANAGEMENTS AND ASSIST
  • Blog
  • Contact
  • Pages
    • About us
    • Our team
    • Services
    • History
    • Philosophy
    • FAQ’s
    • Typography
    • Elements
    • Page 404
    • Coming soon
    • Mega menu page
  • Blog
    • Blog listing
    • Blog grid
      • 2 columns
      • 2 col + sidebar
      • 3 columns
      • 4 col wide
    • Masonry grid
      • 2 columns
      • 2 col + sidebar
      • 3 columns
      • 4 col wide
    • Blog singles
      • Standard
      • Video
      • Quote
      • Gallery
      • Link
      • Audio
    • Single layouts
      • Overlay image
      • Title first
      • Image first
  • Portfolio
    • Grid
      • 2 columns
      • 3 columns
      • 4 col wide
      • 5 col wide
    • Masonry
      • Grid 1
      • Grid 2
      • Grid 3
    • Gallery
    • Single
  • Shop
    • Cart
    • Checkout
    • My account
    • Wishlist
    Shop
    • Products Grid
    • Single Product
    • Cart
    • Checkout
    • Wishlist
    • Login - Register
    • Help Center
  • Contacts
    Contacts
    address:
    27 Division St, NY 10002 USA
    email:
    burido@mail.com
    phone:
    +1 800 123 456 78
    X-twitterFacebook-fInstagram
    Get in Touch

    Your email address will not be published. Required fields are marked *

Get in Touch
php Tag
HomePosts Tagged "php"

Tag: php

feature
BlogPortfolio
July 20, 2024By Amine G

TURK GUZELI – BOOK YOUR BEAUTY

TURK GUZELI – BOOK YOUR BEAUTY SESSION ONLINE IN TURKEY

APP Available only in Turkey .

Development : Naro Dev

Read More
Screenshot 2024-07-19 at 13-25-11 Pneu Service – Le catalogue des pneus pour particuliers en Algérie
BlogPortfolio
July 19, 2024By Amine G

Pneu Service Dz – Vente En Ligne Des Pneus

Pneu Service Dz – Vente En Ligne Des Pneus

https://pneuservice.dz

Development : Naro Dev

Garphics : Graphéin

Read More
image-4
Portfolio
March 11, 2022By Amine G

Medicocare.dz – Medical Equipments

Medicocare.dz – Medical Equipments

https://medicocare.dz/


Home

A Narodev Creation :
– Amine G –
– Ilyes A –
– Mohammed .N.B –


Section 2 – Home

Catalogue

Contact

Read More
image
Portfolio
March 11, 2022By Amine G

Saiko Sushi (Non Official)

Saiko Sushi – Japaneese Food .

Read More
Data Delete
Blog
August 27, 2019By Amine G

Efficiently delete a million files on Linux servers

Data Delete


It happens to the best: some script rockets to the skyline resulting in an instand system administrator headache because some folder – typically, sessions – was stuffed with millions of files. Linux is not quite happy with that, deleting the folder is not an option and the loyal “rm -rf” command decides to call it a day. To make things even worse: you want to remove only files of some days ago… what are the options?

Find is you friend

The Linux “find” command is a possible solution, many will go for:

find /yourmagicmap/* -type f -mtime +3 -exec rm -f {} \;

The command above will give a list of files older than 3 days and will pass each found file to the rm command. The rule above has one problem though: it will take some time, since calling the rm command a million times is not exactly what you can call efficient.

A better option is:

 find /yourmagicmap/* -type f -mtime +3 -delete

This adds the delete flag to the find command giving it the command to throw it all away. Do the right thing and pass along your command in a cronjob if you need to clean out the folder on a regular basis.

The rsync alternative!

rsync is without doubt one of the most handy commands when it comes to file operations. Rsync can do any kind of volume sync – as you may know – but it also provides a way to empty a folder.
The example below assumes you have a folder named /tmp/empty/ which contains no files, and a folder /tmp/session/ that contains too much crap. The rule below allows you to remove those files:

rsync -a --delete /tmp/empty /tmp/session/

Which is the fastest? 

rm: deleting millions of file is a no-can-do!

find -exec: an option, but slower!

find -delete: fast and easy way to remove loads of files.

rsync –delete: without doubt the quickest!

Read More
php_framework_circle
Blog
July 3, 2019By Amine G

PHP MVC Framework Showdown: 7.1 Performance

A simple performance comparison of 6 PHP MVC style frameworks using PHP 7.1.

  • Test Kit: php-framework-benchmark
  • Test Server: Digital Ocean Ubuntu 16.04.1 x64 2gb / 2CPU droplet.
  • Test Software: PHP 7.1.0, Apache 2.4.18

I used a minimal installation of PHP and Apache with no additional configurations or sever settings changed.

Overview

The benchmark tool kit executes a simple “hello world”, it does this with the frameworks minimal settings, no database, no debugging and if possible, no template engine.

Read more about the testing on the benchmark tool kits page.

Results

Out of the 6 frameworks tested Codeigniter 3 produced the most requests per second and the least memory usage. Zend Framework 2.5 produced the least requests per second and Laravel 5.3 produced the most memory usage.

No framework: 7,094 requests per second, .34M memory.
Codeigniter 3: 2,245 requests per second, .38M memory.
Lumen 5.3: 1,543 requests per second, .63M memory.
Fuel 1.8: 1,033 requests per second, .60M memory.
Symfony 3.0: 551 requests per second, 1.52M memory.
Laravel 5.3: 331 requests per second, 1.53M memory
Zend 2.5: 291 requests per second, 1.34M memory

Compared to PHP 7.0 we see close to 2,000 more requests per second with no framework along with a considerable increase for Codeigniter 3.

Requests Per Second

Codeigiter produces the most requests per seconds. Lumen and Fuel perform decently well but the rest of the frameworks produced very low results.

Memory

Codeigniter consumes the least amount of memory. Lumen and Fuel come in under 1M but Laravel, Symfony and Zend consume more then double the memory of the other frameworks.

Execution Time

Laravel and Zend take the longest time to execute with Symfony close behind. Fuel and Lumen are the fastest and Codeigniter has fallen to 3rd place.

Included Files

Codeigniter, Lumen and Fuel remain the top 3 frameworks that include the least files. Symfony is loading less files while Laravel has appeared to doubled the amount of included files.

PHP 7.0 Comparison

PHP 7.0

PHP 7.1

We see most frameworks have improved requests per second. Laravel has moved up one spot and all frameworks serve more requests then before.

Almost all the frameworks utilize less memory. In the case of Laravel and Symfony we see memory usage now under 2M.

Read More
PHP 7
Blog
December 7, 2018By Amine G

What’s New in PHP 7.3 in 30 Seconds in Diffs

No time but eager to hear PHP news? PHP 7.3 is out in December 2018 and it brings 173 changes. Which are the most useful ones?

From features that might be the most interesting to those lesser ones, that anybody will rarely use.

1. Comma After the Last Argument

Do you know this?

 $array = [
     1,
+    2,
 ];

We’ll be able to do this:

 $this->someFunction(
     $arg,
+    $arg2,
 );

But still not this:

 function someFunction(
     $arg,
+    $arg2,
 ) {}

Thanks Jacob for pointing this difference out.

25 seconds to go…

2. First and Last Array Key

  • array_key_first
 $items = [
     1 => 'a',
     2 => 'b',
 ];

-reset($items);
-$firstKey = key($items);
+$firstKey = array_key_first($items);
 var_dump($firstKey); // 1
  • array_key_last
 $items = [
     1 => 'a',
     2 => 'b',
 ];

-end($items);
-$lastKey = key($items);
+$lastKey = array_key_last($items);
 var_dump($lastKey); // 2

These will be handy in coding standard tools.

Still 15 seconds…

3. Countable for Risky Variables

I don’t think having a variable of 2 forms is a good idea:

<?php

$items = null; // same as "private $items;" in a class

echo sprintf('There is %d items', count($items));
// error Warning: count(): Parameter must be an array or an object that implements Countable

But in case of that smelly (3rd party) code, there is a help:

  • is_countable
 $items = null;

+if (is_countable($items)) {
-echo sprintf('There is %d items', count($items));
+     echo sprintf('There is %d items', count($items));
+}

Only 5 seconds, hurry!

4. Safer JSON Parsing

-json_encode($data);
+json_encode($data, JSON_THROW_ON_ERROR);
-json_decode($json);
+json_decode($json, null, null, JSON_THROW_ON_ERROR);

So you’ll be able to do:

try {
    return json_decode($json, null, null, JSON_THROW_ON_ERROR);
} catch (JsonException $exception) {
    // ...
}

I’ve used similar technique for years thanks to Nette\Utils and I’ve never complained:

<?php

try {
    return Nette\Utils\Json::encode($value);
} catch (Nette\Utils\JsonException $exception) {
    // ...
}

…0, you made it! Congrats, now get back to pwning the world!

Did I miss a feature you plan to use from day 1 of your PHP 7.3? I might too, drop it in the comments!

Read More