Skip to main content

Posts

Showing posts from September, 2017

Laravel Package Auto Discovery Best Php Training Trivandrum

Laravel Package Auto Discovery This package supports Package Auto Discovery feature on Laravel older version (less than 5.5) Requirements Laravel >=5.1 PHP >= 5.5.9 Installation Open your terminal(CLI), go to the root directory of your Laravel project, then follow the following procedure. Run composer require appzcoder/laravel-package-discovery:dev-master Add service provider to  config/app.php . ' providers ' => [ ... Appzcoder\LaravelPackageDiscovery\ LaravelPackageDiscoveryServiceProvider :: class , ], Add the dump script to  composer.json . " scripts " : { ... " post-autoload-dump " : [ " Appzcoder \\ LaravelPackageDiscovery \\ ComposerScripts::postDump " ] }, Run  composer dump-autoload Usage Make sure your package's  composer.json  file as below "extra": { "laravel": { "providers": [ "Barryvdh\\Deb

New features for personal API Framework Best Php Training Trivandrum

New features for personal API Framework   Hello, I've benn building my own "framework", it's more to a personal bootstrap skeleton project than to a framework. I've been looking for new features for it. I didn't find any http request/response package yet (I'm looking for it too). What could I use to improve my project? Your public/index.php only includes the vendor autoload, how does anything execute? Your code overall makes too much use of  include  and it looks like you wrote your own controller autoloader rather than using PSR. Config files should be configuration data only, they should not include logic. Just my few cents.

Memory leak in 7.x json_decode()? Best Php Training Trivandrum

Memory leak in 7.x json_decode()? There appears to be a memory leak in 7.x json_decode(). I've uploaded a huge JSON file to demonstrate the problem. Here is the sample code: <?php echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL; $json = json_decode(file_get_contents('http://zaremedia.com/big.json')); echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL; unset($json); echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL; Below is output from 7.x and then 5.6: // Running on 7.0 and 7.1 349608 : 2097152 27245512 : 29360128 375552 : 29360128 The process starts with 0.3mb used / 2.0mb allocated. After json_decode(), it's 27.2 / 29.4mb, after unset, it's 3.7mb / 29.4mb -- The second value (memory allocated by php via emalloc()) has not been freed, though PHP's gc has correctly freed up the object usage. // Running on 5.6 221136 : 262144 31577064 : 35913728 420104 : 86507

Where are stored time zones? Best Php training Trivandrum

Where are stored time zones?   Are they stored internally in PHP? Like in php.exe? Or PHP gets time zone from the operating system? I'm asking this because my time zone is set to  date.timezone = Europe/Istanbul  and Turkey is going to switch back to +2 with summer time from +3 without summer time. So, the switch will be done within few weeks. And I think there won't be PHP update for 5.x nowadays. I know that I can set it to  date.timezone = Etc/GMT-2  but I'm interested in the internal structure. Edit: Interesting fact: Turkey was using +2 until last year when suddenly Erdoğan decided to switch time zones right before end of summer time, just like you might expect from a dictator. There was chaos (like in airports and many servers, work places, homes) because some operating systems didn't update time zone in time. And some operating systems didn't update time zone at all like old Android phones. So, now Erdoğan regrets his decision and switches back to +2

PHPBot – Can a PHP Bot Help You Look up Documentation Faster? best php Training Trivandrum

PHPBot – Can a PHP Bot Help You Look up Documentation Faster? I came across  PHPBot  the other day (not to be confused with  Botman  or  Fondbot ) – a “chatbot” which helps you look up PHP manual entries and generates example code for them. If you follow me on Twitter, you know I don’t believe in chatbots being chatbots – as someone who’s built some for both commercial purposes and personal ones, and as someone who was around in the age of IRC auto-responding scripts, I see chatbots as a little more than a marketing fad designed to impress today’s Snapchat generation. However, every now and then one will appear that’s actually useful. Could this be the one? Let’s take a look. Concept The idea is that you use the text input on the page to enter a PHP related term (like “ksort”) and the application will reply with an explanation and some example code, like so: Different queries will produce different responses. So, if you ask it for  echo : Usefulness While this

How to Master Your API Workflow with Postman Related Topics:

How to Master Your API Workflow with Postman Building good APIs is hard, and anyone who had the chance to do so can relate to this. A project can easily grow to become a mess. One can keep trying to adopt an approach to make it more enjoyable, like trying a documentation-first workflow, but something always feels clumsy.I was trying out Postman lately, a tool we’ve briefly covered before, and I discovered that they’re doing a great job by providing an integrated environment for different components of an API, like authorization, testing, documentation, versioning, etc. In this article, we’re going to walk through the different features that Postman provides and how we can organize them to make our API workflow less painful.Making RequestsThe first step to discovering Postman is making a simple API request and seeing the response. From the screenshot above we can see that the view incorporates different elements. The top bar contains the request method (in this case GET), and righ

Are Bitwise Operators Still Relevant in Modern PHP? Best php training Trivandrum

Are Bitwise Operators Still Relevant in Modern PHP? Example Use Case Bitwise operators are  listed here , but to really drive the example home, we’ll focus on just one: the  bitwise and  ( & ). An example made it click for me. So that’s what we’ll do – dive straight into an example. Imagine you have a website on which a given user can have specific permissions. For example, a magazine like SitePoint: a author can CRUD drafts, and and edit their profile. an editor can, in addition to the above, CRUD drafts and finished posts, and CRUD author profiles. an administrator can, in addition to the above, add administrator permissions. Since a user can have multiple permissions, there are several ways of defining permissions in a database and the system using it. The Double Join Add roles, add permissions, attach permissions to roles in a join table, then create another join table and bind some roles to some users. This approach creates four extra tables: permissi