Skip to main content

Posts

Showing posts with the label PHP

System Design | Design Scalable Systems

✋System design is the process of designing the elements of a system such as the architecture, modules, and components, the different interfaces of those components, and the data that goes through that system. The purpose of the System Design process is to provide sufficient detailed data and information about the system and its system elements to enable the implementation consistent with architectural entities as defined in models and views of the system architecture. 1) Requirements Clarification: the beginning point of software development activity. Software requirement is one such area to which little importance was attached in the early days of software development, as the emphasis was on coding and design. The main assumption was that the developers understood the problem clearly when it was explained to them, generally informally. Therefore, the need for a more rigorous requirement analysis phase arose. Now, for large systems 2) System Interface Definition: Int...

Design Patterns

A design pattern provides a general reusable solution for the common problems occurs in software design. Design Patterns are programming language independent strategies for solving a common problem. that means a design pattern represents an idea, your code more flexible, reusable and maintainable 🍥. Creational design patterns : creational design patterns are concerned with the ways of creating an object. 1. Factory Method: Define an interface or abstract class for creating an object but let the subclasses decide which class to instantiate 2. Abstract Factory: Define an interface or abstract class for creating families of related (or dependent) objects but without specifying their concrete sub-classes 3. Builder: Construct a complex object from simple objects using a step-by-step approach 4. Object Pool: Avoid expensive acquisition and release of resources by recycling objects that are no longer in use 5. Prototype: A fully initialized instance to...

Simple CodeIgniter Tutorial

This Simple tutorial will primarily focus on: Model-View-Controller basics Routing basics Form validation Performing basic database queries using “Query Builder” Adding logic to the controller : Create a file at application-package_folder/controllers/Pages.php with the following code. <?php class Pages extends CI_Controller { public function view($page = 'home') { } } You have created a class named Pages , with a view method that accepts one argument named $page . The Pages class is extending the CI_Controller class. This means that the new pages class can access the methods and variables defined in the CI_Controller class ( system/core/Controller.php ). The controller is what will become the center of every request to your web application. In very technical CodeIgniter discussions, it may be referred to as the super object . Like any php class, you refer to it within your controllers as $this . Referring to $this i...

CodeIgniter Overview

The first step is to install CodeIgniter, then read all the topics in the Introduction section of the Table of Contents. Next, read each of the General Topics pages in order. Each topic builds on the previous one, and includes code examples that you are encouraged to try. CodeIgniter Directory Structure: General Topics:     CodeIgniter URLs     Controllers     Reserved Names     Views     Models     Helpers     Using CodeIgniter Libraries     Creating Libraries     Using CodeIgniter Drivers     Creating Drivers     Creating Core System Classes     Creating Ancillary Classes     Hooks - Extending the Framework Core     Auto-loading Resources     Common Functions     Compatibility Functions     URI Routing ...

How to install CodeIgniter

How to install CodeIgniter Download CodeIgniter : Click here:  Configuring the base URL: Open the config.php file located in application/config/config.php directory Look for the line that says $config['base_url'] = ''; If the base_url is blank, CodeIgniter will try to guess the root URL but this is not guaranteed to always work so it’s better to explicitly set it. Enter our project URL as shown below $config['base_url'] = 'http://localhost/package_name/'; HERE, “'http://localhost/package_name/'” will be returned when you call the base URL helper function. We will talk more about the base URL later. Removing the index.php segment from the URLs Configuring the database connection parameters: This section assumes you have a working MySQL installation, password security has been enforced and you have a database already created in MySQL. Open the database.php file located in application/config/database.php directory Look f...

How to Simple Wiktionary data stored in MySQL

Wiktionary .php Wiktionary.php is a PHP "library" to convert Simple Wiktionary HTML page convert to text and find out the definition of the word. MySQL Database connection to store a definition of each word, select.php?word="" to fetch data from the database, display in Json format and database can't fetch data of word internal call to the simple Wiktionary website to fetch the data to be stored in MySQL database and display to JSON format. Supported Syntax == Heading == === Subheading === ==== Subsubheading ==== ''''' Bold-italic ''''' ''' Bold ''' '' Italic '' ---- Horizontal Line : Indentation :: Subindentation Unordered list (up to four levels "**** text") Ordered list (up to four levels "#### text") [[file: http://example.com/image.jpg  title]] an image ([[file|img:http|https| ftp://example.com/image.jpg  optional]]) [ http://example....