Ivan's Blog

Lets learn new things!

Prepare RESTful Web Services using Laravel: The PHP Framework

I prepare this document to remember these steps. Hope it will help others too. Step 1: Install laravel Laravel documentation is very resource full. To install laravel please follow the bellow link: https://laravel.com/docs/5.4 1st have to fulfill all prerequisite! Without these, laravel will not run properly. Step 2: Make Database schema using migration. Now 1st design your application database schema. … Read More

Wowza outgoing security Secure Token and PHP, Android client

Configure outgoing security using Wowza Streaming Engine Manager There is a very good documentation in Wowza forum to enable security token for Wowza steaming server. Here is link to follow: http://www.wowza.com/forums/content.php?578-How-to-configure-security-using-Wowza-Streaming-Engine-Manager Now the outgoing stream is secured. If any one knows the secret token, then only generate the authenticate URL for steaming. Here are some code example to do this. … Read More

How to install PHP composer : OS Windows 7

Composer install into windows 7: Download Composer software from this link: https://getcomposer.org/Composer-Setup.exe Have to modify PATH environment value, such as adding “C:\wamp\bin\php\php5.5.12” at the end of PATH. Do not need to restart computer, just reopen command line again Run these commands: Change to a directory on your PATH and run the install snippet to download composer.phar: php -r “readfile(‘https://getcomposer.org/installer’);” | … Read More

Install LAMP and phpMyAdmin in Ubuntu 12.04

sudo apt-get update sudo apt-get install apache2 sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt apt-cache search php5- sudo apt-get install name of the module sudo service apache2 restart sudo apt-get install phpmyadmin cd /etc/apache2/ sudo gedit apache2.conf Add this line at the end of this file: Include /etc/phpmyadmin/apache.conf sudo service apache2 restart Links: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-12-04 … Read More

Yii 1.1: Some basic of theme

In a theme there is some basic folder structure: Here in blackboot theme, some basic folder, css, js, img, view->layouts In view->layouts, php files are design to get dynamic content from framework side and show them in particular sections(divs). Here, in $content variable, actual contents replaced for particular views. For other views like view->layouts->column1.php view->layouts->column2.php there used some other framework … Read More

Yii 1.1: Relations some example and links

In Model there is a function called relations. The array items are like that: [code language=”php”] ‘VarName’=&gt;array(‘RelationType’, ‘ClassName’, ‘ForeignKey’, …additional options) [/code] RelationType can be: BELONGS_TO HAS_MANY HAS_ONE MANY_MANY Example: [code language=”php”] <pre>array(         ‘posts’=&gt;array(self::HAS_MANY, ‘Post’, ‘author_id’),         ‘profile’=&gt;array(self::HAS_ONE, ‘Profile’, ‘owner_id’),      ); $post=Post::model()-&gt;findByPk(10); $author=$post-&gt;author; $posts=Post::model()-&gt;with(‘author’,’categories’)-&gt;findAll(); $posts=Post::model()-&gt;with(‘author.profile’,’author.posts’,’categories’)-&gt;findAll(); $posts=Post::model()-&gt;findAll(array(     ‘with’=&gt;array(         ‘author.profile’,         ‘author.posts’,         ‘categories’,     ) )); $users=User::model()-&gt;with(array( … Read More

Yii 1.1: Easy way to create a Module in Yii

Creating a module in Yii framework is very easy. Any one can see bellow link: http://www.yiiframework.com/doc/guide/1.1/en/basics.module Here I will describe how any one can create a module very easily in Yii. Yii have a code generator that is called gii. 1. If we have several database table, then 1st we need to generate model and CRUD from GII.     … Read More

Yii 1.1 : Use findAllBySql and NOT EXISTS query

Here i am showing use case of NOT EXISTS query and how to run raw query in yii. If any one want to display only those user name which are not in user role table, then have to run SQL query that with NOT EXISTS. In UserRole model write a function named: getUserNamesNotExists <?php public function getUserNamesNotExists() {     Yii::import(‘application.modules.user.*’); … Read More

Yii 1.1 : DropDown, Pagination, GridView, DetailsView

The most amazing this I noticed in Yii 1.1 framework is there build in module gii. By this module, anyone can generate a CRUD (Create, read, update and delete). Although it create most of the components like model, view, and controller but also we need to do some modification for better user experiences. Here I will discuss about those things: … Read More

Megento: for ecommerce website

I recently prepared my 1st ecommerce website demo in megento. This PHP framework looks very easy to install. Megento and Zend are working together [link]. Zend is another PHP framework. One of the nice features is sample data provide bye megento community. Download: http://www.magentocommerce.com/download Magento Installation Guide Installing_on_windows_with_xampp_and_wamp Installing-the-sample-data-for-magento Initial frontend [build in theme] and backend [admin panel] looks very … Read More