This file contains hidden or 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
public function setDbConfig($source = null, $useTable = null) { | |
$this->getDataSource()->flushMethodCache(); | |
if ($source) { | |
$this->oldSource = array('useTable' => $this->useTable, 'useDbConfig' => $this->useDbConfig); | |
$this->setDataSource($source); | |
if ($useTable !== null) { | |
$this->setSource($useTable); | |
} | |
} else { | |
if ($this->oldSource) { |
This file contains hidden or 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
comment_char % | |
escape_char / | |
% | |
% Dutch Language Locale for the Netherlands | |
% Source: RAP | |
% Address: Sankt Jo//rgens Alle 8 | |
% DK-1615 Ko//benhavn V, Danmark | |
% Contact: Keld Simonsen | |
% Email: [email protected] | |
% Tel: +45 - 31226543 |
This file contains hidden or 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 | |
App::uses('Model', 'Model'); | |
class AppModel extends Model { | |
public $saveTemplate = 'INSERT INTO `%s` (%s) VALUES %s;'; | |
public function rawSave($data) { | |
if(empty($data)) { |
This file contains hidden or 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 | |
public function specificAccessSpeeds() { | |
$specificAccessType_id = $this->request->data['Service']['specific_access_type_id']; | |
$Model = ClassRegistry::init('SpecificAccessTypesAccessSpeed'); | |
$Model->virtualFields['custom'] = 'AccessSpeed.name'; | |
$specificAccessSpeeds = $Model->find( 'list', array( | |
'conditions' => array( 'SpecificAccessTypesAccessSpeed.specific_access_type_id' => $specificAccessType_id ), | |
'recursive' => -1, |
This file contains hidden or 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 $user = $this->Session->read('Auth.User');?> | |
<?php if (!$user) : ?> | |
<?php echo $this->Form->create('User', array('novalidate' => true, 'url' => array('controller' => 'users', 'action' => 'login', 'plugin' => false, 'admin' => false)));?> | |
<?php echo $this->Form->input('username');?> | |
<?php echo $this->Form->input('password');?> | |
<?php echo $this->Form->end('Login');?> | |
<?php else : ?> |
This file contains hidden or 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 | |
/** | |
* Provider Test Case | |
* | |
*/ | |
class ProviderTest extends PHPUnit_Framework_TestCase { | |
/** | |
* |
This file contains hidden or 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
trait foo { function bob() { echo 'from trait'; }} | |
class bar { use foo { bob as likeBob }; function bob() { $this->likeBob();}} | |
class baz extends bar { function bob() { parent::bob(); echo ' from child'; }} | |
$a = new baz; | |
$a->bob(); | |
//result: from trait from child |
This file contains hidden or 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
cd to app | |
git submodule add git://github.com/ceeram/cakephp.git Core | |
<optional> | |
cd Core | |
git checkout 2.4 | |
cd .. | |
</optional> | |
//update webroot/index.php: |
This file contains hidden or 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 | |
/** | |
* ModelWriteTest file | |
* | |
* PHP 5 | |
* | |
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html> | |
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | |
* | |
* Licensed under The MIT License |
This file contains hidden or 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 | |
/** | |
* ODBC for DBO | |
* | |
* PHP versions 4 and 5 | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) | |
* | |
* Licensed under The MIT License |