Showing posts with label Installation and Configuration Yii Framework. Show all posts
Showing posts with label Installation and Configuration Yii Framework. Show all posts

Sunday, August 19, 2012

Yii PHP Framework v1.1.12 Download and Upgrading Instructions

Yii PHP framework has been released for v1.1.12 Stable on Aug 19, 2012 and available to download. You can download Yii Framework v1.1.12 on http://www.yiiframework.com/download/

This release mainly fixes the BC-breaking issues we have found in the prior release. It includes about 20 bug fixes, minor features and enhancements. For the complete list of changes in this release, please see:

Yii PHP Framework version 1.1.12 August 19, 2012
  • Bug #190: WSDL return tag was not generated by CWsdlGenerator when Macintosh line endings were used inside service describing docblock (resurtm)
  • Bug #1066: CMemCache: expiration time higher than 60*60*24*30 (31536000) seconds led the value to expire right away after saving (resurtm)
  • Bug #1072: Fixed the problem with getTableAlias() in defaultScope() (creocoder)
  • Bug #1076: CJavaScript::encode() was not compatible with PHP 5.1 (samdark)
  • Bug #1077: Fixed the problem with alias in CSort (creocoder)
  • Bug #1083: CFileValidator is now unsafe by default. This will prevent setting attribute when no file was uploaded (samdark)
  • Bug #1087: Reverted changes to CCookieCollection::add() introduced in 1.1.11 as they were triggering E_STRICT on some old PHP-versions (suralc)
  • Bug #1088: Fixed usage of proper CActiveForm id property when it's supplied with htmlOptions (mdomba)
  • Bug #1094: CGridView with enabled history used to clear page title in case sorting or paging performed (Opera and Firefox only) (resurtm)
  • Bug #1109: Fixed "js:" encoding BC-break in CHtml::ajax() and related methods introduced in 1.1.11 (samdark)
  • Bug #1120: Fixed duplicate events processing in CGridView when ENTER was pressed for filtering (mdomba)
  • Bug #1192: CHttpCacheFilter failed to comply with RFC 2616, section 10.3.5 (DaSourcerer)
  • Bug #1207: Fixed an issue in CHtml::resolveValue() which occurs when handling tabular data input (Qiang)
  • Bug #1225: Fixed the bug that $.fn.yiiGridView.getChecked was not working always if a custom CGridView::template was used (mdomba)
  • Bug #1243: Fixed the bug that when using CUrlManager::addRules with $append=false rules were added in reverse order (samdark)
  • Enh #243: CWebService is now able to deal with the customized WSDL generator classes, was hardcoded to the CWsdlGenerator before, added CWebService::$generatorConfig property (resurtm)
  • Enh #636: CManyManyRelation now parses foreign key for the junction table data internally, and provide public interface to access it (klimov-paul)
  • Enh #1163: CGridview does not create empty class attributes anymore (cebe)
  • Chg #1099: Changed connectionId dropdown to sticky text field in Gii model generator (mdomba)
  • Chg #1167: Reverted back the change to CComponent::evaluateExpression() about global function support (Qiang)
Upgrading Instructions for Yii Framework v1.1.12

The following upgrading instructions are cumulative. That is, if you want to upgrade from version A to version C and there is version B between A and C, you need to following the instructions for both A and B.

General upgrade instructions
  • Make a backup.
  • Clean up your 'assets' folder.
  • Replace 'framework' dir with the new one or point GIT to a fresh release and update.
  • Check if everything is OK, if not รข€” revert from backup and post issues to Yii issue tracker.
Yii Framework Tutorials

Saturday, December 10, 2011

Configuration Gii Tool (Yii Code Generator)

Gii (automatic code generation) is a Web-based code generator tool of Yii to develop a web application development productivity. Gii is implemented as a module and should be used in the Yii application. To use Gii, you have to do some Gii configuration first. The following configuration steps Gii (producer of automatic code - Code Generator):

  1. Have you open the protected / main.config.php
  2. Find the following code
    // uncomment the following to enable the Gii tool
     /*
     'gii'=>array(
      'class'=>'system.gii.GiiModule',
      'password'=>'admin',
       // If removed, Gii defaults to localhost only. Edit carefully to taste.
      'ipFilters'=>array('127.0.0.1','::1'),
     ),
     */
    ),
  3. Remove the tag comment / * and * /, so like this
    // enable Gii tool
     'gii'=>array(
      'class'=>'system.gii.GiiModule',
      'password'=>'Enter Your Password Here',
       // If removed, Gii defaults to localhost only. Edit carefully to taste.
      'ipFilters'=>array('127.0.0.1','::1'),
     ),
    ),
  4. Change Your password in Enter Your Password Here, for example 123456
    // enable Gii tool
     'gii'=>array(
      'class'=>'system.gii.GiiModule',
      'password'=>'123456',
       // If removed, Gii defaults to localhost only. Edit carefully to taste.
      'ipFilters'=>array('127.0.0.1','::1'),
     ),
    ),
  5. Now you have to login to Gii tool by open a web browser and type the http://localhost/yiicode/index.php?r=gii/default/login Changes yiicode with your application name.
    Before login Gii (Yii Code Generator)
    After login Gii (Yii Code Generator)
Nb: Gii is mainly provided as a development tool. Therefore, it should only be installed on a development machine. Because it can generate new PHP script files in the application, we should pay sufficient attention to its security measures (e.g. password, IP filters).

Tuesday, November 8, 2011

Configuration Yii Framework to MySQL Database

By default Yii Framework to connect to SQLite database. It can take a look at webappname \ protected \ config \ main.php. Consider the following code:
*/
'db'=>array(
 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database
/*
'db'=>array(
 'connectionString' => 'mysql:host=localhost;dbname=testdrive',
 'emulatePrepare' => true,
 'username' => 'root',
 'password' => '',
 'charset' => 'utf8',
),
*/

In the code above shows the application to connect to SQLite database where there are no tag "comment" while in MySQL there is a tag "comment" which means the code will not be processed. We need to do is

  1. Adding a tag comment / * and * / on SQLite SQLite database that is not executed. Consider the following code:
    /*
    'db'=>array(
     'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
    ),
    */
  2. Remove the tag comment / * and * / to MySQL database and rename testdrive.db (default) with the name of your database. example yiicode_db
    // Using MySQL database
    'db'=>array(
     'connectionString' => 'mysql:host=localhost;dbname=yiicode_db',
     'emulatePrepare' => true,
     'username' => 'root',
     'password' => '',
     'charset' => 'utf8',
    ),
So the whole database connection code would look something like the following:
/*
'db'=>array(
 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
*/
// Using MySQL database
'db'=>array(
 'connectionString' => 'mysql:host=localhost;dbname=yiicode_db',
 'emulatePrepare' => true,
 'username' => 'root',
 'password' => '',
 'charset' => 'utf8',
),

Tuesday, November 1, 2011

Installing Yii Framework in XAMPP

Here I will discuss the details of the installation steps Yii Framework. But before, there are some you need to prepare to install Yii:
  • Yii Framework - Download at http://www.yiiframework.com/download/
  • Web and database Server, here I am using XAMPP - Download at http://www.apachefriends.org/en/xampp.html
  • Web Browser, here I use Mozilla Firefox - Download at http://www.mozilla.org/id/firefox/new/
After you download all, let's start installing yii. Here, I use windows 7 as the operating system.

1. Install XAMPP, here I did not explain how to install it, but just to be safe when the computer error and have to reinstall, it should be installed on a drive other than C, such as drive D, E, or others. Here I installed on drive D

2. Extract yii-x.x.x.xxxxx.tar.gz that you download, then change its name to yii, and to be more easily placed in the folder XAMPP/htdocs, so that such XAMPP/htdocs/yii.

3. Open the comand line by pressing ctrl + r and type cmd

Installing Yii Framework in Xampp
Yii Web Application
Microsoft Windows [Version 6.1.7600]
Copyright 2009 Microsoft Corporation. All rights reserved
C: \ Users \ santje>

4. Typed in the comand-line d:

Microsoft Windows [Version 6.1.7600]
Copyright 2009 Microsoft Corporation. All rights reserved
C: \ Users \ santje> d:
D: \>

5. Typing again cd xampp

Microsoft Windows [Version 6.1.7600]
Copyright 2009 Microsoft Corporation. All rights reserved
C: \ Users \ santje> d:
D: \> cd xampp
D: \ xampp>

6. After that typing cd php

Microsoft Windows [Version 6.1.7600]
Copyright 2009 Microsoft Corporation. All rights reserved
C: \ Users \ santje> d:
D: \> cd xampp
D: \ xampp> cd php
D: \ xampp \ php>

7. Typing again php.exe D:\xampp\htdocs\yii\framework\yiic webapp D:\xampp\htdocs\yiicode
Description: D: \ xampp \ htdocs \ yiicode means the application will be installed on xampp - htdocs, while yiicode is the name of my application to be made

Microsoft Windows [Version 6.1.7600]
Copyright 2009 Microsoft Corporation. All rights reserved
C: \ Users \ santje> d:
D: \> cd xampp
D: \ xampp> cd php
D: \ xampp \ php>
D: \ xampp \ php> php.exe D:\xampp\yii\ framework\yiic\webapp D:\xampp\htdocs\yiicode
Create a Web application under 'D: \ xampp \ htdocs \ yiicode'? [yes: no]

8. The last typed yes and enter.
Your application has been succesfully created under D: \ xampp \ htdocs \ yiicode

9. Open xampp-control.exe click the start button on the Apache and MySQL, and then open your web browser and type localhost/yiicode. Congratulations you have successfully created your first application yii