tag:blogger.com,1999:blog-4238471237969631822024-03-13T23:07:56.749-07:00LinuxTips 'n' Tricks on open source productsTarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.comBlogger41125tag:blogger.com,1999:blog-423847123796963182.post-36960284556574751032015-02-26T22:58:00.002-08:002015-02-26T22:59:07.054-08:00Use of Apigility to Create REST/RPC APIs<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #013755;">Hi,</span><br />
<br />
<span style="color: #013755;">Apigility is an API Builder, designed to simplify creating and maintaining useful, easy to consume, and well structured APIs. </span><br />
<span style="color: #013755;"><span style="color: #013755;">You can use Apigility in any PHP application, using all the libraries and frameworks that you want.</span></span><br />
<span style="color: #013755;"><span style="color: #013755;"><span style="color: #013755;">Apigility
offers the ability to generate API documentation and Create REST/RPC
API using the Admin UI i.e. easy to use and fast to implement. </span></span></span><br />
<h2 id="UseofApigilitytoCreateREST/RPCAPIs-Step-by-stepguide">
<span style="font-size: x-large;">Step-by-Step Guide</span></h2>
<span style="color: black;">System Requirements</span><br />
<span style="color: #013755;">Need PHP version 5.3.23 or greater</span><br />
Please follow the steps for installation from the given link below where you can find your taste of installation i.e<br />
Via Console, Tarball, GIT, Composer etc..<br />
<a class="external-link" href="https://apigility.org/documentation/intro/installation" rel="nofollow">https://apigility.org/documentation/intro/installation</a><br />
<br />
<b>Authentication & Authorization:</b><br />
<span style="color: #013755;">Apigility takes a lightweight, layered, and extensible approach to solving both problems of authentication and authorization. Apigility
delivers three methods to authenticate identities: HTTP Basic
authentication, HTTP Digest authentication, and OAuth2 (by way of Brent
Shaffer's <a class="external-link" href="https://github.com/bshaffer/oauth2-server-php" rel="nofollow">PHP OAuth2 package</a>). </span><br />
<span style="color: #013755;"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" data-base-url="https://osscube.atlassian.net/wiki" data-image-src="/wiki/download/attachments/88081272/auth-authentication-settings.jpg?version=2&modificationDate=1417766056806&api=v2" data-linked-resource-container-id="88081272" data-linked-resource-container-version="2" data-linked-resource-content-type="image/jpeg" data-linked-resource-default-alias="auth-authentication-settings.jpg" data-linked-resource-id="88309870" data-linked-resource-type="attachment" data-linked-resource-version="2" data-unresolved-comment-count="0" height="426" src="https://osscube.atlassian.net/wiki/download/attachments/88081272/auth-authentication-settings.jpg?version=2&modificationDate=1417766056806&api=v2" width="640" /></span></span><br />
<span style="color: #013755;">Out of 3 authentications, OAuth2 is bit tough to implement in your application.</span><br />
<span style="color: #013755;">OAuth2 is an authentication framework used worldwide; for instance <b>Facebook</b> <b>, </b><b>Github, and Twitter</b> use this protocol to authenticate their APIs. The OAuth2 protocol is actually a framework for authorization. From the abstract of RFC 6749 you can read that.</span><br />
<span style="color: #013755;">The use cases covered by the OAuth2 framework are:</span><br />
<ul>
<li><i>Web-server applications</i></li>
<li><i>Browser-based applications</i></li>
<li><i>Mobile apps</i></li>
<li><i>Username and password access</i></li>
<li><i>Application access</i></li>
</ul>
<span style="color: #013755;">You
can configure the OAuth2 authentication via OAuth2 sql which is
provided inside the Apigilty Library. Please follow the below Link to
configure it.</span><br />
<span style="color: #013755;"> </span><a class="external-link" href="https://apigility.org/documentation/auth/authentication-oauth2" rel="nofollow">https://apigility.org/documentation/auth/authentication-oauth2</a><br />
<br />
Create Your REST API inside Apigility, please follow the below Url:<br />
<a class="external-link" href="https://apigility.org/documentation/intro/getting-started" rel="nofollow">https://apigility.org/documentation/intro/getting-started</a><br />
<a class="external-link" href="https://apigility.org/documentation/content-validation/intro" rel="nofollow">https://apigility.org/documentation/content-validation/intro</a><br />
<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" data-base-url="https://osscube.atlassian.net/wiki" data-image-src="/wiki/download/attachments/88081272/%202014-12-05%2013-15-29.png?version=1&modificationDate=1417766056615&api=v2" data-linked-resource-container-id="88081272" data-linked-resource-container-version="2" data-linked-resource-content-type="image/png" data-linked-resource-default-alias=" 2014-12-05 13-15-29.png" data-linked-resource-id="88309873" data-linked-resource-type="attachment" data-linked-resource-version="1" data-unresolved-comment-count="0" height="416" src="https://osscube.atlassian.net/wiki/download/attachments/88081272/%202014-12-05%2013-15-29.png?version=1&modificationDate=1417766056615&api=v2" width="640" /></span><br />
For
API Documentation also Apigility helps you a lot. While creation of
API, you can define the documentation of the respected API. For further
Information how to create it please follow the below URL:<br />
<a class="external-link" href="https://apigility.org/documentation/api-doc/intro" rel="nofollow">https://apigility.org/documentation/api-doc/intro</a><br />
<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" data-base-url="https://osscube.atlassian.net/wiki" data-image-src="/wiki/download/attachments/88081272/%202014-12-05%2013-17-30.png?version=1&modificationDate=1417766056687&api=v2" data-linked-resource-container-id="88081272" data-linked-resource-container-version="2" data-linked-resource-content-type="image/png" data-linked-resource-default-alias=" 2014-12-05 13-17-30.png" data-linked-resource-id="88309874" data-linked-resource-type="attachment" data-linked-resource-version="1" data-unresolved-comment-count="0" height="461" src="https://osscube.atlassian.net/wiki/download/attachments/88081272/%202014-12-05%2013-17-30.png?version=1&modificationDate=1417766056687&api=v2" width="640" /></span><br />
<br />
<br />
<h2 id="UseofApigilitytoCreateREST/RPCAPIs-Relatedarticles">
Related articles</h2>
For further knowledge on Apigilty:<br />
<a class="external-link" href="https://apigility.org/documentation" rel="nofollow">https://apigility.org/documentation</a></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com3tag:blogger.com,1999:blog-423847123796963182.post-55618037916474149772014-10-29T07:36:00.000-07:002016-12-26T23:30:08.862-08:00GIT : Branching <div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Git Branching is the basic need in Git Version control.<br />
<br />
Here i like to share the steps to manage the branch in your application repository.<br />
<br />
<b>Step 1</b>: I am assuming initially you have "master" branch in your application then you create another branch i.e. "development" then run the below command:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #cccccc;"># git branch development</span></pre>
</div>
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #cccccc;"># git checkout development </span></pre>
</div>
<br />
//it will switch the branch into "development" branch<br />
<br />
<b>Step 2</b>: Now your are in fresh "development" branch. Then push your "master" branch code into the "development" branch.<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #cccccc;"># git push origin development</span></pre>
</div>
<br />
<h4 style="text-align: left;">
<b>GIT clone form specific branch</b></h4>
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #cccccc;"># git clone <git-repo-url> -b <branch-name> --single-branch</span></pre>
</div>
<br /></div>
</div>
<div>
<span style="background-color: white; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px;"><b>Ex:</b></span><br />
<span style="background-color: white; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px;">Suppose i had to take git clone of specific branch like development-fix not all others then my command would be</span><br />
<span style="background-color: white; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px;"><!-- HTML generated using hilite.me --></span><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px;"><span style="color: #cccccc;"># git clone git@bitbucket.org:project/project-name.git -b development-fix --single-branch</span></span></pre>
</div>
<span style="background-color: white; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px;">
</span></div>
<div>
<div>
<span style="font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif;"><span style="background-color: white; font-size: 13.2px;"></span></span></div>
</div>
<div>
<br /></div>
<div>
<span style="background-color: white; color: #5c5c5c; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px;"><br /></span></div>
<div>
<span style="background-color: white; color: #5c5c5c; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px;"><br /></span></div>
<b><br /></b>
<br />
<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-12367205603745490212014-10-15T00:08:00.000-07:002014-10-15T02:51:33.994-07:00Linux: How to compare multiple files in given directories<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
In linux, any flavor you are using, you can find out the file's content differences in two directory.<br />
<br />
For example :<br />
You have directory "test1" and "test2" both contains the multiple files and directory.<br />
<br />
And your problem is to find out files where content are mismatch with the "test1" directory's file.<br />
<br />
So, do not worry about this. Linux provide a very powerful tool to find out the differences i.e diff command:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"></pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: lime;"># diff -qrs test1/ test2/ </span></pre>
</td></tr>
</tbody></table>
</div>
<br />
Where,<br />
-q : report only when files differ<br />
-r : recursively compare any subdirectories found<br />
-s : report when two files are the same<br />
<br />
Above command will give you output in report format where files content differ or identical.<br />
<br />
If you found something differ in your file in the final report, then you can run the below command to see the actual differences.<br />
<br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"></pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: lime;"># diff test1/file1 test2/file1</span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-10992024760645411702014-09-23T04:32:00.000-07:002014-09-25T23:22:20.064-07:00NodeJs mongoDB : With sample application<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
NodeJs connectivity with the MongoDB Database.<br />
Here, i am assuming that you have <b>NodeJS, NPM and socket.io</b> installed on your machine. If not kindly follow the below URL to install the above tools:<br />
<a href="http://tarunlinux.blogspot.in/2014/09/nodejs-basics.html">http://tarunlinux.blogspot.in/2014/09/nodejs-basics.html</a><br />
<br />
Lets start to create sample appication on NodeJs with mongoDB connectivity.<br />
<br />
<b>Step 1: </b>Install mongoDB on your machine... Please follow the below link to setup mongoDB..<br />
<a href="http://tarunlinux.blogspot.in/2014/09/mongodb-basics.html">http://tarunlinux.blogspot.in/2014/09/mongodb-basics.html</a><br />
<br />
<b>Step 2: </b>Install NodeJS mongoDB dependency with the below command:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #888888;"># sudo npm install mongodb</span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<br />
It will install mongodb module in your application.<br />
<b> </b><br />
<b>Step 3: </b>Create server.js file for the nodejs:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #00cd00;">var</span> <span style="color: #cccccc;">mongo</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">require(</span><span style="color: #cd0000;">'mongodb'</span><span style="color: #cccccc;">).MongoClient;</span>
<span style="color: #00cd00;">var</span> <span style="color: #cccccc;">client</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">require(</span><span style="color: #cd0000;">'socket.io'</span><span style="color: #cccccc;">).listen(</span><span style="color: #cd00cd;">8080</span><span style="color: #cccccc;">).sockets;</span> <span style="color: navy;">//Load socket.io module</span>
<span style="color: #cccccc;">mongo.connect(</span><span style="color: #cd0000;">'mongodb://localhost/tarundb'</span><span style="color: #cccccc;">,</span> <span style="color: #00cd00;">function</span><span style="color: #cccccc;">(err,</span> <span style="color: #cccccc;">db){</span>
<span style="color: #cccccc;">client.on(</span><span style="color: #cd0000;">'connection'</span><span style="color: #cccccc;">,</span> <span style="color: #00cd00;">function</span><span style="color: #cccccc;">(socket){</span>
<span style="color: #00cd00;">var</span> <span style="color: #cccccc;">col</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">db.collection(</span><span style="color: #cd0000;">'employee'</span><span style="color: #cccccc;">);</span> <span style="color: navy;">//connect with collection of tarundb</span>
<span style="color: navy;">//Insert data into mongodb</span>
<span style="color: #cccccc;">col.insert({name</span><span style="color: #3399cc;">:</span> <span style="color: #cd0000;">'Tarun'</span><span style="color: #cccccc;">,</span> <span style="color: #cccccc;">age</span><span style="color: #3399cc;">:</span><span style="color: #cd00cd;">26</span><span style="color: #cccccc;">},</span> <span style="color: #00cd00;">function</span><span style="color: #cccccc;">()</span> <span style="color: #cccccc;">{</span>
<span style="color: #cccccc;">console.log(</span><span style="color: #cd0000;">"Inserted"</span><span style="color: #cccccc;">);</span>
<span style="color: #cccccc;">});</span>
<span style="color: navy;">//emit all the records</span>
<span style="color: #cccccc;">col.find().limit(</span><span style="color: #cd00cd;">100</span><span style="color: #cccccc;">).toArray(</span><span style="color: #00cd00;">function</span><span style="color: #cccccc;">(err,</span> <span style="color: #cccccc;">res){</span>
<span style="color: #cdcd00;">if</span><span style="color: #cccccc;">(err)</span> <span style="color: #cdcd00;">throw</span> <span style="color: #cccccc;">err;</span>
<span style="color: #cccccc;">socket.emit(</span><span style="color: #cd0000;">'all-data'</span><span style="color: #cccccc;">,</span> <span style="color: #cccccc;">res);</span>
<span style="color: #cccccc;">});</span>
<span style="color: #cccccc;">});</span>
<span style="color: #cccccc;">});</span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<b>Step 4:</b> Create Index.html file for the frontend:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #cccccc;"><html></span>
<span style="color: #cccccc;"><head></span>
<span style="color: #cccccc;"><title></span> NodeJs MongoDB APP <span style="color: #cccccc;"></title></span>
<span style="color: #cccccc;"></head></span>
<span style="color: #cccccc;"><body></span>
<span style="color: #cccccc;"><div</span> <span style="color: #cccccc;">class=</span><span style="color: #cd0000;">"data-set"</span><span style="color: #cccccc;">></div></span>
<span style="color: #cccccc;"><script src=</span><span style="color: #cd0000;">"http://localhost:8080/socket.io/socket.io.js"</span> <span style="color: #cccccc;">type=</span><span style="color: #cd0000;">"text/javascript"</span><span style="color: #cccccc;">></script></span>
<span style="color: #cccccc;"><script src=</span><span style="color: #cd0000;">"http://code.jquery.com/jquery-2.1.1.min.js"</span> <span style="color: #cccccc;">type=</span><span style="color: #cd0000;">"text/javascript"</span><span style="color: #cccccc;">></script></span>
<span style="color: #cccccc;"><script></span>
<span style="color: #cccccc;">(</span><span style="color: #00cd00;">function</span><span style="color: #cccccc;">(){</span>
<span style="color: #cdcd00;">try</span><span style="color: #cccccc;">{</span>
<span style="color: #00cd00;">var</span> <span style="color: #cccccc;">socket</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">io.connect(</span><span style="color: #cd0000;">'http://localhost:8080'</span><span style="color: #cccccc;">);</span>
<span style="color: #cccccc;">}</span> <span style="color: #cdcd00;">catch</span><span style="color: #cccccc;">(e){</span>
<span style="color: #cccccc;">console.log(e);</span>
<span style="color: #cccccc;">}</span>
<span style="color: #cdcd00;">if</span><span style="color: #cccccc;">(socket</span> <span style="color: #3399cc;">!==</span> <span style="color: #cdcd00;">undefined</span><span style="color: #cccccc;">)</span> <span style="color: #cccccc;">{</span>
<span style="color: #cccccc;">socket.on(</span><span style="color: #cd0000;">'all-data'</span><span style="color: #cccccc;">,</span> <span style="color: #00cd00;">function</span><span style="color: #cccccc;">(data){</span>
<span style="color: #cdcd00;">for</span><span style="color: #cccccc;">(</span><span style="color: #00cd00;">var</span> <span style="color: #cccccc;">i</span><span style="color: #3399cc;">=</span><span style="color: #cd00cd;">0</span><span style="color: #cccccc;">;</span> <span style="color: #cccccc;">i</span> <span style="color: #3399cc;"><</span> <span style="color: #cccccc;">data.length;</span> <span style="color: #cccccc;">i</span><span style="color: #3399cc;">++</span><span style="color: #cccccc;">)</span> <span style="color: #cccccc;">{</span>
<span style="color: #cccccc;">$(</span><span style="color: #cd0000;">".data-set"</span><span style="color: #cccccc;">).append(</span><span style="color: #cd0000;">'<li>'</span><span style="color: #3399cc;">+</span> <span style="color: #cccccc;">data[i].name</span> <span style="color: #3399cc;">+</span><span style="color: #cd0000;">'</li>'</span><span style="color: #cccccc;">);</span>
<span style="color: #cccccc;">}</span>
<span style="color: #cccccc;">});</span>
<span style="color: #cccccc;">}</span>
<span style="color: #cccccc;">})();</span>
<span style="color: #cccccc;"></script></span>
<span style="color: #cccccc;"></body></span>
<span style="color: #cccccc;"></html></span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<b>Step 5: </b>Now you have to run server.js file<br />
# nodejs server.js<br />
<br />
Then open your browser, with url: http://localhost:8080/<br />
Where you will see the mongoDB connectivity and their data.<br />
<br />
I hope it will help you for NodeJs Connectivity with MongoDB.. If you have any query, please put your comments, i highly appreciate that ...<br />
<br />
Bye..<b> </b></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com2tag:blogger.com,1999:blog-423847123796963182.post-39470205657534152552014-09-22T05:02:00.000-07:002014-09-25T23:22:33.589-07:00NodeJS MySql Connectivity : With Sample Application<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Here, i will share with you on NodeJS sample application with MySql Database connectivity.<br />
<br />
I am assuming that you already installed the NodeJS, NPM and Socket.io on your machine.<br />
If not, you can follow below link to install the above requirements<br />
<a href="http://tarunlinux.blogspot.in/2014/09/nodejs-basics.html">http://tarunlinux.blogspot.in/2014/09/nodejs-basics.html</a><br />
<br />
Here, I will show you in step-wise :<br />
<br />
<b>Step 1:</b> Install the mysql module... here also i am assuming that mysql is already installed in your machine.<br />
Now install mysql module for the NodeJs dependency.<br />
# sudo npm install mysql<br />
<br />
That will install the MySql dependency in your machine. <br />
<br />
<b>Step 2:</b> Now Create the server.js file for the nodejs:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #00cd00;">var</span> <span style="color: #cccccc;">mysql</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">require(</span><span style="color: #cd0000;">'mysql'</span><span style="color: #cccccc;">);</span> <span style="color: navy;">// load mysql module</span>
<span style="color: #00cd00;">var</span> <span style="color: #cccccc;">client</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">require(</span><span style="color: #cd0000;">'socket.io'</span><span style="color: #cccccc;">).listen(</span><span style="color: #cd00cd;">8080</span><span style="color: #cccccc;">).sockets;</span> <span style="color: navy;">//Load socket.io module</span>
<span style="color: navy;">//Database connectivity</span>
<span style="color: #00cd00;">var</span> <span style="color: #cccccc;">db</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">mysql.createConnection({</span>
<span style="color: #cccccc;">host</span><span style="color: #3399cc;">:</span> <span style="color: #cd0000;">'localhost'</span>
<span style="color: #cccccc;">,</span> <span style="color: #cccccc;">user</span><span style="color: #3399cc;">:</span> <span style="color: #cd0000;">'root'</span>
<span style="color: #cccccc;">,</span> <span style="color: #cccccc;">password</span><span style="color: #3399cc;">:</span> <span style="color: #cd0000;">'root'</span>
<span style="color: #cccccc;">,</span> <span style="color: #cccccc;">database</span><span style="color: #3399cc;">:</span> <span style="color: #cd0000;">'zfskel'</span>
<span style="color: #cccccc;">,</span> <span style="color: #cccccc;">port</span><span style="color: #3399cc;">:</span> <span style="color: #cd0000;">'3306'</span>
<span style="color: #cccccc;">});</span>
<span style="color: #cccccc;">db.connect(</span><span style="color: #00cd00;">function</span><span style="color: #cccccc;">(err){</span>
<span style="color: #cccccc;">console.log(err);</span>
<span style="color: #cccccc;">});</span>
<span style="color: navy;">//Create connection with the client and emit data on socket</span>
<span style="color: #cccccc;">client.on(</span><span style="color: #cd0000;">'connection'</span><span style="color: #cccccc;">,</span> <span style="color: #00cd00;">function</span><span style="color: #cccccc;">(socket){</span>
<span style="color: #cccccc;">db.query(</span><span style="color: #cd0000;">'SELECT * FROM employee'</span><span style="color: #cccccc;">)</span>
<span style="color: #cccccc;">.on(</span><span style="color: #cd0000;">'result'</span><span style="color: #cccccc;">,</span> <span style="color: #00cd00;">function</span><span style="color: #cccccc;">(data){</span>
<span style="color: #cccccc;">socket.emit(</span><span style="color: #cd0000;">'all-data'</span><span style="color: #cccccc;">,</span> <span style="color: #cccccc;">[data]);</span>
<span style="color: #cccccc;">});</span>
<span style="color: #cccccc;">});</span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<b>Step 3:</b> Create Index.html file for the front-end:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #cccccc;"><html></span>
<span style="color: #cccccc;"><head></span>
<span style="color: #cccccc;"><title></span> NodeJs Mysql APP <span style="color: #cccccc;"></title></span>
<span style="color: #cccccc;"><link</span> <span style="color: #cccccc;">rel=</span><span style="color: #cd0000;">"stylesheet"</span> <span style="color: #cccccc;">href=</span><span style="color: #cd0000;">""</span><span style="color: #cccccc;">></span>
<span style="color: #cccccc;"></head></span>
<span style="color: #cccccc;"><body></span>
<span style="color: #cccccc;"><div</span> <span style="color: #cccccc;">class=</span><span style="color: #cd0000;">"data-set"</span><span style="color: #cccccc;">></div></span>
<span style="color: #cccccc;"><script src=</span><span style="color: #cd0000;">"http://localhost:8080/socket.io/socket.io.js"</span> <span style="color: #cccccc;">type=</span><span style="color: #cd0000;">"text/javascript"</span><span style="color: #cccccc;">></script></span>
<span style="color: #cccccc;"><script src=</span><span style="color: #cd0000;">"http://code.jquery.com/jquery-2.1.1.min.js"</span> <span style="color: #cccccc;">type=</span><span style="color: #cd0000;">"text/javascript"</span><span style="color: #cccccc;">></script></span>
<span style="color: #cccccc;"><script></span>
<span style="color: #cccccc;">(</span><span style="color: #00cd00;">function</span><span style="color: #cccccc;">(){</span>
<span style="color: #cdcd00;">try</span><span style="color: #cccccc;">{</span>
<span style="color: #00cd00;">var</span> <span style="color: #cccccc;">socket</span> <span style="color: #3399cc;">=</span> <span style="color: #cccccc;">io.connect(</span><span style="color: #cd0000;">'http://localhost:8080'</span><span style="color: #cccccc;">);</span>
<span style="color: #cccccc;">}</span> <span style="color: #cdcd00;">catch</span><span style="color: #cccccc;">(e){</span>
<span style="color: #cccccc;">console.log(e);</span>
<span style="color: #cccccc;">}</span>
<span style="color: #cdcd00;">if</span><span style="color: #cccccc;">(socket</span> <span style="color: #3399cc;">!==</span> <span style="color: #cdcd00;">undefined</span><span style="color: #cccccc;">)</span> <span style="color: #cccccc;">{</span>
<span style="color: #cccccc;">socket.on(</span><span style="color: #cd0000;">'all-data'</span><span style="color: #cccccc;">,</span> <span style="color: #00cd00;">function</span><span style="color: #cccccc;">(data){</span>
<span style="color: #cdcd00;">for</span><span style="color: #cccccc;">(</span><span style="color: #00cd00;">var</span> <span style="color: #cccccc;">i</span><span style="color: #3399cc;">=</span><span style="color: #cd00cd;">0</span><span style="color: #cccccc;">;</span> <span style="color: #cccccc;">i</span> <span style="color: #3399cc;"><</span> <span style="color: #cccccc;">data.length;</span> <span style="color: #cccccc;">i</span><span style="color: #3399cc;">++</span><span style="color: #cccccc;">)</span> <span style="color: #cccccc;">{</span>
<span style="color: #cccccc;">$(</span><span style="color: #cd0000;">".data-set"</span><span style="color: #cccccc;">).append(</span><span style="color: #cd0000;">'<li>'</span><span style="color: #3399cc;">+</span> <span style="color: #cccccc;">data[i].name</span> <span style="color: #3399cc;">+</span><span style="color: #cd0000;">'</li>'</span><span style="color: #cccccc;">);</span>
<span style="color: #cccccc;">}</span>
<span style="color: #cccccc;">});</span>
<span style="color: #cccccc;">}</span>
<span style="color: #cccccc;">})();</span>
<span style="color: #cccccc;"></script></span>
<span style="color: #cccccc;"></body></span>
<span style="color: #cccccc;"></html></span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<br />
Now your have 2 files i.e. server.js and index.html file.<br />
<br />
<b>Step 4:</b> Now you need the sql file for the database connectivity:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6
7</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #cdcd00;">CREATE</span> <span style="color: #cdcd00;">TABLE</span> <span style="color: #cd0000;">`employee`</span> <span style="color: #cccccc;">(</span>
<span style="color: #cd0000;">`id`</span> <span style="color: #00cd00;">int</span><span style="color: #cccccc;">(</span><span style="color: #cd00cd;">11</span><span style="color: #cccccc;">)</span> <span style="color: #cdcd00;">NOT</span> <span style="color: #cccccc;">NULL,</span>
<span style="color: #cd0000;">`name`</span> <span style="color: #00cd00;">varchar</span><span style="color: #cccccc;">(</span><span style="color: #cd00cd;">45</span><span style="color: #cccccc;">)</span> <span style="color: #cdcd00;">DEFAULT</span> <span style="color: #cccccc;">NULL,</span>
<span style="color: #cd0000;">`age`</span> <span style="color: #00cd00;">int</span><span style="color: #cccccc;">(</span><span style="color: #cd00cd;">11</span><span style="color: #cccccc;">)</span> <span style="color: #cdcd00;">DEFAULT</span> <span style="color: #cccccc;">NULL,</span>
<span style="color: #cdcd00;">PRIMARY</span> <span style="color: #cdcd00;">KEY</span> <span style="color: #cccccc;">(</span><span style="color: #cd0000;">`id`</span><span style="color: #cccccc;">)</span>
<span style="color: #cccccc;">)</span> <span style="color: #cdcd00;">ENGINE</span><span style="color: #3399cc;">=</span><span style="color: #cccccc;">InnoDB</span> <span style="color: #cdcd00;">DEFAULT</span> <span style="color: #cdcd00;">CHARSET</span><span style="color: #3399cc;">=</span><span style="color: #cccccc;">latin1;</span>
<span style="color: #cdcd00;">INSERT</span> <span style="color: #cdcd00;">INTO</span> <span style="color: #cd0000;">`employee`</span> <span style="color: #cdcd00;">VALUES</span> <span style="color: #cccccc;">(</span><span style="color: #cd00cd;">1</span><span style="color: #cccccc;">,</span><span style="color: #cd0000;">'tarun'</span><span style="color: #cccccc;">,</span><span style="color: #cd00cd;">26</span><span style="color: #cccccc;">),(</span><span style="color: #cd00cd;">2</span><span style="color: #cccccc;">,</span><span style="color: #cd0000;">'varun'</span><span style="color: #cccccc;">,</span><span style="color: #cd00cd;">34</span><span style="color: #cccccc;">);</span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<b>Step 5:</b> Now you have to run only server.js file form command line:<br />
# nodejs server.js<br />
<br />
Then open your browser and run the below url:<br />
http://localhost:8080/<br />
<br />
Here, you will see the MySql data on your browser...<br />
<br />
I hope it will help you to understand NodeJs and its connectivity with the MySql connectivity.<br />
<br />
Bye.. :)</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com2tag:blogger.com,1999:blog-423847123796963182.post-20881463128362863462014-09-22T04:13:00.002-07:002014-09-22T04:13:37.983-07:00NodeJS Basics<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
I like to share some information on NodeJs.<br />
<br />
What is NodeJs.<br />
NodeJs is a cross-platform runtime environment for server-side and networking applications.<br />
Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows and Linux with no changes.<br />
Node.js internally uses the Google V8 JavaScript engine to execute code, and a large percentage of the basic modules are written in JavaScript. <br />
<br />
In this section, I will tell you on the below points:<br />
<i>1. How to install NodeJs</i><br />
<i>2. How to install NPM </i><br />
<i>3. How to install Socket.io</i><br />
<i>4. How to run nodejs from CLI</i><br />
<br />
<b>1) Installation:</b><br />
I install the NodeJs on Ubuntu 14.04 O.S with the below command:<br />
<br />
<span style="color: #e69138;"><i># sudo apt-get install nodejs</i></span><br />
<br />
<b>2) Install NPM(Node Package Manager):</b><br />
<br />
<span style="color: #e69138;"><i># sudo apt-get install npm</i></span><br />
<br />
Here, NPM basically a package manager.<br />
NPM is helpful to maintain the NodeJS dependency in your development.<br />
<br />
<b>3) Install Socket.io</b><br />
Basically it is useful to maintain the socket connection with your frontend and backend. Or you can say..<br />
Its provide you a real time communication between your node.js server and clients.<br />
Installation command:<br />
<span style="color: #e69138;"><i># sudo npm install socket.io</i></span><br />
<br />
<b>4) Run the NodeJs:</b><br />
Applications are executed from the command line with the command:<br />
<br />
<span style="color: #e69138;"><i># nodejs <application name>.js</i></span><br />
<br />
In my next article, i will demonstrate your how to use it in real time communication. </div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-15178574028338047852014-09-18T01:06:00.000-07:002015-05-27T23:58:24.021-07:00mongoDB Basics<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
From last few days i started on mongoDB. It looks interesting as i never work on noSQL type database. Before that i worked on SQL, MySQL and Oracle Database.<br />
<br />
mongoDB is the different one from the above DBs. Here, i like to share with you a quick intro on mongoDB.<br />
<br />
<b>mongoDB:</b> is a cross-platform document-oriented database.<br />
Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (MongoDB calls the format BSON)<br />
making the integration of data in certain types of applications easier and faster.<br />
<br />
I use the mongoDB in one of my project... I installed this on my machine Whose OS is Ubuntu 14.04 version.<br />
<br />
<span style="font-size: large;"><span style="color: #b45f06;"><i>Installation</i></span></span><br />
# apt-get install mongodb<br />
It will install the client and server and other library associated to it.<br />
<br />
<span style="font-size: large;"><span style="color: #b45f06;"><i>Open the port in mongod.conf,</i></span></span><br />
# sudo vi /etc/mongodb.conf<br />
Just uncomment the below line in conf file<br />
port = 27017<br />
<br />
<span style="font-size: large;"><span style="color: #b45f06;"><i>Start of mongoDB</i></span></span><br />
# sudo service mongodb start<br />
<br />
Its a pretty simple to setup on Ubuntu... :)<br />
<br />
<i>mongo</i> is a part of the standard mongoDB distribution and provides a full JavaScript environment with complete access to the JavaScript language and all standard functions as well as a full database interface for mongoDB.<br />
<br />
<span style="font-size: large;"><span style="color: #b45f06;"><i>Now Start the mongo</i></span></span><br />
# mongo<br />
It will take you on mongo prompt....<br />
<br />
<h2 style="text-align: left;">
<span style="font-size: large;"><b>Some basic commands for mongoDB</b></span></h2>
<div style="text-align: left;">
> db // show current db<br />
<br />
> show dbs //show all db with their size<br />
<br />
> use db-name //shitch to your selected db<br />
<br />
> help //show help for the mongodb<br />
<br />
> show collections //show the collections used in your selected db<br />
<br />
> db.collection-name.find() // give you all records in your collection<br />
<br />
> db.collection-name.insert({name:'Tarun', message:'Welcome'}) //insert record into the collection<br />
<br />
> db.collection-name.find({name:'Tarun'}) //give the particular record from your collection<br />
Here, important point is, this is case-sensitive.<br />
if your search as<br />
> db.collection-name.find({name:'tarun'}) // it will not show records whose name as Tarun <br />
<br />
> db.collection-name.findOne() //to get the one document from the collection<br />
<br />
> db.collection-name.find().limit(3) // to get 3 document from all document</div>
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com2tag:blogger.com,1999:blog-423847123796963182.post-17558336222132372242014-09-11T05:54:00.002-07:002014-09-11T05:54:44.408-07:00Docker : Container Technology<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
This is on the new technology that i listened from someone and that makes some curiosity inside me.<br />
<br />
After some search and digging on Google then i found some basic informations. Those information that i want to share with all blogger readers guys.<br />
<br />
First is, What is Docker?<br />
Why its required?<br />
Why it's different from VM?<br />
Then How can i use it in my activity?<br />
<br />
Huuuu... Many questions..... :)<br />
<br />
Lets start to know each and every question with their some basic information...<br />
<br />
Now,<span style="color: orange;"> <span style="font-size: large;"><b>Question 1: What is Docker?</b></span></span><br />
<b>Ans:</b> Docker is basically a new container technology where developers or admin team can manage the application component with their desired versions in one place that says as container, after that they are able to ship that container at any place or say any machine without affecting machines configurations.<br />
<br />
<i>Or in Nutshell</i><br />
providing an additional layer of abstraction and automation of operating system–level virtualization.<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Question 2: Why its required?</b></span></span><br />
<b>Ans:</b> I thing previous ans is self explanatory for this one.<br />
In further, With Docker, developers can build any app in any language using any
tool chain. “Dockerized” apps are completely portable and can run
anywhere.<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Question 3: Why it's different from VM(Virtual Machine)?</b></span></span><br />
<b>Ans: </b><br />
<u><i><b>Virtual Machine:</b></i></u> Each virtualized application includes not only the application - which
may be only 10s of MB - and the necessary binaries and libraries, but
also an entire guest operating system - which may weigh 10s of GB.<br />
<br />
<u><i><b>Docker:</b></i></u> The Docker Engine container comprises just the application and its
dependencies. It runs as an isolated process in userspace on the host
operating system, sharing the kernel with other containers. Thus, it
enjoys the resource isolation and allocation benefits of VMs but is
much more portable and efficient.
<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Question: Then How can i use it in my activity?</b></span></span><br />
<b>Ans:</b> I try to put some basic information on:<br />
How to install it on your machine?<br />
What are the basic command to use the docker?<br />
<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><i><b>INSTALLATION Process</b></i></span></span><br />
<br />
Installation of the Docker in ubuntu 14.04 :<br /><br /><i># sudo apt-get update</i><br /><br /><i># sudo apt-get install docker.io</i><br /><br /><i># sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker</i><br /><br /><i># sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io</i><br /><br /><i># sudo docker run -i -t ubuntu /bin/bash</i><br />
<br />
Above command will take you in bash prompt, where you can install the software/application that you want in the container.<br />
<br /><b>Update the container package list:</b><br /><i># apt-get update</i><br /><i># apt-get install apache2 </i> // install the apache2 in your container<br /><i># apt-get install mysql-server mysql-client</i><br />
//install the mysql-server and mysql-client<br /><br />
<i># apt-get install php5 php5-mysql libapache2-mod-php5</i><br />
// install php on the container<br /><br />To exit from the docker:<br /><i># exit </i><br />
//It will take out you from docker prompt.<br /><br />If you want to have particular distribution then use:<br /><i># docker run -i -t ubuntu:12.04 /bin/bash</i><br />It will create the ubuntu12.04 container.<br />
<br />
<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><i><b>Basic Command to get the docker information:</b></i></span></span><br /><br /><span style="font-size: large;"><b>1. To know the docker version</b></span><br /><i># docker version</i><br /><br /><span style="font-size: large;"><b>2. To search the specific docker image</b></span><br /><i>docker search <image-name></i><br />EX:<br />
<i># docker search tutorial</i><br /><br /><span style="font-size: large;"><b>3. To download the docker specific container image</b></span><br />docker pull <i><</i>username<i>></i>/<i><</i>repo-name<i>></i><br />EX:<br />
<i># docker pull tarunsinghal/lampstack</i><br /><br /><span style="font-size: large;"><b>4. To run the docker container with the some output</b></span><br />docker run <i><</i>username<i>></i>/<i><</i>repo-name<i>></i> echo "Hello Tarun"<br />EX:<br /><i># docker run tarunsinghal/lampstack echo "Hello Tarun"</i><br /><br /><span style="font-size: large;"><b>5. To run the any install in docker container</b></span><br />docker run <i><</i>username<i>></i>/<i><</i>repo-name<i>></i> apt-get install -y ping<br />EX:<br />
<i># docker run tarunsinghal/lampstack apt-get install -y ping</i><br />
<br /><span style="font-size: large;"><b>6. To commit the docker images changes</b></span><br />docker commit <i><</i>id<i>></i> <i><</i>username<i>></i>/<i><</i>repo-name<i>></i><br />
EX:<br />
<i># docker commit 6789 tarunsinghal/lampstack </i><br />
<br />Here, id: is the docker id which will be identified by the<br />
<i># docker ps -a</i> // that shows you number of container with their ids.<br />if you pass ids starting 4 character then thats enough to identify the right container.<br /><br /><span style="font-size: large;"><b>7. To run the docker installed utility</b></span><br />docker run <i><</i>username<i>></i>/<i><</i>repo-name<i>></i> ping google.com<br />EX:<br />
<i># docker run tarunsinghal/lampstack ping google.com</i><br />
<br /><span style="font-size: large;"><b>8. To know the running docker information with specific id.</b></span><br /><i># docker ps -a</i> // will tell you the running docker(s)<br /><i># docker inspect </i><i><i><</i>id-number</i><i>></i> // will give you complete information on this docker ids<br />
<br />here, id : is the docker container id number<br /><br /><span style="font-size: large;"><b>9. To push the new image in the docker registry</b></span><br /><i># docker push </i><i><i><</i>username</i><i><i>></i>/</i><i><i><</i>repo-name</i><i>></i><br /><br />In this way, you downloaded the docker with given repo, after that you make some changes and push it again to the docker registry with new name.<br />
<br />Now, that new docker images will be usable in any other similar environment.<br /><br /><span style="font-size: large;"><b>10. If you want docker will automatically on when you boot your machine</b></span><br /><i># docker chkconfig docker on</i><br />
<br />
<i>Further more, if you want to know on this you can refer the below URL for Docker: <a href="https://www.docker.com/">https://www.docker.com </a></i></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-48846918835134755362014-09-03T03:05:00.000-07:002014-09-05T02:41:07.646-07:00PHPUnit Pear Install In Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
To install the PHPUnit in ubuntu, Please follow the below instruction:<br />
<br />
If your system does not have Pear installed then:<br />
<br />
<span style="color: #e69138;"><i># sudo apt-get install php-pear</i></span><br />
<br />
<span style="color: #e69138;"><i># sudo pear channel-update pear.php.net</i></span><br />
<br />
Now, You have to install the PHPUnit, with the help of pear easily:<br />
<br />
<br />
<span style="color: #e69138;"><i># sudo pear channel-discover pear.phpunit.de</i></span><br />
<br />
<span style="color: #e69138;"><i># sudo pear install -a phpunit/PHPUnit</i></span><br />
<br />
If you want the code-coverage analysis of your application then you have to install the PHP extension i.e. Xdebug , That will help you create the html formatted report where you can see:<br />
i) Code coverage percentage<br />
ii) Which test case run on your application code<br />
<br />
Command, to install Xdebug: <br />
<span style="color: #e69138;"><i># sudo apt-get install php5-xdebug</i></span><br />
<span style="color: red;"><br /></span>
<span style="color: red;">NOTE:</span> The above process of installation via PEAR would be outdated on Dec, 2014.<br />
Please try to use Composer instead of PEAR<br />
<br />
<br />
<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-39646922954942092432014-08-28T06:36:00.000-07:002014-08-28T06:36:44.050-07:00PHPUnit in Zend Framework 2<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Process of setup PHPUnit testing in Zend Framework-2:<br />
<br />
NOTE: Before starting to describe the process of PHPUnit i assuming that readers are aware of Zend Framework-2.<br />
<br />
<span style="color: orange;"><span style="font-size: large;"><b>Step 1:</b></span> </span>PHPUnit Installation with the help of "Pear"<br />
<i># pear config-set auto_discover 1</i><br />
<i># pear install pear.phpunit.de/PHPUnit</i><br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Step 2:</b></span></span> Create "test" directory inside your module.<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Step 3:</b></span></span> create phpunit.xml, TestConfig.php and Bootstrap.php file inside the "test" directory.<br />
<br />
<i><span style="color: orange;"><b>phpunit.xml File</b></span></i><br />
<pre><!-- HTML generated using hilite.me --><div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #557799;"><?xml version="1.0" encoding="UTF-8"?></span>
<span style="color: #007700;"><phpunit</span> <span style="color: #0000cc;">bootstrap=</span><span style="background-color: #fff0f0;">"Bootstrap.php"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><php></span>
<span style="color: #888888;"><!--server name="SERVER_PORT" value="80"/ --></span>
<span style="color: #007700;"></php></span>
<span style="color: #007700;"><testsuites></span>
<span style="color: #007700;"><testsuite</span> <span style="color: #0000cc;">name=</span><span style="background-color: #fff0f0;">"Demo PHPUnit"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><directory></span>./ApplicationTest<span style="color: #007700;"></directory></span>
<span style="color: #007700;"></testsuite></span>
<span style="color: #007700;"></testsuites></span>
<span style="color: #007700;"></phpunit></span>
</pre>
</div>
</pre>
<br />
<i><span style="color: orange;"><b>TestConfig.php</b></span></i><br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #557799;"><?php</span>
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'modules'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="color: #888888;">// Other modules needed</span>
<span style="background-color: #fff0f0;">'Application'</span>,
),
<span style="background-color: #fff0f0;">'module_listener_options'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'config_glob_paths'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'../../../config/autoload/{,*.}{global,local}.php'</span>,
),
<span style="background-color: #fff0f0;">'module_paths'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'module'</span>,
<span style="background-color: #fff0f0;">'vendor'</span>,
),
),
);</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<span style="color: orange;"><i><b>Bootstrap.php</b></i></span><br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; max-height: 400px; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #557799;"><?php</span>
<span style="color: #008800; font-weight: bold;">namespace</span> ApplicationTest; <span style="color: #888888;">// our namespace</span>
<span style="color: #008800; font-weight: bold;">use</span> Zend\Loader\AutoloaderFactory;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Mvc\Service\ServiceManagerConfig;
<span style="color: #008800; font-weight: bold;">use</span> Zend\ServiceManager\ServiceManager;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Stdlib\ArrayUtils;
<span style="color: #008800; font-weight: bold;">use</span> RuntimeException;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Session\Container;
<span style="color: #007020;">error_reporting</span>(<span style="color: #008800; font-weight: bold;">E_ALL</span> <span style="color: #333333;">|</span> E_STRICT);
<span style="color: #007020;">chdir</span>(__DIR__);
<span style="color: #008800; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">Bootstrap</span>
{
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #996633;">$serviceManager</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #996633;">$config</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #996633;">$bootstrap</span>;
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">init</span>()
{
<span style="color: #888888;">// Load the user-defined test configuration file, if it exists; otherwise, load</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #007020;">is_readable</span>(__DIR__ <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/TestConfig.php'</span>)) {
<span style="color: #996633;">$testConfig</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">include</span> __DIR__ <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/TestConfig.php'</span>;
} <span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #996633;">$testConfig</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">include</span> __DIR__ <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/TestConfig.php.dist'</span>;
}
<span style="color: #996633;">$zf2ModulePaths</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">array</span>();
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #007020;">isset</span>(<span style="color: #996633;">$testConfig</span>[<span style="background-color: #fff0f0;">'module_listener_options'</span>][<span style="background-color: #fff0f0;">'module_paths'</span>])) {
<span style="color: #996633;">$modulePaths</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$testConfig</span>[<span style="background-color: #fff0f0;">'module_listener_options'</span>][<span style="background-color: #fff0f0;">'module_paths'</span>];
<span style="color: #008800; font-weight: bold;">foreach</span> (<span style="color: #996633;">$modulePaths</span> <span style="color: #008800; font-weight: bold;">as</span> <span style="color: #996633;">$modulePath</span>) {
<span style="color: #008800; font-weight: bold;">if</span> ((<span style="color: #996633;">$path</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">static</span><span style="color: #333333;">::</span><span style="color: #0000cc;">findParentPath</span>(<span style="color: #996633;">$modulePath</span>)) ) {
<span style="color: #996633;">$zf2ModulePaths</span>[] <span style="color: #333333;">=</span> <span style="color: #996633;">$path</span>;
}
}
}
<span style="color: #996633;">$zf2ModulePaths</span> <span style="color: #333333;">=</span> <span style="color: #007020;">implode</span>(PATH_SEPARATOR, <span style="color: #996633;">$zf2ModulePaths</span>) <span style="color: #333333;">.</span> PATH_SEPARATOR;
<span style="color: #996633;">$zf2ModulePaths</span> <span style="color: #333333;">.=</span> <span style="color: #007020;">getenv</span>(<span style="background-color: #fff0f0;">'ZF2_MODULES_TEST_PATHS'</span>) <span style="color: #333333;">?:</span> (<span style="color: #007020;">defined</span>(<span style="background-color: #fff0f0;">'ZF2_MODULES_TEST_PATHS'</span>) <span style="color: #333333;">?</span> ZF2_MODULES_TEST_PATHS <span style="color: #333333;">:</span> <span style="background-color: #fff0f0;">''</span>);
<span style="color: #008800; font-weight: bold;">static</span><span style="color: #333333;">::</span><span style="color: #0000cc;">initAutoloader</span>();
<span style="color: #888888;">// use ModuleManager to load this module and it's dependencies</span>
<span style="color: #996633;">$baseConfig</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'module_listener_options'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'module_paths'</span> <span style="color: #333333;">=></span> <span style="color: #007020;">explode</span>(PATH_SEPARATOR, <span style="color: #996633;">$zf2ModulePaths</span>),
),
);
<span style="color: #996633;">$config</span> <span style="color: #333333;">=</span> ArrayUtils<span style="color: #333333;">::</span><span style="color: #0000cc;">merge</span>(<span style="color: #996633;">$baseConfig</span>, <span style="color: #996633;">$testConfig</span>);
<span style="color: #996633;">$serviceManager</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> ServiceManager(<span style="color: #008800; font-weight: bold;">new</span> ServiceManagerConfig());
<span style="color: #996633;">$serviceManager</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setService</span>(<span style="background-color: #fff0f0;">'ApplicationConfig'</span>, <span style="color: #996633;">$config</span>);
<span style="color: #996633;">$serviceManager</span><span style="color: #333333;">-></span><span style="color: #0000cc;">get</span>(<span style="background-color: #fff0f0;">'ModuleManager'</span>)<span style="color: #333333;">-></span><span style="color: #0000cc;">loadModules</span>();
<span style="color: #008800; font-weight: bold;">static</span><span style="color: #333333;">::</span><span style="color: #996633;">$serviceManager</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$serviceManager</span>;
<span style="color: #008800; font-weight: bold;">static</span><span style="color: #333333;">::</span><span style="color: #996633;">$config</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$config</span>;
}
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">getServiceManager</span>()
{
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">static</span><span style="color: #333333;">::</span><span style="color: #996633;">$serviceManager</span>;
}
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">getConfig</span>()
{
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">static</span><span style="color: #333333;">::</span><span style="color: #996633;">$config</span>;
}
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">initAutoloader</span>()
{
<span style="color: #996633;">$vendorPath</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">static</span><span style="color: #333333;">::</span><span style="color: #0000cc;">findParentPath</span>(<span style="background-color: #fff0f0;">'vendor'</span>);
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #007020;">is_readable</span>(<span style="color: #996633;">$vendorPath</span> <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/autoload.php'</span>)) {
<span style="color: #996633;">$loader</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">include</span> <span style="color: #996633;">$vendorPath</span> <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/autoload.php'</span>;
} <span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #996633;">$zf2Path</span> <span style="color: #333333;">=</span> <span style="color: #007020;">getenv</span>(<span style="background-color: #fff0f0;">'ZF2_PATH'</span>) <span style="color: #333333;">?:</span> (<span style="color: #007020;">defined</span>(<span style="background-color: #fff0f0;">'ZF2_PATH'</span>) <span style="color: #333333;">?</span> ZF2_PATH <span style="color: #333333;">:</span> (<span style="color: #007020;">is_dir</span>(<span style="color: #996633;">$vendorPath</span> <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/ZF2/library'</span>) <span style="color: #333333;">?</span> <span style="color: #996633;">$vendorPath</span> <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/ZF2/library'</span> <span style="color: #333333;">:</span> <span style="color: #008800; font-weight: bold;">false</span>));
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #333333;">!</span><span style="color: #996633;">$zf2Path</span>) {
<span style="color: #008800; font-weight: bold;">throw</span> <span style="color: #008800; font-weight: bold;">new</span> RuntimeException(<span style="background-color: #fff0f0;">'Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.'</span>);
}
<span style="color: #008800; font-weight: bold;">include</span> <span style="color: #996633;">$zf2Path</span> <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/Zend/Loader/AutoloaderFactory.php'</span>;
}
AutoloaderFactory<span style="color: #333333;">::</span><span style="color: #0000cc;">factory</span>(<span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'Zend\Loader\StandardAutoloader'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">array</span>(
<span style="background-color: #fff0f0;">'autoregister_zf'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">true</span>,
<span style="background-color: #fff0f0;">'namespaces'</span> <span style="color: #333333;">=></span> <span style="color: #008800; font-weight: bold;">array</span>(
__NAMESPACE__ <span style="color: #333333;">=></span> __DIR__ <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/'</span> <span style="color: #333333;">.</span> __NAMESPACE__,
),
),
));
}
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">findParentPath</span>(<span style="color: #996633;">$path</span>)
{
<span style="color: #996633;">$dir</span> <span style="color: #333333;">=</span> __DIR__;
<span style="color: #996633;">$previousDir</span> <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'.'</span>;
<span style="color: #008800; font-weight: bold;">while</span> (<span style="color: #333333;">!</span><span style="color: #007020;">is_dir</span>(<span style="color: #996633;">$dir</span> <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/'</span> <span style="color: #333333;">.</span> <span style="color: #996633;">$path</span>)) {
<span style="color: #996633;">$dir</span> <span style="color: #333333;">=</span> <span style="color: #007020;">dirname</span>(<span style="color: #996633;">$dir</span>);
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #996633;">$previousDir</span> <span style="color: #333333;">===</span> <span style="color: #996633;">$dir</span>) <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">false</span>;
<span style="color: #996633;">$previousDir</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$dir</span>;
}
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #996633;">$dir</span> <span style="color: #333333;">.</span> <span style="background-color: #fff0f0;">'/'</span> <span style="color: #333333;">.</span> <span style="color: #996633;">$path</span>;
}
}
Bootstrap<span style="color: #333333;">::</span><span style="color: #0000cc;">init</span>();</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<div>
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Step 4:</b></span></span> Create directory for module testing inside the "test" directory. Name should be same as the module name.<br />
EX: if your module name is "Report" then your testing module-name would be "ReportTest"<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Step 5:</b></span></span> Create Controller directory whose name would be "Controller" inside the Test module i.e. "ReportTest"<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Step 6:</b></span></span> Create controller class file inside your controller dir, named as your main module controller file-name.<br />
ex: your module controller name as "IndexController" then test-module controller file name should be "IndexControllerTest".<br />
<br />
<i><span style="color: orange;"><b>IndexControllerTest.php</b></span></i> <br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; max-height: 400px; overflow: auto; padding: .2em .6em; width: auto;">
<table>
<tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #557799;"><?php</span>
<span style="color: #008800; font-weight: bold;">namespace</span> ApplicationTest\Controller;
<span style="color: #008800; font-weight: bold;">use</span> ApplicationTest\Bootstrap;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Mvc\Router\Http\TreeRouteStack <span style="color: #008800; font-weight: bold;">as</span> HttpRouter;
<span style="color: #008800; font-weight: bold;">use</span> Application\Controller\IndexController;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Http\Request;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Http\Response;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Mvc\MvcEvent;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Mvc\Router\RouteMatch;
<span style="color: #008800; font-weight: bold;">use</span> Zend\Test\PHPUnit\Controller\AbstractControllerTestCase;
<span style="color: #888888;">// use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;</span>
<span style="color: #008800; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">IndexControllerTest</span> <span style="color: #008800; font-weight: bold;">extends</span> AbstractControllerTestCase
{
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #996633;">$controller</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #996633;">$request</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #996633;">$response</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #996633;">$routeMatch</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #996633;">$event</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #996633;">$userMockObj</span>;
<span style="color: #008800; font-weight: bold;">protected</span> <span style="color: #996633;">$serviceManager</span>;
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">setUp</span>()
{
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">serviceManager</span> <span style="color: #333333;">=</span> Bootstrap<span style="color: #333333;">::</span><span style="color: #0000cc;">getServiceManager</span>();
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">controller</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> IndexController();
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">request</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> Request();
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">routeMatch</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> RouteMatch(<span style="color: #008800; font-weight: bold;">array</span>(<span style="background-color: #fff0f0;">'controller'</span> <span style="color: #333333;">=></span> <span style="background-color: #fff0f0;">'index'</span>));
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">event</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> MvcEvent();
<span style="color: #996633;">$config</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">serviceManager</span><span style="color: #333333;">-></span><span style="color: #0000cc;">get</span>(<span style="background-color: #fff0f0;">'Config'</span>);
<span style="color: #996633;">$routerConfig</span> <span style="color: #333333;">=</span> <span style="color: #007020;">isset</span>(<span style="color: #996633;">$config</span>[<span style="background-color: #fff0f0;">'router'</span>]) <span style="color: #333333;">?</span> <span style="color: #996633;">$config</span>[<span style="background-color: #fff0f0;">'router'</span>] <span style="color: #333333;">:</span> <span style="color: #008800; font-weight: bold;">array</span>();
<span style="color: #996633;">$router</span> <span style="color: #333333;">=</span> HttpRouter<span style="color: #333333;">::</span><span style="color: #0000cc;">factory</span>(<span style="color: #996633;">$routerConfig</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">event</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setRouter</span>(<span style="color: #996633;">$router</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">event</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setRouteMatch</span>(<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">routeMatch</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">controller</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setEvent</span>(<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">event</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">controller</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setServiceLocator</span>(<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">serviceManager</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">userMockObj</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">getMockBuilder</span>(<span style="background-color: #fff0f0;">'Application\Model\TestModel'</span>)
<span style="color: #333333;">-></span><span style="color: #0000cc;">disableOriginalConstructor</span>()
<span style="color: #333333;">-></span><span style="color: #0000cc;">getMock</span>();
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setApplicationConfig</span>(
<span style="color: #008800; font-weight: bold;">include</span> __DIR__<span style="color: #333333;">.</span><span style="background-color: #fff0f0;">'/../../TestConfig.php'</span>
);
<span style="color: #008800; font-weight: bold;">parent</span><span style="color: #333333;">::</span><span style="color: #0000cc;">setUp</span>();
}
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">testWorkAction</span>()
{
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">serviceManager</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setAllowOverride</span>(<span style="color: #008800; font-weight: bold;">true</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">serviceManager</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setService</span>(<span style="background-color: #fff0f0;">'Application\Model\TestModel'</span>, <span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">userMockObj</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">routeMatch</span><span style="color: #333333;">-></span><span style="color: #0000cc;">setParam</span>(<span style="background-color: #fff0f0;">'action'</span>, <span style="background-color: #fff0f0;">'work'</span>);
<span style="color: #996633;">$response</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">controller</span><span style="color: #333333;">-></span><span style="color: #0000cc;">getResponse</span>();
<span style="color: #996633;">$result</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">controller</span><span style="color: #333333;">-></span><span style="color: #0000cc;">dispatch</span>(<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">request</span>, <span style="color: #996633;">$response</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertEquals</span>(<span style="color: #0000dd; font-weight: bold;">200</span>, <span style="color: #996633;">$response</span><span style="color: #333333;">-></span><span style="color: #0000cc;">getStatusCode</span>());
<span style="color: #888888;">// Check a ViewModel has been returned</span>
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertInstanceOf</span>(<span style="background-color: #fff0f0;">'Zend\View\Model\ViewModel'</span>, <span style="color: #996633;">$result</span>);
<span style="color: #888888;">// Test against the test data</span>
<span style="color: #996633;">$variables</span> <span style="color: #333333;">=</span> <span style="color: #996633;">$result</span><span style="color: #333333;">-></span><span style="color: #0000cc;">getVariables</span>();
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertArrayHasKey</span>(<span style="background-color: #fff0f0;">'name'</span>, <span style="color: #996633;">$variables</span>);
<span style="color: #888888;">// Very lazy validation of data ;-)</span>
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertEquals</span>(<span style="background-color: #fff0f0;">'OSSCube1'</span>, <span style="color: #996633;">$variables</span>[<span style="background-color: #fff0f0;">"name"</span>]);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">dispatch</span>(<span style="background-color: #fff0f0;">'/index'</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertModuleName</span>(<span style="background-color: #fff0f0;">'Application'</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertControllerClass</span>(<span style="background-color: #fff0f0;">'IndexController'</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertMatchedRouteName</span>(<span style="background-color: #fff0f0;">'xyz'</span>);
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertControllerName</span>(<span style="background-color: #fff0f0;">'Application\Controller\Index'</span>);
}
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #008800; font-weight: bold;">function</span> <span style="color: #0066bb; font-weight: bold;">testMemory</span>() {
<span style="color: #996633;">$this</span><span style="color: #333333;">-></span><span style="color: #0000cc;">assertGreaterThanOrEqual</span>(<span style="color: #0000dd; font-weight: bold;">699328</span>, <span style="color: #007020;">memory_get_usage</span>());
}
}
<span style="color: #557799;">?></span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
Now your directory structure would look like as:<br />
<img alt="" height="400" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQYAAAF6CAYAAAD71faGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8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y983fUcikxAl1EYLIk1tnajalmJfQ+e5PLbCRIp0RGklGmDmzg5IRQD/3lXYt/evbzbLYC+773HsuUrzCY2q9NSMYwb1IaiMKKvoVDkcssoCiZHCzlpHnIzTkZpjxIo0oNVoxMt+G1GzQOuxMgp61UylxdEhp2LG7ZxN4gR1zcIxcB/LgxOTk4s+eknalTzsSicNWPEEL5kPR0HdAO1OtebSo35oqCJ4NCeE9y4f5PDP33ByriGvNfIGYVLbd4se5UlP+7iSkQUkZFxmcGqAOiTiboXRXTEJcJnj2NFUgsGN3HGysYRW90Dzl6NJ2tJcaozgHf4lclf/sr5fx9w/9p5bjwWPwgrvJr+c2Fo2KgRbdu2s3j5x0+0hK/aSccB7ckYOZi6qbCzbKQgJXIhZDBv1WtCn6U6+ocspKuHFdjWZMyCsZQPH0HLurVpOngntr7VKK0AmY0XtaslsDigLn51WzBuX0UmrfuOtmXlyJzfZGQPJzaOCeZU8tOnkTn789X6aVQ/MoG29WvRoO1HrL4phg/Cq0kmSVK2vfAtv2y0+JqEgrZbHljNouUGh1zNc74+JozOuVzBKAhCwRXKJX3mNnhBEApXkb7WV+7Wm/A7vQt7NQThlfPSfrtSEITCIwqDIAhGRGEQBMGIIlWdYjTR1DRLFLSdIAgvFzFiEATBiCgMgiAY+X+Th9w7yleABQAAAABJRU5ErkJggg==" width="275" /> <br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Step 7:</b></span></span> Run the phpunit inside of the "test" directory. then you will see some output if your test run successfully like as :<br />
<br />
#phpunit<br />
PHPUnit 4.1.3 by Sebastian Bergmann.<br />
..<br />
Time: 00:00<br />
OK (2 tests)<br />
<br />
<span style="font-size: large;"><span style="color: orange;"><b>Step 8:</b></span></span> Some time you will get error, then there would be some code return that has some significant role like as:<br />
<b>.</b> Printed when the test succeeds.<br />
<b>F</b> Printed when an assertion fails while running the test method.<br />
<b>E</b> Printed when an error occurs while running the test method.<br />
<b>S</b> Printed when the test has been skipped.<br />
<b>I</b> Printed when the test is marked as being incomplete or not yet implemented.<br />
</div>
<div>
<span style="font-size: large;"><span style="color: orange;"><b>Step 9:</b></span></span> To get the html report for the code coverage analysis of your code, it's a </div>
<div>
feature of the phpunit to get the beautiful html formatted dashboard and reports.</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
To get this feature you have to install the PHP xDebug module.</div>
<div>
<i># sudo pecl install xdebug </i></div>
<div>
</div>
<div>
Now, You can create the report by the below command:<br />
<i># phpunit --coverage-html dir-name</i></div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
Here, dir-name is the directory where you will put the report content. It will take bit of time to generate the html report. Once your report generated then just open the index.html file in your browser....</div>
<div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz197BJCc-n9ljHeAIXVmmscoI5tEo8MxP1i3KHIr-YodDn05jgYMRjQOwCg2OzfVDnGOatdWTh2Bg8v6nXHKu_tLO9AiMVTU51LC4A7bUGca9eFufdFkB013ts-yabRAsfFd_krBEFQdE/s1600/Code-Coverage-2014-08-28+18-37-30.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz197BJCc-n9ljHeAIXVmmscoI5tEo8MxP1i3KHIr-YodDn05jgYMRjQOwCg2OzfVDnGOatdWTh2Bg8v6nXHKu_tLO9AiMVTU51LC4A7bUGca9eFufdFkB013ts-yabRAsfFd_krBEFQdE/s1600/Code-Coverage-2014-08-28+18-37-30.jpeg" height="161" width="640" /></a></div>
<div>
<br />
<br />
<div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
To see the code coverage for the tested code:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0BsqrAbozXe2k1oGpUBaRpjb_udA0eA-32vveov2HPrRkmRI4soelSKFchz6lLYnIblXK5pX8cXB8tQfeIDVMw5xIt4O0Me1YH-vn-TmynQCjbZzhO5hebqxpSjqx_omsdGrfM2TN2Ywi/s1600/Code-Coverage2-2014-08-28+18-40-54.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0BsqrAbozXe2k1oGpUBaRpjb_udA0eA-32vveov2HPrRkmRI4soelSKFchz6lLYnIblXK5pX8cXB8tQfeIDVMw5xIt4O0Me1YH-vn-TmynQCjbZzhO5hebqxpSjqx_omsdGrfM2TN2Ywi/s1600/Code-Coverage2-2014-08-28+18-40-54.jpeg" height="316" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
In similar way you can get the <b>dashboard</b> on click of dashboard link that contain nice graph(s):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdtwLSh1tmX2W63XP-5oJM-x6KHljl3YzVlFpwJ-rAqutsQC1HH1rHL78P6F7yMw9lbt-yUq-XGRHGOBfcypv8KjdVh9_amb9B5xMufuyBw6IdW8aroj0Svj5srgeeW9Sh1pajT0ezouKP/s1600/Dashboard-2014-08-28+18-43-28.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdtwLSh1tmX2W63XP-5oJM-x6KHljl3YzVlFpwJ-rAqutsQC1HH1rHL78P6F7yMw9lbt-yUq-XGRHGOBfcypv8KjdVh9_amb9B5xMufuyBw6IdW8aroj0Svj5srgeeW9Sh1pajT0ezouKP/s1600/Dashboard-2014-08-28+18-43-28.jpeg" height="236" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
I hope it will help you to run PHPUnit in Zend Framework-2. If anybody got issue during setup, Please put your comment, i highly appreciate that.. :)<br />
<br />
<br />
</div>
</div>
</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com5tag:blogger.com,1999:blog-423847123796963182.post-8183536164096030482014-06-30T00:50:00.001-07:002014-09-01T07:31:52.114-07:00Zend Server Deployment : With the help of ZPK File<div dir="ltr" style="text-align: left;" trbidi="on">
Deployment of ZPK file of your application is pretty simple as compared to ZPK file creation.<br />
<br />
Minimum requirement of the ZPK file deployment is installed Zend-Server version 6.2 on your system.<br />
<br />
Once Zend-Server installed, just logged-in into zend-server, where you will see the home screen like as :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwvz7QljC6nI_FG7f2KuFYmpZRZ4Azcmqa-uH9YZmixOOifnyN3W5MCDXnOPaxNu7oyYwKCf3ENykk7lTGihmS8x3LXUyAng0QNuAst36-spNI55hOXJG5EKY-CTL4xkZ_FrXf0EQ36w6C/s1600/zend-server_home.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwvz7QljC6nI_FG7f2KuFYmpZRZ4Azcmqa-uH9YZmixOOifnyN3W5MCDXnOPaxNu7oyYwKCf3ENykk7lTGihmS8x3LXUyAng0QNuAst36-spNI55hOXJG5EKY-CTL4xkZ_FrXf0EQ36w6C/s1600/zend-server_home.png" height="452" width="640" /></a></div>
<br />
Here, You will see the Application tab where you can deploy the zpk file of your application.<br />
<br />
click on the "Application -> Apps" tab, then you will see the below screen as:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXY0ZyyJIo-bEY_1GGj0YQHCdm3amxFOUaBSMwYsHWT4qmn8Y7lfNplIdajeAAmhvszEyF4xyECg7UoRy3t_4kZpMNPSFjzdxC07eGxaIbdrmP1MdhaDpf8-XniBGqIzAV9UZeUenS8oE6/s1600/zend-apps.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXY0ZyyJIo-bEY_1GGj0YQHCdm3amxFOUaBSMwYsHWT4qmn8Y7lfNplIdajeAAmhvszEyF4xyECg7UoRy3t_4kZpMNPSFjzdxC07eGxaIbdrmP1MdhaDpf8-XniBGqIzAV9UZeUenS8oE6/s1600/zend-apps.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXY0ZyyJIo-bEY_1GGj0YQHCdm3amxFOUaBSMwYsHWT4qmn8Y7lfNplIdajeAAmhvszEyF4xyECg7UoRy3t_4kZpMNPSFjzdxC07eGxaIbdrmP1MdhaDpf8-XniBGqIzAV9UZeUenS8oE6/s1600/zend-apps.jpeg" height="220" width="640" /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfd5ehz5S13Ke9YxrmfCegurTb5Y-nU_m87L4-Vo1cLBTEhjW8H1Qm8XG0qfynvUqfkPAFTANlUQjf0Hb3aTiCygHM984E2h8X6nKCXpOvh25vr0KeQReZ8TpSWzMaGCz49JAy3orVJFPJ/s1600/zend-server-application.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a>
<br />
<div style="text-align: justify;">
Here, you will see the number of application deployed in "Name" column.</div>
<div style="text-align: justify;">
Now click on "Deploy Application" then select your ZPK file to deploy.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi11fJRxqNbGwjtMZdq7NRRQvgf0gPzMJNma46YhUIQJXq0w3NG5wz7OZE3yeqhENwm_XIhjfsubO0-7Y16qVcd2lE3A6HXvo6kaibXxSo4o2qvptlQ72n5px8QtqXKHxYT6ifm29imL8RC/s1600/deploy.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi11fJRxqNbGwjtMZdq7NRRQvgf0gPzMJNma46YhUIQJXq0w3NG5wz7OZE3yeqhENwm_XIhjfsubO0-7Y16qVcd2lE3A6HXvo6kaibXxSo4o2qvptlQ72n5px8QtqXKHxYT6ifm29imL8RC/s1600/deploy.png" height="454" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Here, you will see option to upload the zpk file, upload your ZPK file and click next:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOwCoYfaDhO8ui7XT-URsy7umtqdJMZ5Q2fNLZC6NVh0Yqw5BhAY2z3OqOcvN3MO_HVIP8EI4aCbimZP-JmSHoaOev7657XD-HqL4IvXuFsXaoAmeIIo2qgMTMZoxB5hy2bwRexR18aVoS/s1600/app-detail1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOwCoYfaDhO8ui7XT-URsy7umtqdJMZ5Q2fNLZC6NVh0Yqw5BhAY2z3OqOcvN3MO_HVIP8EI4aCbimZP-JmSHoaOev7657XD-HqL4IvXuFsXaoAmeIIo2qgMTMZoxB5hy2bwRexR18aVoS/s1600/app-detail1.png" height="450" width="640" /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioou4HMziWK-7pty0H4oMvqkT4EDhhg9FVn3nz22by-VrM6phJfKtRqiXhwNx0eKJlpNMQR4r3RKTNIdAH6-i7rh46CGm8jGd1SMxWxgRr0rTxSeKKO1b-AZoI5CnTQ7ewIwnMwz2xRuSj/s1600/app-detail.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Fill the "Display Name" which will appear in the "Name" column after deploy. Here, you can add your virtual host name where your application will resolve. Path field is optional, if you add path then Url would be like as: <br />
"http://cmdpglock.in:80/path"<br />
<br />
After fill the all detail, click "Next". after that you will see the Licence agreement screen as:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaM4MnY-xF5IXCKNqwtKlNO1YxN4y8R6OZVVbC6l3gV7pPf-a3NZgiQN3Vp2gVgu9hgi-YDu4JUdmvR9f4-t4iS1Wx7ko0UFpB4OB029GaZyX4tpTEZNw5ZI6vyvDAo5PEpds3Yl4CiGlZ/s1600/licence.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaM4MnY-xF5IXCKNqwtKlNO1YxN4y8R6OZVVbC6l3gV7pPf-a3NZgiQN3Vp2gVgu9hgi-YDu4JUdmvR9f4-t4iS1Wx7ko0UFpB4OB029GaZyX4tpTEZNw5ZI6vyvDAo5PEpds3Yl4CiGlZ/s1600/licence.png" height="452" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Just accept the agreement of Licence, then click "Next".<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfxwLyVRKfa1Gl98pOd7LI2EIR0s1UyJ-rfV_3CSr_H-6G5qbvDkflQUsU2JZwsSirBmogMtKwtMDpgElnHb8N-yxrpXdm5Q26qI1QK2SXKJ3SQ_J6iRTH0FIvAeYdWXg_3pEhOESYofDY/s1600/prerequisites.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfxwLyVRKfa1Gl98pOd7LI2EIR0s1UyJ-rfV_3CSr_H-6G5qbvDkflQUsU2JZwsSirBmogMtKwtMDpgElnHb8N-yxrpXdm5Q26qI1QK2SXKJ3SQ_J6iRTH0FIvAeYdWXg_3pEhOESYofDY/s1600/prerequisites.png" height="448" width="640" /></a></div>
Here, you will see all the Prerequisites for the application deploy, If all are okey, then click "Next" :<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgogpqIGtAp7Hh0b3TQQBGuL1n0yEpm13tgRXfQSlIq-znc6nlhIp1E298rStcQwKVo7rEFXly4NokMrWayYWL5vDmKyu5rdR6UOe4rYGH0GolCt70-9ItgDhg7MMo4Xe1AkSTGAPDHtWAC/s1600/userparam.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgogpqIGtAp7Hh0b3TQQBGuL1n0yEpm13tgRXfQSlIq-znc6nlhIp1E298rStcQwKVo7rEFXly4NokMrWayYWL5vDmKyu5rdR6UOe4rYGH0GolCt70-9ItgDhg7MMo4Xe1AkSTGAPDHtWAC/s1600/userparam.png" height="452" width="640" /></a></div>
<br />
Fill "Host" as your Hosting server address, Database credentials etc. then click "Next" for the final deployment:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBxebFvQTRjvvlZjmWkF8w1czUd2z0loiTJZ5xRdzKUHXv2rKr7cbJ-o081VNxzDqW0gSIBg2jEb3w_Ox4Fzeu-7yLZQYfAwi7J_zgY4r3g1u7z_ASg1_rFoVs5VZ2RavptST5K8n-MLkH/s1600/final-deploy.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBxebFvQTRjvvlZjmWkF8w1czUd2z0loiTJZ5xRdzKUHXv2rKr7cbJ-o081VNxzDqW0gSIBg2jEb3w_Ox4Fzeu-7yLZQYfAwi7J_zgY4r3g1u7z_ASg1_rFoVs5VZ2RavptST5K8n-MLkH/s1600/final-deploy.png" height="452" width="640" /></a></div>
Click on Deploy, you will see the updated screen with your deploy name in "Name" column.<br />
<br />
Now open the host URL of your site in your browser, your will see that your site is working.<br />
<br />
Its Easy and simple :)<br />
<br />
<i>Here, now question is where is your virtual hosting occur at server level?</i><br />
<br />
Virtual-host is setup at zend-server installation via creating a new .conf file at "/usr/local/zend/etc/site.d/" location and your application content stored at "/usr/local/zend/var/apps/http/" location.<br />
<br />
Cool...<br />
<br />
I hope above content would be helpful for the deploy process.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-84823642938681581712014-06-26T03:57:00.000-07:002014-06-26T04:36:41.166-07:00Creating an Application Package(.ZPK) for Deployment on Zend Server<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: inherit;">Hi,</span><br />
<span style="font-family: inherit;"><br /></span>
This article is aimed to help you better understand how to better deal
with deployments in your development workflow and provide some best
practices for deployments. Sometimes a bad production deployment can
ruin all the effort you invested in a development process. Having a
solid deployment workflow can become one of the greatest advantages of
your team.<br />
<br />
So what actually is deployment means ? <br />
<br />
<div style="text-align: justify;">
<i>Deploying</i> an application is the process of copying, configuring and
enabling a specific application to a specific base URL on <span class="PrimaryZS_generic">Zend Server</span> or on a cluster. Once the deployment process has finished, the application becomes
publicly accessible on the base URL. The server carries out this two step
process by first staging the application, and then activating it after
successful staging.</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgac0ChHiiGCZLVR7i-dnmQylNtyR9Ifa8fGY1dVAdPUIeWQ63qc7QfSbCmYye5jaln1er2bhlmucjVyYmOOXfnsl-VW-_f6pXoO59tn7Uzx8asKTTs-FFNb3pEfCYaPyDxEpPPQtCr-IIm/s1600/deploy-flowchart-01.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgac0ChHiiGCZLVR7i-dnmQylNtyR9Ifa8fGY1dVAdPUIeWQ63qc7QfSbCmYye5jaln1er2bhlmucjVyYmOOXfnsl-VW-_f6pXoO59tn7Uzx8asKTTs-FFNb3pEfCYaPyDxEpPPQtCr-IIm/s1600/deploy-flowchart-01.png" height="99" width="640" /></a></div>
<br />
The deployment mechanism in Zend Server uses a ZPK file, which contains the source code, assets and the deployment descriptor.<br />
<br />
<span style="font-family: inherit;">Application Package(.zpk) file for the deployment on Zend Server can be created via a Zend-Studio GUI OR Linux console.Both are ease to implement.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Via Zend-Studio IDE: This is for GUI lover :)</span><br />
<span style="font-family: inherit;"><br /></span>
<b><i><span style="font-family: inherit;">Step 1: </span></i></b><br />
<span style="font-family: inherit;">From Zend IDE, select your application for which you want to create the zpk file.</span><br />
<span style="font-family: inherit;"><br /></span><i><b>
<span style="font-family: inherit;">Step 2: </span></b></i><br />
<span style="font-family: inherit;">Right click on the application, then </span><span style="font-family: inherit;">selecting “Add Application Deployment Support”</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjslKuWmZVHM1f5hBSzxplYiSTacCD-iVKNGcWvwjZRK_af3-RVqtCU0yX7rK4-01r-VDZqH7Mj7n8Vd9igifFmKsJrnW-USRvYWBGQwxkc0D3Vu44rUbeSfwx8klEkWyLb0KAJmJULxikP/s1600/add-deployment-support.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjslKuWmZVHM1f5hBSzxplYiSTacCD-iVKNGcWvwjZRK_af3-RVqtCU0yX7rK4-01r-VDZqH7Mj7n8Vd9igifFmKsJrnW-USRvYWBGQwxkc0D3Vu44rUbeSfwx8klEkWyLb0KAJmJULxikP/s1600/add-deployment-support.gif" height="178" width="640" /></a></div>
<span style="font-family: inherit;"> </span><br />
<span style="font-family: inherit;">It will create deployment.xml file in your aplication and opens it on your IDE.</span><br />
<br />
<i><b><span style="font-family: inherit;">Step 3: </span></b></i><br />
<span style="font-family: inherit;">Screen that you will get on your IDE is: </span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvHabxAS7NpGD7Yl1sFkniqrqh5eaOysJyClYuK9Nr751ll1P41e0iC25UfQ4D4k3sUm54BJpsNbbP-cRQKusWQoxyVikfdwObUz4sPwHBfPmdPfj6rDfunGM3yuynvxg4g3vR2fpQePFm/s1600/deployment-overview.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvHabxAS7NpGD7Yl1sFkniqrqh5eaOysJyClYuK9Nr751ll1P41e0iC25UfQ4D4k3sUm54BJpsNbbP-cRQKusWQoxyVikfdwObUz4sPwHBfPmdPfj6rDfunGM3yuynvxg4g3vR2fpQePFm/s1600/deployment-overview.gif" height="432" width="640" /></a></div>
<br />
<br />
<div style="text-align: justify;">
Most of the fields are self explanatory but a few might require a few words.</div>
<ul>
<li style="text-align: justify;">Document Root – This is the document root which is relative to
the base directory of the deployment. </li>
<li style="text-align: justify;">License – This is the relative path to a text file in the project
directory structure that contains the EULA for the project. During the
deployment work-flow in the UI the end user will be presented with this
if the file is available and will be required to agree to it before
proceeding.</li>
<li style="text-align: justify;">Persistent Resources – These are items that you don’t want to have
overwritten during an upgrade. For example, cache directories.</li>
</ul>
<br />
<h2>
<span style="font-size: small;"><i>Dependencies</i></span></h2>
<div>
There are several different types of dependencies you can specify for your application.</div>
<div>
</div>
<div>
<img alt="" class="alignnone size-full wp-image-1424" src="http://www.eschrade.com/wp-content/uploads/2011/11/dependency-types.gif" height="382" title="dependency-types" width="389" /></div>
<div>
</div>
<div>
These dependencies will be checked prior to deploying the
application. If they are not satisfied then the application will not
deploy. </div>
<div>
<br />
<h2>
<span style="font-size: small;"><i>Triggers</i></span></h2>
<div style="text-align: justify;">
There are several triggers that can be hooked into during the deployment process, each of which has a Pre and Post stage</div>
<ul>
<li>Activate</li>
<li>Deactivate</li>
<li>Stage</li>
<li>Unstage</li>
</ul>
<div style="text-align: justify;">
To set up a trigger simply double click on the stage that you would
like to edit and a new file will be created for you. In that file will
be documentation on information on how to retrieve variables and
parameters for your deployment scripts.</div>
<div>
</div>
<div>
<img alt="" class="alignnone size-full wp-image-1425" src="http://www.eschrade.com/wp-content/uploads/2011/11/deployment-triggers.gif" height="455" title="deployment-triggers" width="365" /></div>
<div style="text-align: justify;">
Speaking of variables and parameters, what is the difference? There are two differences.</div>
<ol style="text-align: justify;">
<li>Variables you cannot change during the deployment process. What the
value is in the deployment file is the value that you will get in the
deployment script. Parameters need to be specified during the
deployment work-flow and also have some validation that you can do on the
entered values whereas with variables you do not. </li>
<li>Both are accessible via getenv() during deployment but variables are
retrieved with their names “as is” but parameters are upper cased and
prepended with “ZS_”. So if you have a parameter named “ugly_Duckling”
it would be accessed via getenv(‘ZS_UGLY_DUCKLING’)</li>
</ol>
</div>
<h2>
<span style="font-size: small;"><i>Package</i></span></h2>
<div style="text-align: justify;">
There may be files in your application that you want to include or exclude. You can specify those in the Package panel.</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
<img alt="" class="alignnone size-full wp-image-1439" src="http://www.eschrade.com/wp-content/uploads/2011/11/deployment-package-panel.gif" height="207" title="deployment-package-panel" width="561" /><span style="font-size: small;"><i> </i></span></div>
<div>
</div>
<div>
<b><span style="font-size: small;"><i>Exporting</i></span></b></div>
<div style="text-align: justify;">
The last step is to export your project. Right click on the project
and select Export and choose “Deployment Package”. This will output the
project into a ZPK file that you can then upload to your Zend Server
instance or Zend Application Fabric installation where it will be
deployed to your website. </div>
<br />
<br />
<a href="http://www.eschrade.com/wp-content/uploads/2011/11/deployment-export.gif"></a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUkaSYmzPVa_eQGz3G35npGAWjiq6akC1nzPZ1kkApXGWgTf0Kcq6S1iltoK4KHOAF63nWLSKMweQTwaabjnCvwHRTk5g7SvUIl1POTlgHt3r8wSi7nX2BCn80KQY2AbIS_Mgb86MPmfyQ/s1600/export.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUkaSYmzPVa_eQGz3G35npGAWjiq6akC1nzPZ1kkApXGWgTf0Kcq6S1iltoK4KHOAF63nWLSKMweQTwaabjnCvwHRTk5g7SvUIl1POTlgHt3r8wSi7nX2BCn80KQY2AbIS_Mgb86MPmfyQ/s1600/export.jpeg" height="400" width="397" /></a></div>
<br />
<br />
<span style="font-family: inherit;">=================================================</span><br />
<div style="text-align: justify;">
<span style="font-family: inherit;"> <b><u>Via Linux Console</u> </b><b>:</b> This is for Command line lovers :) </span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">================================================= </span></div>
<br />
<span style="font-family: inherit;">Here, i am using Zend's Deployment Tool that allows you to create a skeleton package, and pack the contents into a .zpk package.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Tool location - The tool is located in:</span><br />
<ul style="text-align: left;">
<li><span style="font-family: inherit;">Linux - '/usr/local/zend/bin/zdpack'</span></li>
<li><span style="font-family: inherit;">Windows - 'C:Program Files\Zend\ZendServer\bin\zdpack' <span style="font-weight: bold;"><b>-OR-</b></span> as a </span></li>
<li><span style="font-family: inherit;">standalone (if downloaded separately from the product).</span></li>
</ul>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><i><b>Usage</b></i> - Run the help command (Linux: '<span style="font-style: italic;"></span><span style="font-style: italic;"><i><span style="font-style: italic;"><i><</i></span>install_dir</i></span><span style="font-style: italic;"><i><span style="font-style: italic;"><i>></i></span>/bin/zdpack --help</i></span>'; Windows: '<span style="font-style: italic;"><i>zdpack.exe --help</i></span>') from the bin directory to see the usage.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">The command line actions are:</span><br />
<div style="font-weight: normal;">
<span style="font-family: inherit;"><i><b>Step 1</b></i>: </span></div>
<div style="font-weight: normal;">
<span style="font-family: inherit;">Select a directory and use the create command (Linux: '<span style="font-style: italic;"><i><install_dir>/bin/zdpack create <application-name></i></span>'; Windows: <span style="font-style: italic;"><i>zdpack.exe create</i></span> <span style="font-style: italic;"><i><application-name></i></span>' </span></div>
<div style="font-weight: normal;">
<span style="font-family: inherit;">where <span style="font-style: italic;"><i><application-name></application-name></i></span>
is your application's name) to create the skeleton of your .zpk
package. This includes the XML descriptor file, the data folder and the
hook scripts (templates).</span></div>
<span style="font-family: inherit;">Go to the directory to see the resources that have been created:</span><br />
<ul style="text-align: left;">
<li><span style="font-family: inherit;">Data folder - The folder that will contain your application files.</span></li>
</ul>
<ul style="text-align: left;">
<li style="text-align: justify;"><span style="font-family: inherit;">Scripts folder - The hook script
skeletons available for you to edit as needed. </span></li>
</ul>
<ul style="text-align: left;">
<li style="text-align: justify;"><span style="font-family: inherit;">deployment.xml file - The template of the XML descriptor for you to edit as needed. </span></li>
</ul>
<br />
<span style="font-family: inherit;"><i><b>Step 2</b></i>:</span><br />
<span style="font-family: inherit;">Perform the following actions:</span><span style="font-family: inherit;"> </span><br />
<ul style="text-align: left;">
<li><span style="font-family: inherit;">Place your application files in the data folder.</span><span style="font-family: inherit;"> </span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: inherit;">Edit the hook scripts according to your needs.</span><span style="font-family: inherit;"> </span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: inherit;">Edit the XML file as needed. The XML template is made up of example
elements. </span> </li>
</ul>
<ul style="text-align: left;">
<li>Validate the package by using the validate command (Linux: '<<span style="font-style: italic;"><i>install_dir>/bin/zdpack validate [--schema=<xsd-file>] <package-xml-descriptor-file>';</i></span> Windows: 'zdpack.exe validate [--schema=<xsd-file>] <package-xml-descriptor-file>').<b> </b></li>
</ul>
<br />
<i><b>For example:<span style="font-family: inherit;"> </span></b></i><br />
<span style="font-family: inherit;"><span style="font-style: italic;"><i># </i>/usr/local/zend/bin/zdpack validate --schema="/usr/local/zend/share/deployment.xsd" deployment.xml</span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-style: italic;"><i></i></span></span><br />
<span style="font-family: inherit;"><span style="color: red;"><i><b>NOTE</b></i></span>: For ZF2 application zpk file creation, I edit the deployement.xml file for the document root settings i.e.</span><br />
<i><span style="font-family: inherit;"><docroot>data</docroot> </span></i><br />
<span style="font-family: inherit;">TO </span><br />
<i><span style="font-family: inherit;"><docroot>data/public</docroot></span></i><br />
<br />
<span style="font-family: inherit;"><i><b>Step 3</b></i>:</span><br />
<span style="font-family: inherit;">Use the pack command (Linux: '<<span style="font-style: italic;"><i>install_dir>/bin/zdpack pack <application-name></i></span>'; Windows: '<span style="font-style: italic;"><i>zdpack.exe pack <application-name>'</i></span>) to pack the contents into a .zpk package. By default, the Deployment Tool will create the package in the working directory. </span><br />
<i><b><span style="font-family: inherit;">For Example:</span></b></i><br />
<span style="font-family: inherit;"># /usr/local/zend/bin/zdpack pack my_application_dir</span><br />
<span style="font-family: inherit;"><br /></span>
<br />
Once you have a .zpk application package ready and packed, you can deploy your application OR update an existing application.<br />
<br />
<br />
-- <br />
Bye Buddy</div>
</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com4tag:blogger.com,1999:blog-423847123796963182.post-29984533239185195822014-06-23T06:45:00.001-07:002014-06-24T22:25:25.280-07:00OOP : When to prefer an Abstract Class and Interface<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: inherit;"><span style="font-size: small;">Hi,</span></span></div>
<div style="text-align: left;">
<span style="font-family: inherit;"><span style="font-size: small;"><br /></span></span></div>
<div style="text-align: left;">
<span style="font-family: inherit;"><span style="font-size: small;"></span></span></div>
<div style="text-align: justify;">
Abstract classes allow you to provide default functionality for the subclasses.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
</div>
<b><i>Why is this extremely important though?</i></b><br />
<div style="text-align: justify;">
If you plan on updating this base class throughout the life of your program, it is best to allow that base class to be an abstract class.</div>
<br />
<i><b>Why? </b></i><br />
<div style="text-align: justify;">
Because you can make a change to it and all of the inheriting classes will now have this new functionality.</div>
<br />
<div style="text-align: justify;">
If the base class keep on changing and an interface was used instead of an abstract class, we are going to run into problems. Once an interface is changed, any class that implements that will be broken. Now if it's just you working on the project, that’s no big deal. However, once your interface is published to the client, that interface needs to be locked down. At that point, you will be breaking the clients code.</div>
<br />
<div style="text-align: justify;">
As per my personal experiences, frameworks is a good place to show when and where to use both an abstract class and an interface.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Another general rule is if you are creating something that provides common functionality to unrelated classes, use an interface. If you are creating something for objects that are closely related in a hierarchy, use an abstract class.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
An Example of this would be something like a business rules engine. This engine would take in multiple BusinessRules as classes perhaps? Each one of these classes will have an analyze function on it.</div>
<br />
public interface BusinessRule{<br />
Boolean analyze(Object o);<br />
}<br />
<br />
<div style="text-align: justify;">
This can be used <b>ANYWHERE</b>. It can be used to verify the state of your application. Verify data is correct. Verify that the user is logged in. Each one of these classes just needs to implement the analyze function, which will be different for each rule.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Where as if we were creating a generic List object, the use of abstract classes would be better. Every single List object is going to display the data in a list in some form or another. The base functionality would be to have it go through its data provider and build that list. If we want to change that List object, we just extend it, override our build list function, change what we want and call super.buildList();</div>
<br />
<div style="text-align: justify;">
<i><b>In Brief:</b></i> interfaces means you are just defining a list of functions and that abstract classes has the option of providing default functionality.</div>
</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-51676413443671265152014-05-27T05:51:00.001-07:002014-05-27T05:51:46.943-07:00WebSite Page Locking<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Everybody,<br />
<br />
Today, Again i shared my next module "Page-Lock" in Zend-Framework 2.<br />
<br />
Basically page locking is important when you want your site should be more secure in terms of transactions and updation happening across the site.<br />
<br />
<br />
This module contain the following feature:<br />
1. If one user open let's say the home page, then the same user can not open it on the other browser.<br />
<br />
2. If your application handling the login mechanism then this module also handle the locking on logged-in user accordingly.<br />
<br />
3. It has the feature where you can set the time period of locking. Its adjustable from flat file.<br />
<br />
4. It's lightweight, simple and shower.<br />
<br />
<br />
You can download the page-lock module from the Zend-Framework 2 module sites i.e.<br />
<br />
URL : <a href="https://github.com/tarun-singhal/page-lock">https://github.com/tarun-singhal/page-lock</a><br />
<br />
Here, you can find the installation process i.e. how to implement it in your application.<br />
<br />
<br />
I will be more thankful to you, if i got some feedback from your side :)<br />
<br />
<br />
<br />
<br />
<br />
Bye...<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-88048447893764603372014-05-22T06:48:00.000-07:002014-05-22T06:48:14.549-07:00Zend Framework 2: JobQueue Module<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Today i share my first module "JobQueue" on Zend-Framework 2 module site :)<br />
<br />
URL : <a href="http://modules.zendframework.com/">http://modules.zendframework.com/</a><br />
<br />
JobQueue is a Feature of the Zend-Server and i use this feature in Zend-Framework2.<br />
<br />
JobQueue Module is basically use to handle heavy background process. It helps to increase the Web App performance. JobQueue service can be used for the following scenarios :
<br />
<ol>
<li>Preparing data for the next request (pre-calculating)</li>
<li>Pre-caching data</li>
<li>Generating periodical reports </li>
<li>Sending e-mails </li>
<li>Cleaning temporary data or files </li>
<li>Communicating with external systems.<br /><br />Job Queue module is useful with Zend Server 5 (though not as part of the Community Edition).</li>
</ol>
You can download the JobQueue Module from Git-hub i.e<br />
URL : <a href="https://github.com/tarun-singhal/JobQueue">https://github.com/tarun-singhal/JobQueue</a><br />
<br />
<b>NOTE:</b> Please make sure your zend-server service should be running.<br />
<br />
Below screen-shot that shows, once you run the module in your application then you can view your application job status send via JobQueue module on zend-server.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh35t-9u59YDFzzASiXmyUtZwND_XGj3T74jqhNpeYl7bBg6s73fr4kD7K0VQFm9m4lLdVJNzMYQhexh5XnKymkZSKFjmjQOm5A0OoW4ZtwwQMmPFbzK-oF-JBxiE6V1eiPjPDa3lsX5gq6/s1600/Firefox_Screenshot_2014-05-22T13-41-21.727Z.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh35t-9u59YDFzzASiXmyUtZwND_XGj3T74jqhNpeYl7bBg6s73fr4kD7K0VQFm9m4lLdVJNzMYQhexh5XnKymkZSKFjmjQOm5A0OoW4ZtwwQMmPFbzK-oF-JBxiE6V1eiPjPDa3lsX5gq6/s1600/Firefox_Screenshot_2014-05-22T13-41-21.727Z.png" height="403" width="640" /></a></div>
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-29723054864168811322014-03-26T06:27:00.001-07:002014-11-18T06:17:36.145-08:00GIT Tag<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Create GIT Tag on your project is useful to keep track of your project release.<br />
<br />
Step to create the Tag in GIT are:<br />
<br />
1. # git tag -a V2 -m "tag 2"<br />
<br />
2. # git push origin V2<br />
<br />
Where, V2 : relate the tag name<br />
<br />
If you want to switch into previous tag<br />
<br />
# git checkout tag-name<br />
<br />
where tag-name, is the tag no where you want switch back/fro to the release.<br />
<br />
<br />
<b>To get list GIT tag</b><br />
# git tag<br />
<br />
<br />
<b>To cloning the branch or tag</b><br />
# git clone --branch tag_name repo_url<br />
<br />
Where,<br />
tag_name : GIT tag no.<br />
repo_url : GIT URL<br />
<br />
<br />
<b>To get the checkout from the Tag</b><br />
# git checkout tags/tag-name<br />
<br />
I hope above GIT tag command is useful to manage tag.<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-84910599324314164622014-02-27T01:46:00.001-08:002014-09-29T01:16:41.286-07:00Linux : Replace string in multiple files recursively<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
If you want to search and replace specific string from multiple file recursively then below command is useful for it :<br />
<br />
Linux Command:<br />
<i># grep -rl "string1" * -R | xargs sed -i 's/string1/string2/g'</i><br />
<br />
<br />
<i>Here above command is combination of 'grep' and 'sed', </i><br />
<b>grep </b>:<b> </b>Command will search for "string1" and returns file-name where string1 found<br />
<br />
<b>sed </b>: will replace the "string1" to "string2"<br />
<br />
<b>string1</b> : old string<br />
<b>string2 </b>: New string<br />
<br />
You can watch the above process on youtube also...<br />
<br />
<a href="https://www.youtube.com/watch?v=GcopukZz3io" target="_blank">http://youtu.be/GcopukZz3io </a></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com5tag:blogger.com,1999:blog-423847123796963182.post-50923183461642662762014-02-21T02:31:00.001-08:002014-02-24T22:07:59.185-08:00Hide User Names on the Login Screen in Ubuntu <div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
This is for to clean the login screen i.e. multiple users listing should not show on login screen.<br />
<br />
It can be accomplish with some changes in LightDM desktop manager configuration.<br />
<br />
It brings the new layer of security that any intruder should use right user account to login into your machine.<br />
<br />
Steps to make changes it in LightDM desktop manager. <br />
<br />
<b>Step 1:</b> Open lightdm.conf file i.e.<br />
<i># vi /etc/lightdm/lightdm.conf</i><br />
<br />
<b>Step 2:</b> Add below 2 lines in the lightdm.conf file<br />
<br />
<i>greeter-hide-users=true</i><br />
<i>
</i><i>
</i><i>allow-guest=false</i><br />
<br />
<b>Step 3:</b> Above line will hide the user listing on login screen.<br />
<br />
I hope above steps will helpful to enable the clear Login screen.<br />
<br />
<br />
<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-79472309910585468842014-02-21T02:19:00.000-08:002014-02-21T03:08:05.270-08:00Ubuntu 12.04 Grub to boot into single user mode<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Steps to boot in single user mode in Ubuntu 12.04:<br />
<br />
<b>Step 1:</b> When you start your system, press "shift" key continuously to get the grub loader screen.<br />
<br />
<b>Step 2:</b> In Grub 2 menu, select the menu with Linux 3.2.0.23-generic-pae highlighted.<br />
<br />
<b>Step3:</b> Press 'e' to edit the grub2 menu.<br />
<br />
<b>Step 4:</b> Move the cursor to the line that starts with "linux /boot/vmlinuz-3.2.0-23-generice-pae".<br />
<br />
<b>Step 5:</b> Change the content "ro quiet spalsh $vt_handoff" To "rw init=/bin/bash".<br />
<br />
<b>Step 6:</b> Press "Ctrl+x" to continue boot to in single user mode.<br />
<br />
<b>Step 7:</b> Now you will get prompt of the root user.<br />
<br />
<b>Step 8:</b> Change root user password,<br />
<i># passwd root</i><br />
<br />
<b>Step 9:</b> Now sync and reboot the system i.e.<br />
<i># sync</i><br />
<i># reboot -f</i><br />
<br />
I hope, above steps are helpful to change the root user password in single user mode.</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com4tag:blogger.com,1999:blog-423847123796963182.post-66678261554931225822013-12-09T06:24:00.001-08:002013-12-09T06:24:16.723-08:00Jquery : Useful Selectors<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial,Helvetica,sans-serif;">Hi,</span><br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif;">Jquery Useful Selectors are: </span><br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif;">1. How to set checked attribute in CheckBox.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><code> </code></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">$("."+cssClass).attr('checked', True);</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"></span></div>
<br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif;">2. How to select element on the basis of disable attribute:</span><br />
<br />
<span style="font-family: inherit;">$("."+cssClass+":not[disabled]").attr('checked', true);</span><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-family: inherit;">Note: Above selector solution will be increased ASAP. </span></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-24795059422125803402013-12-09T06:20:00.001-08:002014-02-21T03:14:26.668-08:00ZF2 : Custom config file inside module(s)<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
ZF2 has the feature to create custom config file inside module(s).<br />
<br />
Its provide help to declared variable those will used inside the particular module.<br />
<br />
It is independent of main ZF2 config file.<br />
<br />
Below are step to create/Use the custom config file inside the module:<br />
<br />
<b>Step 1:</b> Create Module as Report<br />
<br />
<b>Step 2:</b> Create custom config file in module's config directory i.e. module.customconfig.php, <br />
<br />
<b>Step 3:</b> Sample content inside module.customconfig.php<br />
<br />
return array(<br />
'report' => array(<br />
'header' => array(<br />
'name' => 'Name' <br />
) <br />
), <br />
);<br />
<br />
<br />
<b>Step 4:</b> In controller of Report Module, Ex: ReportController.php<br />
<br />
<i>In Action: </i><br />
<br />
$config = $this->getServiceLocator ()->get ( 'config' );<br />
//Take custom-config data from config file<br />
$data = $config['report'];<br />
print_r($data);<br />
<br />
<br />
<br />
<br /></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-66859329056783254902013-11-12T23:46:00.000-08:002015-04-14T03:48:50.133-07:00Zend Framework 2 Sql Expression<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
To perform the sql function inside sql query in ZF2 like:<br />
<br />
<span style="color: orange; font-size: large;"><b>Type 1:</b></span><br />
Query: <br />
<pre nbsp="" style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsgKiBV_Ok5Rjd_ldD3UQm-ksAmcORgBhx70mEfnpKAJIi2RmYgLpxNRtd91mnRwJk9YiOlfAHPn4OsCENvo4j4ffQh8Yqt0Kq9EYdLBRfu1wTTMga4Csy8wOXSj-hpeeBD4xXjr77PUro/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> "select count(*) from foo group by name" </code></pre>
<br />
<pre><code><b><u>ZF2:</u></b> </code></pre>
<pre nbsp="" style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsgKiBV_Ok5Rjd_ldD3UQm-ksAmcORgBhx70mEfnpKAJIi2RmYgLpxNRtd91mnRwJk9YiOlfAHPn4OsCENvo4j4ffQh8Yqt0Kq9EYdLBRfu1wTTMga4Csy8wOXSj-hpeeBD4xXjr77PUro/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $sql = new Sql($adaptor);
$select = $sql->select()->from(array('f' => 'foo'));
$select = $select->columns(array('count' => new \Zend\Db\Sql\Expression("count(*)")));
$select = $select->group(array('name'));
$statement = $sql->prepareStatementForSqlObject($select);
echo $statement->getSql(); </code></pre>
<br />
<br />
<span style="color: orange; font-size: large;"><b>Type 2:</b></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"></span></span><br />
<pre nbsp="" style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsgKiBV_Ok5Rjd_ldD3UQm-ksAmcORgBhx70mEfnpKAJIi2RmYgLpxNRtd91mnRwJk9YiOlfAHPn4OsCENvo4j4ffQh8Yqt0Kq9EYdLBRfu1wTTMga4Csy8wOXSj-hpeeBD4xXjr77PUro/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><code style="color: black; word-wrap: normal;"> Query = "Select * from foo where foo_name = lower('test')"; </code></span></span></pre>
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">
</span></span><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"></span></span></div>
<div style="text-align: left;">
<pre><code><b><u>ZF2:</u></b></code></pre>
</div>
<pre nbsp="" style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsgKiBV_Ok5Rjd_ldD3UQm-ksAmcORgBhx70mEfnpKAJIi2RmYgLpxNRtd91mnRwJk9YiOlfAHPn4OsCENvo4j4ffQh8Yqt0Kq9EYdLBRfu1wTTMga4Csy8wOXSj-hpeeBD4xXjr77PUro/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $sql = new SQL($adaptor);
$select = $sql->select()->from(array('f'=>'foo'));
$select = $select->where('foo_name' => new \Zend\Db\Sql\Expression("LOWER('test')"));
$statement = $sql->prepareStatementForSqlObject($select);
echo $statement->getSql(); </code></pre>
<br />
<span style="font-size: large;"><b><span style="color: orange;">Type 3:</span> </b></span><br />
<span style="font-size: large;"><b>Manage sub-query inside query:</b></span><br />
<br />
<b>Query: </b><br />
<pre class="lang-php prettyprint prettyprinted"><code><span class="pln"><pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsgKiBV_Ok5Rjd_ldD3UQm-ksAmcORgBhx70mEfnpKAJIi2RmYgLpxNRtd91mnRwJk9YiOlfAHPn4OsCENvo4j4ffQh8Yqt0Kq9EYdLBRfu1wTTMga4Csy8wOXSj-hpeeBD4xXjr77PUro/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> SELECT `comment`.`id` AS `commentId`, `comment`.`comment` AS `comment`,
(SELECT COUNT(`comment_vote`.`id`) AS `negativeVote`
FROM `comment_vote`
WHERE vote = -1
AND `comment_vote`.`commentId` = `comment`.`id`) AS `nagetiveVoteCount`
FROM `comment` </code></pre>
</span><span class="str"></span></code></pre>
<pre class="lang-php prettyprint prettyprinted"><code><span class="str"></span></code></pre>
<pre class="lang-php prettyprint prettyprinted"><b><code><span class="str">ZF2:</span></code></b></pre>
<pre class="lang-php prettyprint prettyprinted"><code><span class="str"><code><span class="pln"><pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsgKiBV_Ok5Rjd_ldD3UQm-ksAmcORgBhx70mEfnpKAJIi2RmYgLpxNRtd91mnRwJk9YiOlfAHPn4OsCENvo4j4ffQh8Yqt0Kq9EYdLBRfu1wTTMga4Csy8wOXSj-hpeeBD4xXjr77PUro/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $sub = new Select('comment_vote');
$sub->columns(array('negativeVote' => new \Zend\Db\Sql\Expression('COUNT(comment_vote.id)')), FALSE)->where(array('vote' => -1 , 'comment_vote.commentId' => 'comment.id'));
$subquery = new \Zend\Db\Sql\Expression("({$sub->getSqlString()})");
$predicate = new \Zend\Db\Sql\Predicate\Expression("({$sub->getSqlString()})");
$sql = new Sql($this->adapter);
$select = $sql->select()->from('comment');
$select->columns(array('commentId','comment', 'nagetiveVoteCount' => $subquery));
echo $select->getSqlString(); </code></pre>
</span></code></span></code></pre>
<span style="font-size: large;"><b><span style="color: orange;">Type 4:</span> </b></span><br />
<h2 class="lang-php prettyprint prettyprinted" style="text-align: left;">
<b><code><span class="str"><code><span class="pln">Union of Sql Query:</span></code></span></code></b></h2>
<div class="lang-php prettyprint prettyprinted" style="text-align: left;">
<code><span class="str"><code><span class="pln"><b>Query:</b> </span></code></span></code></div>
<div>
select 'passport' as type,a.user_id from join_user_passport_office as a where a.user_id=7</div>
<div>
union</div>
<div>
select 'embassy' as type,b.user_id from join_user_embassy_office as b where b.user_id=7</div>
<div>
union </div>
<div>
select 'visa' as type,c.user_id from join_user_visa_office as c where c.user_id=7</div>
<div>
union </div>
<div>
select 'ecowas' as type,d.user_id from join_user_ecowas_office as d where d.user_id=7</div>
<div>
union </div>
<div>
select 'freezone' as type,e.user_id from join_user_freezone_office as e where e.user_id=7 ;</div>
<div>
</div>
<div>
ZF2:</div>
<div>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"> $select1 = $this->_sql->select()
->from(array('t1' => 'join_user_embassy_office'))
->columns(array('type' => new \Zend\Db\Sql\Expression("'embassy'"), 'user_id' => 'user_id'))
->where(array('t1.user_id' => $id));
$select2 = $this->_sql->select()
->from(array('t2' => 'join_user_passport_office'))
->columns(array('type' => new \Zend\Db\Sql\Expression("'passport'") ,'user_id' => 'user_id'))
->where(array('t2.user_id' => $id));
$select1->combine($select2);
$select3 = $this->_sql->select()
->from(array('t3' => 'join_user_visa_office'))
->columns(array('type' => new \Zend\Db\Sql\Expression("'visa'") , 'user_id' => 'user_id'))
->where(array('t3.user_id' => $id));
$selectall3 = $this->_sql->select();
$selectall3->from(array('sel1and2' => $select1));
$selectall3->combine($select3);</pre>
</div>
<br /> </div>
<pre class="lang-php prettyprint prettyprinted"><code><span class="str"> </span></code></pre>
</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com6tag:blogger.com,1999:blog-423847123796963182.post-12561594782193555282013-11-10T20:03:00.000-08:002013-11-10T20:03:21.667-08:00Jquery Plugin : FlexBox<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Flexbox is a jQuery
plugin that is intended to be a very flexible replacement for html
textboxes and dropdowns, optionally using ajax to retrieve and bind JSON
data.<br />
<br />
It's a nice library to load the html dropdown or textbox with paging functionality and many other settings.<br />
<br />
Look and feel for the textbox/dropdown html elements also lightweight.<br />
<br />
Reference URL:<br />
http://flexbox.codeplex.com/<br />
http://fairwaytech.com/flexbox/flexbox-demos/</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-14918409769465359732013-10-17T02:56:00.000-07:002015-12-16T01:50:35.534-08:00GIT : Basic Command<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 style="text-align: left;">
<span style="font-size: large;"><b>1. How to color the Git console in Ubuntu?</b></span></h4>
<i># git config --global color.ui auto</i><br />
<br />
The color.ui is a meta configuration that includes all the various color.* configurations available with git commands. This is explained in-depth in git help config.<br />
<br />
<br />
color.ui: This variable determines the default value for variables such as color.diff and color.grep that control the use of color per command family. Its scope will expand as more commands learn configuration to set a default for the --color option. Set it to always if you want all output not intended for machine consumption to use color, to true or auto if you want such output to use color when written to the terminal, or to false or never if you prefer git commands not to use color unless enabled explicitly with some other configuration or the --color option.<br />
<br />
<br />
<span style="font-size: large;"><b>2. How to keep password in memory?</b></span><br />
<i># git config --global credential.helper cache</i><br />
which tells git to keep your password cached in memory for (by default) 15 mins<br />
<i># git config --global credential.helper "cache --timeout=3600"</i><br />
which tells git to keep your password cached in memory for 3600 seconds<br />
<br />
<span style="font-size: large;"><b>3. Get diff in file</b></span><br />
<i># git diff <file name=""></file></i><br />
will return the file differences<br />
<br />
<span style="font-size: large;"><b>4. How to resolving file conflicting after Git Pull?</b></span><br />
Step 1> Identify which files are in conflict (Git should tell you this)<br />
Step 2> Open each file and examine the diffs; Git demarcates them. Hopefully it will be obvious which version of each block to keep. You may need to discuss it with fellow developers who committed the code.<br />
Step 3> Once you've resolved the conflict in a file, then apply below command in console<br />
<i># git add file-name<file-name></file-name></i><br />
Step 4> Then commit the conflict<br />
<i># git commit -m "Conflicts Resolved"</i><br />
<br />
<span style="font-size: large;"><b>5. How to add new file on Git?</b></span><br />
<i># git add <file name=""><br /># git commit -m "new file added"</file></i><br />
<br />
<span style="font-size: large;"><b>6. How to check the file status in your repository?</b></span><br />
<i># git status</i><br />
<br />
<span style="font-size: large;"><b>7. How to push you committed file on the remote server?</b></span><br />
<i># git push origin master</i><br />
<br />
<span style="font-size: large;"><b>8. How to get the Git Update from remote server?</b></span><br />
<i># git pull origin master</i><br />
<br />
<span style="font-size: large;"><b>9. How to increase Git performance?</b></span><br />
<i># git gc</i><br />
will give significant speed on your local repository.<br />
Basically, git-gc : it is for cleanup unnecessary files and optimize the local repository.<br />
<br />
<span style="font-size: large;"><b>10. How to get the Git Log? </b></span><br />
<i># git log</i><br />
<br />
<span style="font-size: large;"><b>11. How to get log on specific file?</b></span><br />
<i># git log "file-name"<file-name></file-name></i><br />
ex:<br />
<i># git log test.txt</i><br />
<br />
<span style="font-size: large;"><b>12. How to get file from Git of specific version? </b></span><br />
<i># git show <commit-no>commit-no:file-name</commit-no></i><br />
<i><commit-no><file-name></file-name></commit-no></i><br />
ex:<br />
<i># git show abcdefghijklmnop:test.txt</i><br />
<br />
<span style="font-size: large;"><b>13. How to know file list from Git of specific version?</b></span><br />
<i># git show commit-no --name-only</i><br />
<br />
ex: <br />
<i># git show 0ba1a6177178f77cd711bfe1db43fac80f70f3e2 --name-only</i><br />
<br />
<span style="font-size: large;"><b>14. How to use GUI visualize for Git log?</b></span><br />
Please install gitk tool in your OS<br />
<i># sudo apt-get install gitk</i><br />
It will install in your OS, after that you are able to view the git log in GUI, where everybody easy to identify the following:<br />
<ul style="text-align: left;">
<li>Commit with the name, and respective committed files</li>
<li>file change in every commit</li>
<li>Text search in committed file</li>
<li>beautiful file comparison</li>
<li>file navigation </li>
</ul>
Run below command to run GUI interface:<br />
<i># gitk</i><br />
<br />
<span style="font-size: large;"><b>15. How to remove file/folder from GIT</b></span><i> </i><br />
if you want to remove file, then<i><br /></i><br />
<i># git rm file-name</i><br />
if you want to remove folder, then<br />
<i># git rm folder-name -r</i><br />
<i><br /></i>
<i># git commit -m "your message"</i><br />
<i>#git push origin master</i><br />
<i><br /></i>
<span style="font-size: large;"><b>16. How to change message after GIT commit</b></span><br />
<i># git commit --amend -m "New commit message"</i><br />
<pre class="lang-sh prettyprint prettyprinted"><code><span class="pln">
</span><span class="str"></span></code></pre>
</div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0tag:blogger.com,1999:blog-423847123796963182.post-72108531243984784212013-10-01T03:57:00.000-07:002013-10-01T03:57:05.332-07:00SVN Error - is Not a working copy<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
I got the issue in SVN while doing additions in the SVN repository.<br />
<br />
I am getting error Like :<br />
<br />
"SVN : 'dir1' is not a working copy.<br />
<br />
After a long struggling, i got the solution, use below command to solve the issue i.e.:<br />
<br />
# mv dir1 dir1_<br />
# svn cleanup<br />
# svn revert dir1<br />
reverted 'dir1'<br />
# mv dir1_ dir<br />
# svn add dir1<br />
<br />
In that way, i am able to get the my problem solve.<br />
<br />
<code> </code></div>
Tarun Kumar Singhalhttp://www.blogger.com/profile/09329529511439197341noreply@blogger.com0