Showing posts with label Yii Framework. Show all posts
Showing posts with label Yii Framework. Show all posts

Yii Frame Work !Configuring for cache

Thursday, January 5, 2012

Configuring for cache
As was mentioned, using cache in Yii typically involves choosing one of these
implementations, and then configuring the application component for use in the /
protected/config/main.php  file. The specifics of the configuration will, of course,
depend on the specific cache implementation. For example, if one were to use the
memcached implementation, that is, CMemCache, which is a distributed memory
object caching system that allows you to specify multiple host servers as your cache
servers, configuring it to use two servers might look similar to:
...........................................
array(
    ......
    'components'=>array(
        ......
        'cache'=>array(
            'class'=>'system.caching.CMemCache',
            'servers'=>array(
                array('host'=>'server1', 'port'=>12345, 
'weight'=>60),
                array('host'=>'server2', 'port'=>12345, 
'weight'=>40),
            ),
        ),
    ),
);
........................................................
To keep things relatively simple for the reader following along with the TrackStar
development, we'll use the filesystem implementation, CFileCache, as we go
through some examples. This should be readily available on any development
environment that allows access to reading and writing files from the filesystem

Yii Frame Work !Configuring for cache

Configuring for cache
As was mentioned, using cache in Yii typically involves choosing one of these
implementations, and then configuring the application component for use in the /
protected/config/main.php  file. The specifics of the configuration will, of course,
depend on the specific cache implementation. For example, if one were to use the
memcached implementation, that is, CMemCache, which is a distributed memory
object caching system that allows you to specify multiple host servers as your cache
servers, configuring it to use two servers might look similar to:
...........................................
array(
    ......
    'components'=>array(
        ......
        'cache'=>array(
            'class'=>'system.caching.CMemCache',
            'servers'=>array(
                array('host'=>'server1', 'port'=>12345, 
'weight'=>60),
                array('host'=>'server2', 'port'=>12345, 
'weight'=>40),
            ),
        ),
    ),
);
........................................................
To keep things relatively simple for the reader following along with the TrackStar
development, we'll use the filesystem implementation, CFileCache, as we go
through some examples. This should be readily available on any development
environment that allows access to reading and writing files from the filesystem

Yii Frame Work !Configuring for cache

Configuring for cache
As was mentioned, using cache in Yii typically involves choosing one of these
implementations, and then configuring the application component for use in the /
protected/config/main.php  file. The specifics of the configuration will, of course,
depend on the specific cache implementation. For example, if one were to use the
memcached implementation, that is, CMemCache, which is a distributed memory
object caching system that allows you to specify multiple host servers as your cache
servers, configuring it to use two servers might look similar to:
...........................................
array(
    ......
    'components'=>array(
        ......
        'cache'=>array(
            'class'=>'system.caching.CMemCache',
            'servers'=>array(
                array('host'=>'server1', 'port'=>12345, 
'weight'=>60),
                array('host'=>'server2', 'port'=>12345, 
'weight'=>40),
            ),
        ),
    ),
);
........................................................
To keep things relatively simple for the reader following along with the TrackStar
development, we'll use the filesystem implementation, CFileCache, as we go
through some examples. This should be readily available on any development
environment that allows access to reading and writing files from the filesystem

Agile Web Application Development with Yii1.1 and PHP5

Agile Web Application Development with Yii1.1 and PHP5
About Packt Publishing

Packt, pronounced 'packed', published its first book "Mastering phpMyAdmin for Effective
MySQL Management" in April 2004 and subsequently continued to specialize in publishing
highly focused books on specific technologies and solutions.
Our books and publications share the experiences of your fellow IT professionals in adapting
and customizing today's systems, applications, and frameworks. Our solution based books
give you the knowledge and power to customize the software and technologies you're using
to get the job done. Packt books are more specific and less general than the IT books you have
seen in the past. Our unique business model allows us to bring you more focused information,
giving you more of what you need to know, and less of what you don't.
Packt is a modern, yet unique publishing company, which focuses on producing quality,
cutting-edge books for communities of developers, administrators, and newbies alike. For
more information, please visit our website: www.packtpub.com.
About Packt Open Source
In 2010, Packt launched two new brands, Packt Open Source and Packt Enterprise, in order to
continue its focus on specialization. This book is part of the Packt Open Source brand, home
to books published on software built around Open Source licences, and offering information
to anybody from advanced developers to budding web designers. The Open Source brand
also runs Packt's Open Source Royalty Scheme, by which Packt gives a royalty to each Open
Source project about whose software a book is sold.
Writing for Packt
We welcome all inquiries from people who are interested in authoring. Book proposals
should be sent to author@packtpub.com. If your book idea is still at an early stage and you
would like to discuss it first before writing a formal book proposal, contact us; one of our
commissioning editors will get in touch with you.
We're not just looking for published authors; if you have strong technical skills but no writing
experience, our experienced editors can help you develop a writing career, or simply get some
additional reward for your expertise.

Agile Web Application Development with Yii1.1 and PHP5

Agile Web Application Development with Yii1.1 and PHP5
About Packt Publishing

Packt, pronounced 'packed', published its first book "Mastering phpMyAdmin for Effective
MySQL Management" in April 2004 and subsequently continued to specialize in publishing
highly focused books on specific technologies and solutions.
Our books and publications share the experiences of your fellow IT professionals in adapting
and customizing today's systems, applications, and frameworks. Our solution based books
give you the knowledge and power to customize the software and technologies you're using
to get the job done. Packt books are more specific and less general than the IT books you have
seen in the past. Our unique business model allows us to bring you more focused information,
giving you more of what you need to know, and less of what you don't.
Packt is a modern, yet unique publishing company, which focuses on producing quality,
cutting-edge books for communities of developers, administrators, and newbies alike. For
more information, please visit our website: www.packtpub.com.
About Packt Open Source
In 2010, Packt launched two new brands, Packt Open Source and Packt Enterprise, in order to
continue its focus on specialization. This book is part of the Packt Open Source brand, home
to books published on software built around Open Source licences, and offering information
to anybody from advanced developers to budding web designers. The Open Source brand
also runs Packt's Open Source Royalty Scheme, by which Packt gives a royalty to each Open
Source project about whose software a book is sold.
Writing for Packt
We welcome all inquiries from people who are interested in authoring. Book proposals
should be sent to author@packtpub.com. If your book idea is still at an early stage and you
would like to discuss it first before writing a formal book proposal, contact us; one of our
commissioning editors will get in touch with you.
We're not just looking for published authors; if you have strong technical skills but no writing
experience, our experienced editors can help you develop a writing career, or simply get some
additional reward for your expertise.

Agile Web Application Development with Yii1.1 and PHP5

Agile Web Application Development with Yii1.1 and PHP5
About Packt Publishing

Packt, pronounced 'packed', published its first book "Mastering phpMyAdmin for Effective
MySQL Management" in April 2004 and subsequently continued to specialize in publishing
highly focused books on specific technologies and solutions.
Our books and publications share the experiences of your fellow IT professionals in adapting
and customizing today's systems, applications, and frameworks. Our solution based books
give you the knowledge and power to customize the software and technologies you're using
to get the job done. Packt books are more specific and less general than the IT books you have
seen in the past. Our unique business model allows us to bring you more focused information,
giving you more of what you need to know, and less of what you don't.
Packt is a modern, yet unique publishing company, which focuses on producing quality,
cutting-edge books for communities of developers, administrators, and newbies alike. For
more information, please visit our website: www.packtpub.com.
About Packt Open Source
In 2010, Packt launched two new brands, Packt Open Source and Packt Enterprise, in order to
continue its focus on specialization. This book is part of the Packt Open Source brand, home
to books published on software built around Open Source licences, and offering information
to anybody from advanced developers to budding web designers. The Open Source brand
also runs Packt's Open Source Royalty Scheme, by which Packt gives a royalty to each Open
Source project about whose software a book is sold.
Writing for Packt
We welcome all inquiries from people who are interested in authoring. Book proposals
should be sent to author@packtpub.com. If your book idea is still at an early stage and you
would like to discuss it first before writing a formal book proposal, contact us; one of our
commissioning editors will get in touch with you.
We're not just looking for published authors; if you have strong technical skills but no writing
experience, our experienced editors can help you develop a writing career, or simply get some
additional reward for your expertise.

Yii Reference Book ! PrestaShop 1.3 Beginner's Guide ISBN: 978-1-849511-14-8

PrestaShop 1.3 Beginner's Guide
ISBN: 978-1-849511-14-8            Paperback: 308 pages
Build and customize your online store with this
speedy, lightweight e-commerce solution
1.  Covers every topic required to start and run
a real, trading e-commerce business with
PrestaShop
2.  Deploy PrestaShop quickly and easily, and
make your PrestaShop search-engine friendly
3.  Learn how to turn a single new PrestaShop into
a thriving e-commerce empire
4.  Step-by-step fully illustrated explanation and
discussions aimed at helping beginners like you
towards the realization of your own PrestaShop
store and beyond

Yii Reference Book ! PrestaShop 1.3 Beginner's Guide ISBN: 978-1-849511-14-8

PrestaShop 1.3 Beginner's Guide
ISBN: 978-1-849511-14-8            Paperback: 308 pages
Build and customize your online store with this
speedy, lightweight e-commerce solution
1.  Covers every topic required to start and run
a real, trading e-commerce business with
PrestaShop
2.  Deploy PrestaShop quickly and easily, and
make your PrestaShop search-engine friendly
3.  Learn how to turn a single new PrestaShop into
a thriving e-commerce empire
4.  Step-by-step fully illustrated explanation and
discussions aimed at helping beginners like you
towards the realization of your own PrestaShop
store and beyond

Yii Reference Book ! PrestaShop 1.3 Beginner's Guide ISBN: 978-1-849511-14-8

PrestaShop 1.3 Beginner's Guide
ISBN: 978-1-849511-14-8            Paperback: 308 pages
Build and customize your online store with this
speedy, lightweight e-commerce solution
1.  Covers every topic required to start and run
a real, trading e-commerce business with
PrestaShop
2.  Deploy PrestaShop quickly and easily, and
make your PrestaShop search-engine friendly
3.  Learn how to turn a single new PrestaShop into
a thriving e-commerce empire
4.  Step-by-step fully illustrated explanation and
discussions aimed at helping beginners like you
towards the realization of your own PrestaShop
store and beyond

Creating the controller Yii FrameWork

To create a new application, we are going to use a little powerhouse of a tool known
as yiic that comes packaged with the framework. This is a command-line tool that
one can use to quickly jumpstart a brand new Yii application. It is not mandatory to
use this tool, but it saves a lot of time and guarantees that the proper folder and file
structure is in place

To use this tool to create your first Yii application, open up a shell window,
and navigate to a place in your filesystem where you will want to create your
application's folder structure. For the purpose of this demo application, we will
assume the following:

.................................................................................................
•     YiiRoot is the folder where you have installed Yii
•     WebRoot is configured as the document root of your web server
•     From your command line, change to your WebRoot folder and execute
the following:
% cd WebRoot
% YiiRoot/framework/yiic webapp demo
Create a Web application under '/Webroot/demo'? [Yes|No]
Yes
   mkdir /WebRoot/demo
   mkdir /WebRoot/demo/assets
   mkdir /WebRoot/demo/css
   generate css/bg.gif
   generate css/form.css
   generate css/main.css

............................................................
Your application has been created successfully under /Webroot/demo. The webapp
command is used to create a brand new Yii web application. It takes just a single
argument to specify either the absolute or relative path to the folder in which the
application should be created. The result is the generation of all the needed folders
and files to provide a default Yii web application skeleton.
Now we can change into the newly created demo folder and look at what was created
for us:

.................................................................
% cd demo
% ls –p
assets/    images/    index.php  themes/
css/    index-test.php  protected/
A description of the high-level items that were automatically created is shown 
as follows:
demo/   
index.php    Web application entry script file   
index-test.php  entry script file for the functional tests   
assets/    containing published resource files 

css/      containing CSS files   
images/    containing image files   
themes/    containing application themes   
protected/    containing protected application files 

........................................................
With the execution of one simple command from the command line, we have created
all the folder structure and files needed to immediately take advantage of Yii's sensible
default configuration. All of these folders and the files, along with the subfolders
and files they contain, can look a little daunting at first glance. However, we can
ignore most of them as we are getting started. All these folders and files are actually
a working web application. The yiic command has populated the application with
enough code to establish a simple home page, a typical Contact Us page to provide
an example of a web form, and a login page with enough autogenerated code to
demonstrate basic authorization and authentication in Yii. If your web server supports
the GD2 graphics library extension, you will also see a CAPTCHA widget on the
Contact Us form, and the application will have the corresponding validation for this
form item.
As long as your web server is running, you should be able to open up your browser
and navigate to http://localhost/demo/index.php. Here you will be presented
with a My Web Application home page along with the friendly greeting Welcome
to My Web Application, followed by some helpful information on the steps to be
taken next. The next screenshot shows this example home page

Creating the controller Yii FrameWork

To create a new application, we are going to use a little powerhouse of a tool known
as yiic that comes packaged with the framework. This is a command-line tool that
one can use to quickly jumpstart a brand new Yii application. It is not mandatory to
use this tool, but it saves a lot of time and guarantees that the proper folder and file
structure is in place

To use this tool to create your first Yii application, open up a shell window,
and navigate to a place in your filesystem where you will want to create your
application's folder structure. For the purpose of this demo application, we will
assume the following:

.................................................................................................
•     YiiRoot is the folder where you have installed Yii
•     WebRoot is configured as the document root of your web server
•     From your command line, change to your WebRoot folder and execute
the following:
% cd WebRoot
% YiiRoot/framework/yiic webapp demo
Create a Web application under '/Webroot/demo'? [Yes|No]
Yes
   mkdir /WebRoot/demo
   mkdir /WebRoot/demo/assets
   mkdir /WebRoot/demo/css
   generate css/bg.gif
   generate css/form.css
   generate css/main.css

............................................................
Your application has been created successfully under /Webroot/demo. The webapp
command is used to create a brand new Yii web application. It takes just a single
argument to specify either the absolute or relative path to the folder in which the
application should be created. The result is the generation of all the needed folders
and files to provide a default Yii web application skeleton.
Now we can change into the newly created demo folder and look at what was created
for us:

.................................................................
% cd demo
% ls –p
assets/    images/    index.php  themes/
css/    index-test.php  protected/
A description of the high-level items that were automatically created is shown 
as follows:
demo/   
index.php    Web application entry script file   
index-test.php  entry script file for the functional tests   
assets/    containing published resource files 

css/      containing CSS files   
images/    containing image files   
themes/    containing application themes   
protected/    containing protected application files 

........................................................
With the execution of one simple command from the command line, we have created
all the folder structure and files needed to immediately take advantage of Yii's sensible
default configuration. All of these folders and the files, along with the subfolders
and files they contain, can look a little daunting at first glance. However, we can
ignore most of them as we are getting started. All these folders and files are actually
a working web application. The yiic command has populated the application with
enough code to establish a simple home page, a typical Contact Us page to provide
an example of a web form, and a login page with enough autogenerated code to
demonstrate basic authorization and authentication in Yii. If your web server supports
the GD2 graphics library extension, you will also see a CAPTCHA widget on the
Contact Us form, and the application will have the corresponding validation for this
form item.
As long as your web server is running, you should be able to open up your browser
and navigate to http://localhost/demo/index.php. Here you will be presented
with a My Web Application home page along with the friendly greeting Welcome
to My Web Application, followed by some helpful information on the steps to be
taken next. The next screenshot shows this example home page

Creating the controller Yii FrameWork

To create a new application, we are going to use a little powerhouse of a tool known
as yiic that comes packaged with the framework. This is a command-line tool that
one can use to quickly jumpstart a brand new Yii application. It is not mandatory to
use this tool, but it saves a lot of time and guarantees that the proper folder and file
structure is in place

To use this tool to create your first Yii application, open up a shell window,
and navigate to a place in your filesystem where you will want to create your
application's folder structure. For the purpose of this demo application, we will
assume the following:

.................................................................................................
•     YiiRoot is the folder where you have installed Yii
•     WebRoot is configured as the document root of your web server
•     From your command line, change to your WebRoot folder and execute
the following:
% cd WebRoot
% YiiRoot/framework/yiic webapp demo
Create a Web application under '/Webroot/demo'? [Yes|No]
Yes
   mkdir /WebRoot/demo
   mkdir /WebRoot/demo/assets
   mkdir /WebRoot/demo/css
   generate css/bg.gif
   generate css/form.css
   generate css/main.css

............................................................
Your application has been created successfully under /Webroot/demo. The webapp
command is used to create a brand new Yii web application. It takes just a single
argument to specify either the absolute or relative path to the folder in which the
application should be created. The result is the generation of all the needed folders
and files to provide a default Yii web application skeleton.
Now we can change into the newly created demo folder and look at what was created
for us:

.................................................................
% cd demo
% ls –p
assets/    images/    index.php  themes/
css/    index-test.php  protected/
A description of the high-level items that were automatically created is shown 
as follows:
demo/   
index.php    Web application entry script file   
index-test.php  entry script file for the functional tests   
assets/    containing published resource files 

css/      containing CSS files   
images/    containing image files   
themes/    containing application themes   
protected/    containing protected application files 

........................................................
With the execution of one simple command from the command line, we have created
all the folder structure and files needed to immediately take advantage of Yii's sensible
default configuration. All of these folders and the files, along with the subfolders
and files they contain, can look a little daunting at first glance. However, we can
ignore most of them as we are getting started. All these folders and files are actually
a working web application. The yiic command has populated the application with
enough code to establish a simple home page, a typical Contact Us page to provide
an example of a web form, and a login page with enough autogenerated code to
demonstrate basic authorization and authentication in Yii. If your web server supports
the GD2 graphics library extension, you will also see a CAPTCHA widget on the
Contact Us form, and the application will have the corresponding validation for this
form item.
As long as your web server is running, you should be able to open up your browser
and navigate to http://localhost/demo/index.php. Here you will be presented
with a My Web Application home page along with the friendly greeting Welcome
to My Web Application, followed by some helpful information on the steps to be
taken next. The next screenshot shows this example home page

Object-relational mapping and Active Record Yii Framework

For the most part, the web applications we build house their data in a relational
database. The blog posting application we used in the previous example holds blog
post content in database tables. However, web applications need the data that is
held in the persistent database storage mapped to in-memory class properties that
define the domain objects. Object-relational mapping (ORM) libraries provide this
mapping of database tables to domain object classes.
Much of the code that deals with ORM is about describing how fields in the database
correspond to fields in our objects, which is tedious and repetitive to write. Luckily,
Yii comes to our rescue to save us from this repetition and tedium by providing the
ORM layer in the form of the AR pattern.

Active Record
As was previously mentioned, AR is a design pattern used to abstract database
access in an object-oriented fashion. It maps tables to classes, rows to objects and
columns to object attributes. In other words, each instance of an active record class
represents a single row in a database table. However an AR class is more than just
a set of attributes that map to columns in a database table; it also houses the needed
business logic behavior to be applied to that data. The end result is a class that
defines everything about how it should be written to and read from the database.
By relying on convention and sticking with reasonable defaults, Yii's implementation
of AR will save the developer a ton of time normally spent in configuration or in
writing tedious and repetitive SQL statements required to create, read, update and
delete data. It also allows the developer to access data stored in the database in a
much more object-oriented way. To illustrate this, here is some example code that
uses AR to operate on a specific blog posting whose internal id, which is also used
as the table's Primary Key, is 99. It first retrieves the posting by Primary Key, it then
changes the title, and then updates the database to save the changes:

....................................................................................
$post=Post::model()->findByPk(99);
$post->title='Some new title';
$post->save();

...................................................................................
Active Record completely relieves us of the tedium of having to write any SQL
or otherwise deal with the underlying database

Object-relational mapping and Active Record Yii Framework

For the most part, the web applications we build house their data in a relational
database. The blog posting application we used in the previous example holds blog
post content in database tables. However, web applications need the data that is
held in the persistent database storage mapped to in-memory class properties that
define the domain objects. Object-relational mapping (ORM) libraries provide this
mapping of database tables to domain object classes.
Much of the code that deals with ORM is about describing how fields in the database
correspond to fields in our objects, which is tedious and repetitive to write. Luckily,
Yii comes to our rescue to save us from this repetition and tedium by providing the
ORM layer in the form of the AR pattern.

Active Record
As was previously mentioned, AR is a design pattern used to abstract database
access in an object-oriented fashion. It maps tables to classes, rows to objects and
columns to object attributes. In other words, each instance of an active record class
represents a single row in a database table. However an AR class is more than just
a set of attributes that map to columns in a database table; it also houses the needed
business logic behavior to be applied to that data. The end result is a class that
defines everything about how it should be written to and read from the database.
By relying on convention and sticking with reasonable defaults, Yii's implementation
of AR will save the developer a ton of time normally spent in configuration or in
writing tedious and repetitive SQL statements required to create, read, update and
delete data. It also allows the developer to access data stored in the database in a
much more object-oriented way. To illustrate this, here is some example code that
uses AR to operate on a specific blog posting whose internal id, which is also used
as the table's Primary Key, is 99. It first retrieves the posting by Primary Key, it then
changes the title, and then updates the database to save the changes:

....................................................................................
$post=Post::model()->findByPk(99);
$post->title='Some new title';
$post->save();

...................................................................................
Active Record completely relieves us of the tedium of having to write any SQL
or otherwise deal with the underlying database

Object-relational mapping and Active Record Yii Framework

For the most part, the web applications we build house their data in a relational
database. The blog posting application we used in the previous example holds blog
post content in database tables. However, web applications need the data that is
held in the persistent database storage mapped to in-memory class properties that
define the domain objects. Object-relational mapping (ORM) libraries provide this
mapping of database tables to domain object classes.
Much of the code that deals with ORM is about describing how fields in the database
correspond to fields in our objects, which is tedious and repetitive to write. Luckily,
Yii comes to our rescue to save us from this repetition and tedium by providing the
ORM layer in the form of the AR pattern.

Active Record
As was previously mentioned, AR is a design pattern used to abstract database
access in an object-oriented fashion. It maps tables to classes, rows to objects and
columns to object attributes. In other words, each instance of an active record class
represents a single row in a database table. However an AR class is more than just
a set of attributes that map to columns in a database table; it also houses the needed
business logic behavior to be applied to that data. The end result is a class that
defines everything about how it should be written to and read from the database.
By relying on convention and sticking with reasonable defaults, Yii's implementation
of AR will save the developer a ton of time normally spent in configuration or in
writing tedious and repetitive SQL statements required to create, read, update and
delete data. It also allows the developer to access data stored in the database in a
much more object-oriented way. To illustrate this, here is some example code that
uses AR to operate on a specific blog posting whose internal id, which is also used
as the table's Primary Key, is 99. It first retrieves the posting by Primary Key, it then
changes the title, and then updates the database to save the changes:

....................................................................................
$post=Post::model()->findByPk(99);
$post->title='Some new title';
$post->save();

...................................................................................
Active Record completely relieves us of the tedium of having to write any SQL
or otherwise deal with the underlying database

YII Framework Commands, Installing YII Framework

Friday, October 28, 2011

To use this tool to create your first Yii application, open up a shell window,
and navigate to a place in your filesystem where you will want to create your
application's folder structure. For the purpose of this demo application, we will
assume the following:
•     YiiRoot is the folder where you have installed Yii
•     WebRoot is configured as the document root of your web server
•     From your command line, change to your WebRoot folder and execute
the following:
% cd WebRoot
% YiiRoot/framework/yiic webapp demo
Create a Web application under '/Webroot/demo'? [Yes|No]
Yes
   mkdir /WebRoot/demo
   mkdir /WebRoot/demo/assets
   mkdir /WebRoot/demo/css
   generate css/bg.gif
   generate css/form.css
   generate css/main.css
Your application has been created successfully under /Webroot/demo. The webapp
command is used to create a brand new Yii web application. It takes just a single
argument to specify either the absolute or relative path to the folder in which the
application should be created. The result is the generation of all the needed folders
and files to provide a default Yii web application skeleton.
Now we can change into the newly created demo folder and look at what was created
for us:
% cd demo
% ls –p
assets/    images/    index.php  themes/
css/    index-test.php  protected/
A description of the high-level items that were automatically created is shown 
as follows:
demo/   
index.php    Web application entry script file   
index-test.php  entry script file for the functional tests   
assets/    containing published resource files

YII Framework Commands, Installing YII Framework

To use this tool to create your first Yii application, open up a shell window,
and navigate to a place in your filesystem where you will want to create your
application's folder structure. For the purpose of this demo application, we will
assume the following:
•     YiiRoot is the folder where you have installed Yii
•     WebRoot is configured as the document root of your web server
•     From your command line, change to your WebRoot folder and execute
the following:
% cd WebRoot
% YiiRoot/framework/yiic webapp demo
Create a Web application under '/Webroot/demo'? [Yes|No]
Yes
   mkdir /WebRoot/demo
   mkdir /WebRoot/demo/assets
   mkdir /WebRoot/demo/css
   generate css/bg.gif
   generate css/form.css
   generate css/main.css
Your application has been created successfully under /Webroot/demo. The webapp
command is used to create a brand new Yii web application. It takes just a single
argument to specify either the absolute or relative path to the folder in which the
application should be created. The result is the generation of all the needed folders
and files to provide a default Yii web application skeleton.
Now we can change into the newly created demo folder and look at what was created
for us:
% cd demo
% ls –p
assets/    images/    index.php  themes/
css/    index-test.php  protected/
A description of the high-level items that were automatically created is shown 
as follows:
demo/   
index.php    Web application entry script file   
index-test.php  entry script file for the functional tests   
assets/    containing published resource files

YII Framework Commands, Installing YII Framework

To use this tool to create your first Yii application, open up a shell window,
and navigate to a place in your filesystem where you will want to create your
application's folder structure. For the purpose of this demo application, we will
assume the following:
•     YiiRoot is the folder where you have installed Yii
•     WebRoot is configured as the document root of your web server
•     From your command line, change to your WebRoot folder and execute
the following:
% cd WebRoot
% YiiRoot/framework/yiic webapp demo
Create a Web application under '/Webroot/demo'? [Yes|No]
Yes
   mkdir /WebRoot/demo
   mkdir /WebRoot/demo/assets
   mkdir /WebRoot/demo/css
   generate css/bg.gif
   generate css/form.css
   generate css/main.css
Your application has been created successfully under /Webroot/demo. The webapp
command is used to create a brand new Yii web application. It takes just a single
argument to specify either the absolute or relative path to the folder in which the
application should be created. The result is the generation of all the needed folders
and files to provide a default Yii web application skeleton.
Now we can change into the newly created demo folder and look at what was created
for us:
% cd demo
% ls –p
assets/    images/    index.php  themes/
css/    index-test.php  protected/
A description of the high-level items that were automatically created is shown 
as follows:
demo/   
index.php    Web application entry script file   
index-test.php  entry script file for the functional tests   
assets/    containing published resource files

Installing YII Selenium

Installing Selenium
In addition to PHPUnit, the Selenium Remote Control Server (Selenium RC) is
needed in order to run the functional tests. Installing Selenium RC is very simple.
1.  Download Selenium Remote Control (Selenium RC) zip file from 
http://seleniumhq.org/download/.
2.  Unpack the zip file to a preferred location on your system.
The contents of the unzipped folder will have several specific client-based folders
and one that contains the actual RC server. It will be named something similar to
selenium-server-1.0.x/
The TrackStar Application
Where x will be specific to the version downloaded. Starting the server is also simple.
Just navigate to this server folder on your system and issue:
% java -jar selenium-server.jar
This will start the server in that console.

Installing YII Selenium

Installing Selenium
In addition to PHPUnit, the Selenium Remote Control Server (Selenium RC) is
needed in order to run the functional tests. Installing Selenium RC is very simple.
1.  Download Selenium Remote Control (Selenium RC) zip file from 
http://seleniumhq.org/download/.
2.  Unpack the zip file to a preferred location on your system.
The contents of the unzipped folder will have several specific client-based folders
and one that contains the actual RC server. It will be named something similar to
selenium-server-1.0.x/
The TrackStar Application
Where x will be specific to the version downloaded. Starting the server is also simple.
Just navigate to this server folder on your system and issue:
% java -jar selenium-server.jar
This will start the server in that console.
 

Online Earning

Top Online Shopping Websites in Pakistan  earn money online online earning

Most Reading

Tags

Result Analytics

free counter