Skip to content

Instantly share code, notes, and snippets.

Muhammad Azaz Qadir azazqadir

  • Karachi, Pakistan
Block or report user

Report or block azazqadir

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@azazqadir
azazqadir / readme.md
Created Aug 27, 2019
Commands used in error logging in PHP
View readme.md

To enable error logging, open php.ini file and add this

error_reporting = E_ALL & ~E_NOTICE

error_reporting = E_ALL & ~E_NOTICE | E_STRICT

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ER… _ERROR

error_reporting = E_ALL & ~E_NOTICE
@azazqadir
azazqadir / readme.md
Last active Oct 29, 2018
Unit Testing in CodeIgniter Projects
View readme.md

An example of test case in n CodeIgniter.

class Testcase extends  CI_Controller

{

public function get_testcase(){

    $this ->load ->view('view_testcase');
@azazqadir
azazqadir / readme.md
Created Oct 27, 2018
Parsing Data in JSON in Codeigniter
View readme.md

You can use Codeigniter curl library to parse data in JSON format. For this you can use POST request.

Add this to your JSON file

$this->load->library('Curl');

$url = 'http://your-domin.com/';

$formatJsondata = array(
@azazqadir
azazqadir / readme.md
Created Oct 19, 2018
Creating Migration Table in Laravel for ToDo App
View readme.md

To create a simple ToDo application in Laravel, you first need to setup database. For that, start with configuring the .env file. Now to create table in Laravel, you need to create migration table. For that, use the following command

php artisan make:migration create_todo_table

Now execute migration with following command:

php artisan migrate
@azazqadir
azazqadir / readme.md
Created Oct 4, 2018
Building Ecommerce in Symfony
View readme.md

Symfony is great framework with some useful components. You can easily create Symfony ecommerce website using bundles. You can even create a rich UI by integrating React on front end. Learn more on how you can create a Symfony ecommerce website and integrate React and Cloudinary with it.

@azazqadir
azazqadir / readme.md
Created Sep 29, 2018
PHP Performance Optimization Tips
View readme.md
  • Consider using the swoole extension. Some applications can run 30 times faster. Be sure you understand how it works.

  • Use cache wherever possible in order to reduce the amount of DB queries. Optimize the DB queries too, these are often the performance bottleneck of any web application regardless of the stacks / frameworks that are used.

  • varnish for full page caching & redis for session caching but it’s the best choice IMO.

Read Tons of More Tips on PHP Performance Optimization.

@azazqadir
azazqadir / config.php
Created Sep 27, 2018
PHP Contact Form Script
View config.php
<?php
$host = "localhost";
$userName = "fyrhp";
$password = "RTDE";
$dbName = "fyrhp";
// Create database connection
$conn = new mysqli($host, $userName, $password, $dbName);
// Check connection
@azazqadir
azazqadir / readme.md
Last active Sep 26, 2018
Best PHP Frameworks of 2018
View readme.md
  • Laravel

  • Symfony

  • Codeigniter

  • Yii

  • Zend

View index.php
<?php
ini_set('session.save_handler', 'redis');
ini_set('session.save_path', "tcp://localhost:6379");
//echo ini_get('session.save_path');
session_start();
View laravel.php
Route::group(['prefix' => 'api/v1'], function () {
Route::get('/getTasks', function () {
return Task::all();
});
Route::post('/addTask', function (Request $request) {
You can’t perform that action at this time.