CakePHP in svnlabs

CakePHP in svnlabs
CakePHP in svnlabs

CakePHP is the rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. It follows design patterns like MVC and ORM, CakePHP reduces development costs and helps developers write less code.

Features of CakePHP:
– Extremely Simple.
– Active, Friendly Community.
– Flexible License.
– Clean IP
– Best security, authentication, and session handling.
– Compatible with PHP versions 4 and 5.
– Integrated CRUD for database interaction
– Application scaffolding
– Code generation
– MVC architecture
– Flexible ACL
– Data Sanitization
– Flexible Caching
– Request dispatcher with custom URLs
– Built-in validation.
– Helpers for AJAX, JavaScript, HTML Forms and more
– Email, Cookie, Security, Session, Request Handling etc.
– Localization

CakePHP Console

# ./cake bake all

# ./cake bake model models -app /var/www/cakeproject/app
# ./cake bake controller models -app /var/www/cakeproject/app scaffold admin
# ./cake bake view models -app /var/www/cakeproject/app

Source:
http://cakephptips.blogspot.com/
http://teknoid.wordpress.com/2008/06/09/15-essential-cakephp-tips/

wsdl in php

We can use nusoap and pear library to invoke web service … there are some command line tools to consume services and generate/validate wsdl …..

1. wsdl (call method at CLI)
# wsdl WSDL_URL METHOD

2. soapUI
create wsdl project and use web services

3. wsdl2php
wsdl2php convert service methods as the class like structure
http://www.urdalen.no/wsdl2php/manual.php

4. SoapClient – PHP
$path_wsdl = “wsdl/svnlabs7.wsdl”;
$client = new SoapClient($path_wsdl, array(‘trace’ => 1));
$request = array(‘….. |wsdl request array| ……’);
$response = $client ->getLog($request);

5. nuSOAP
http://sourceforge.net/projects/nusoap/

Resources:
http://wsdlpull.sourceforge.net/
http://code.google.com/p/ezerphp/
http://www.mehtanirav.com/2008/12/26/xplanner-php-soap-client
http://code.google.com/p/wsdl2php-interpreter/
https://www.ohloh.net/p/php-wsdl-viewer
http://php.net/manual/en/book.soap.php
http://phpwebservices.blogspot.com/

midentify – mplayer

midentify – It is the utility come with mplayer to find video ID of video files….

# /usr/bin/midentify video.mp4
ID_VIDEO_ID=0
ID_AUDIO_ID=1
ID_AID_1_LANG=eng
ID_FILENAME=video.mp4
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=320
ID_VIDEO_HEIGHT=240
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=255
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=24000
ID_AUDIO_NCH=2
ID_LENGTH=72.62
ID_SEEKABLE=1
ID_CHAPTERS=0
ID_VIDEO_CODEC=ffh264
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=faad
ID_EXIT=EOF

Try # mediainfo to get video infrmation on linux box  🙂

HTMLDOC – html2image

htmldoc is a powerful simple-to-use tool/utility, which converts HTML to Postscript, PDF or indexed HTML output.

# convert /var/www/html/html2img/grid.ps -crop 280×300+40+9 -modulate 100 -geometry 530×480 /var/www/html/html2img/grid.png

here convert is ImageMagick tool for manipulating images..

TinyMCE load ajax

Today I got problem to load TinyMCE as dynamic loaded textareas by Ajax?

Solution:

<a href=”javascript:void(0)” onclick=”ajaxEdit(); showEditor();”>Edit Content</a>

here ajaxEdit() is ajax function where textarea loaded by ajax as html response.

here we have use showEditor(); to load TinyMCE editor … page loaded by Ajax

<script>

function showEditor()
{

setTimeout(“initEditor(‘newsdesc’)”,4000);

}

tinyMCE.init({………………………
…………………………………………………});

function initEditor(id)
{

tinyMCE.execCommand(‘mceAddControl’, false, id);

}

</script>

tiny

Hindi Text Editor

akIndicPlugin is very useful for Indian language like Hindi, Marathi, Bengoli, Gujarati, Malyalam, Telugu and Punjabi….

1

2

Source:
http://amiworks.co.in/talk/akindicplugin-for-tinymce-and-joomla/
http://www.vishalon.net/IndicResources/IndicIME/tabid/244/Default.aspx

Configure Amazon EC2

1.Boot 2 linux servers on EC2
2.Assign elastic IP to each of them
3.Register a domain (eg svnlabs.com)
4.On the domain settings – create 2 host records – ns1.svnlabs.com and ns2.svnlabs.com and point each record to each of the elastic IPs.
5.On your 2 nameserver instances – create dns zone for ns1. and ns2 respectively
6.Make ns2 a slave of ns1 – you can if you wish add ns3… ns4.. etc etc but its not necessary unless your site is getting millions of users.
7.Boot another EC instance and install the Scalr application.
8.Create a user on ns1. called “named” that has permissions to update the dns zone records on ns1.
9.The DNS settings of the scalr application will refer to the nameservers ns1. with user “named” and password as set on ns1.
10.Your application for example will have the domain svnlabs.com.  Register this domain and set its nameservers to your ns1. and ns2 mentioned previously.
11.You need to first create a new zone file on ns1 for svnlabs.com
12.In Scalr when asked for the application domain name – simply enter svnlabs.com – and scalr will handle the rest.

****************************************************************

You will need to register a domain name with a domain registrar.  After registering, you will need to enter your NS records for the domain name.  The NS records should point to a Domain Name Server (DNS).  Most registrars require at least two DNS servers to eliminate a single point of failure.

Some registrars provide free DNS services.  If you choose such a registrar, you would need to add a CNAME record for your sub-domain and ask any DNS application support related questions to your registrar.

Alternatively, you can launch and configure your own DNS servers on Amazon EC2.  A popular choice for Linux based DNS servers is BIND: http://en.wikipedia.org/wiki/BIND

Another option is to outsource your DNS servers using a third-party provider, for example http://www.dyndns.com/.

http://groups.google.com/group/scalr-discuss/web/how-to-host-your-mx-on-google

Cost: http://bhopu.com/Tags/Amazon-EC2

HTML WYSIWYG Editor for Fedora

http://kdewebdev.org/

Quanta Plus is a web development tool for the K Desktop Environment. Quanta is designed for quick web development and is rapidly becoming a mature editor with a number of great features and lies at the heart of the KDE Web Dev suite of tools.

http://bluefish.openoffice.nl/

Bluefish is a powerful editor targeted towards programmers and webdesigners, with many options to write websites, scripts and programming code. Bluefish supports many programming and markup languages, and it focuses on editing dynamic and interactive websites.