This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include auto-loader class | |
require_once 'Zend/Loader/Autoloader.php'; | |
//register auto-loader | |
$loader = Zend_Loader_Autoloader::getInstance(); | |
//setView | |
$view = new Zend_View(); | |
$view->setEncoding("ISO-8859-1"); | |
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* There may be always a better solution than this . | |
* Problem : Some discussion in ipgofkerala group regarding http://bit.ly/d2ihwR ( Eulers problem http://projecteuler.net/ ) . Many of them came with C#, Clojure, Ruby, Python.. more?? | |
* So I Just made some changes made by Sujeeth Nair in C++ to port to PHP | |
* I don't want PHP to miss this game :P | |
* Catch me at harikt.com | |
* Hari K T | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Define path to application directory | |
defined('APPLICATION_PATH') | |
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/..')); | |
// Define application environment | |
defined('APPLICATION_ENV') | |
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'doctrineCLI')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace the blog and public directory according to the names . | |
Sample which Ryan Mauger http://www.rmauger.co.uk/ helped me on #zf-talk . | |
<Bittarman> open your terminal, and type this, | |
sudo echo "127.0.0.1 blog.local www.blog.local" >> /etc/hosts | |
<Bittarman> then, sudo vim /etc/apache2/sites-available/blog.local | |
<Bittarman> and paste this into it http://pastie.org/1112846 | |
<VirtualHost *:80> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hari@hari-laptop:/var/www$ li3 library extract hellolithium | |
hellolithium created in /var/www from /var/www/lithium/libraries/lithium/console/command/create/template/app.phar.gz | |
hari@hari-laptop:/var/www$ cd hellolithium/ | |
Lets see how it looks ;) | |
hari@hari-laptop:/var/www/hellolithium$ tree | |
. | |
|-- config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Going through the slides of phparch OOP THE PHP 5.3 Way | |
http://www.phparch.com/2010/11/29/codeworks-2010-slides/ | |
A try at the example given by Marco Tabini. Some corrections was needed, just updated it ;) . | |
*/ | |
namespace Blueparabola; | |
class example { | |
public function sayHello() { | |
echo 'I am from ' . __CLASS__ . " . Yes namespace \n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\controllers; | |
use \app\models\Search, | |
\Zend_Search_Lucene; | |
class SearchesController extends \lithium\action\Controller { | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
use \Zend_Search_Lucene, | |
\Zend_Search_Lucene_Document, | |
\Zend_Search_Lucene_Field; | |
class Search extends \lithium\data\Model { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Search for <?= $query; ?> returned <?= count($searches)?> hits <br /> | |
<ul> | |
<?php foreach ($searches as $hit) { ?> | |
<li><?= $this->html->link( $hit->url , $hit->url );?></li> | |
<?php } ?> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
class Comments extends \lithium\data\Model { | |
public $validates = array(); | |
public $belongsTo = array('Posts','Users'); |
OlderNewer