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 | |
/** | |
* Example of using gettext, the GNU Project that enables easy | |
* internationalization (i18n). Please use gettext over coming up with | |
* another scheme. | |
* | |
* @author vmc <vmc@codegroove.net> | |
* @date 05.28.2010 | |
*/ |
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 | |
/** | |
* ######################### | |
* DataModeler Public SQL Interface | |
* ######################### | |
*/ | |
/** | |
* SEARCHING |
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 | |
declare(encoding='UTF-8'); | |
namespace Adapter; | |
require_once 'Exception.php'; | |
class Sql { | |
private $db = NULL; | |
private $sql = NULL; |
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 | |
declare(encoding='UTF-8'); | |
namespace SqlTest; | |
use Adapter\Sql; | |
require_once 'Sql.php'; | |
class SqlTest extends \PHPUnit_Framework_TestCase { |
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 | |
declare(encoding='UTF-8'); | |
namespace DataModelerTest; | |
require_once 'PHPUnit/Framework.php'; | |
require_once 'TestCase.php'; | |
$data_modeler_test_path = dirname(__FILE__); | |
$data_modeler_lib_path = $data_modeler_test_path . '/../'; |
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 | |
function setUp() { | |
$pdo = new \PDO(DB_DSN, DB_USERNAME, DB_PASSWORD); | |
$sqlFile = DIRECTORY_DATA . 'SqlTest-' . DB_TYPE . '.sql'; | |
if ( true === is_file($sqlFile) ) { | |
$sqlData = @file_get_contents($sqlFile); | |
$pdo->exec($sqlData); | |
} |
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
DROP TABLE IF EXISTS products; | |
CREATE TABLE products (id INTEGER PRIMARY KEY, name TEXT, price REAL, sku TEXT); | |
INSERT INTO products VALUES (NULL, 'Product 1', 10.95, 'P1'); | |
INSERT INTO products VALUES (NULL, 'Product 2', 18.95, 'P2'); | |
INSERT INTO products VALUES (NULL, 'Product 3', 22.97, 'P3'); | |
DROP TABLE IF EXISTS users; | |
CREATE TABLE users (id INTEGER PRIMARY KEY, username TEXT, password TEXT, age INTEGER, favorite_book TEXT); | |
INSERT INTO users VALUES(NULL, 'vcherubini', 'password1', 25, 'xUnit Test Patterns'); | |
INSERT INTO users VALUES(NULL, 'bsaget', 'password2', 50, 'The Olsen Twins: A Legacy'); |
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
DROP TABLE products; | |
CREATE TABLE products (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, price FLOAT NOT NULL, sku VARCHAR(12) NOT NULL) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
INSERT INTO products VALUES (NULL, 'Product 1', 10.95, 'P1'); | |
INSERT INTO products VALUES (NULL, 'Product 2', 18.95, 'P2'); | |
INSERT INTO products VALUES (NULL, 'Product 3', 22.97, 'P3'); | |
DROP TABLE users; | |
CREATE TABLE users (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, username VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, age INT NOT NULL, favorite_book VARCHAR(255) NOT NULL) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
INSERT INTO users VALUES(NULL, 'vcherubini', 'password1', 25, 'xUnit Test Patterns'); | |
INSERT INTO users VALUES(NULL, 'bsaget', 'password2', 50, 'The Olsen Twins: A Legacy'); |
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 | |
/** | |
* Return a single entity object. | |
*/ | |
$statement = $pdo->prepare('SELECT * FROM product WHERE product_id = ?'); | |
$objectifier->setEntity(new Product); | |
$product1 = $objectifier->fetch($statement, array(10)); | |
$product2 = $objectifier->fetch($statement, array(11)); |
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 | |
declare(encoding='UTF-8'); | |
use \Jolt\Router, | |
\Jolt\Route\Named\NamedGet, | |
\Jolt\Route\Named\NamedPost, | |
\Jolt\Dispatcher, | |
\Jolt\Client, | |
\Jolt\Jolt; |