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 | |
require 'vendor/autoload.php'; | |
$resolver = new Illuminate\Database\ConnectionResolver; | |
$resolver->setDefaultConnection('default'); | |
$factory = new Illuminate\Database\Connectors\ConnectionFactory; | |
$connection = $factory->make(array( | |
'host' => 'localhost', | |
'database' => 'database', |
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
{ | |
"require": { | |
"php": ">=5.3.0", | |
"illuminate/database": "dev-master" | |
}, | |
"autoload": { | |
"classmap": [ |
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
$ composer install |
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
/* | |
* -------------------------------------------------------------------- | |
* LOAD THE COMPOSER AUTOLOAD FILE | |
* -------------------------------------------------------------------- | |
*/ | |
require 'vendor/autoload.php'; | |
/* | |
* -------------------------------------------------------------------- |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
// connection.php | |
// This is the updated code for illuminate database 4.0 | |
$CI = & get_instance(); | |
$config = $CI->db; // Get the DB object | |
$pdo = new PDO('mysql:host='.$config->hostname.';dbname='.$config->database, $config->username, $config->password); | |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once('connection.php'); | |
use Illuminate\Database\Eloquent\Model as Eloquent; | |
class User extends Eloquent { | |
public $table = "users"; | |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Users extends CI_Controller { | |
function __construct() | |
{ | |
parent::__construct(); | |
} | |
function index() |
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
/* | |
| ------------------------------------------------------------------- | |
| Auto-load Models | |
| ------------------------------------------------------------------- | |
| Prototype: | |
| | |
| $autoload['model'] = array('model1', 'model2'); | |
| | |
*/ |
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 | |
$orderId = '100003033'; | |
$order = Mage::getModel('sales/order')->loadByIncrementID($orderId); | |
$resource = Mage::getSingleton('core/resource'); | |
$read = $resource->getConnection('catalog_read'); | |
$write = $resource->getConnection('core_write'); | |
$salesFlatOrder = Mage::getSingleton('core/resource')->getTableName('sales_flat_order'); | |
$salesFlatOrderGrid = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_grid'); |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
$config['views_path'] = APPPATH . 'views/blade/'; | |
$config['cache_path'] = APPPATH . 'cache/blade/'; |
OlderNewer