mirror of
https://github.com/brmlab/brmsklad.git
synced 2025-10-30 15:53:59 +01:00
Backup of current cakephp version
This commit is contained in:
parent
b8f82da6f8
commit
5a580df460
925 changed files with 238041 additions and 1 deletions
35
lib/Cake/Test/test_app/Model/AppModel.php
Normal file
35
lib/Cake/Test/test_app/Model/AppModel.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* Application model for Cake.
|
||||
*
|
||||
* This file is application-wide model file. You can put all
|
||||
* application-wide model-related methods here.
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Model
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
App::uses('Model', 'Model');
|
||||
|
||||
/**
|
||||
* Application model for Cake.
|
||||
*
|
||||
* This is a placeholder class.
|
||||
* Create the same file in app/Model/AppModel.php
|
||||
* Add your application-wide methods to the class, your models will inherit them.
|
||||
*
|
||||
* @package Cake.Model
|
||||
*/
|
||||
class AppModel extends Model {
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* Behavior for binding management.
|
||||
*
|
||||
* Behavior to simplify manipulating a model's bindings when doing a find operation
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Test.test_app.Model.Behavior
|
||||
* @since CakePHP(tm) v 1.2.0.5669
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Behavior to allow for dynamic and atomic manipulation of a Model's associations used for a find call. Most useful for limiting
|
||||
* the amount of associations and data returned.
|
||||
*
|
||||
* @package Cake.Test.test_app.Model.Behavior
|
||||
*/
|
||||
class PersisterOneBehaviorBehavior extends ModelBehavior {
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* Behavior for binding management.
|
||||
*
|
||||
* Behavior to simplify manipulating a model's bindings when doing a find operation
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Test.test_app.Model.Behavior
|
||||
* @since CakePHP(tm) v 1.2.0.5669
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Behavior to allow for dynamic and atomic manipulation of a Model's associations used for a find call. Most useful for limiting
|
||||
* the amount of associations and data returned.
|
||||
*
|
||||
* @package Cake.Test.test_app.Model.Behavior
|
||||
*/
|
||||
class PersisterTwoBehaviorBehavior extends ModelBehavior {
|
||||
}
|
||||
27
lib/Cake/Test/test_app/Model/Comment.php
Normal file
27
lib/Cake/Test/test_app/Model/Comment.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Test App Comment Model
|
||||
*
|
||||
*
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
* @link http://cakephp.org CakePHP Project
|
||||
* @package Cake.Test.test_app.Model
|
||||
* @since CakePHP v 1.2.0.7726
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
class Comment extends AppModel {
|
||||
|
||||
public $useTable = 'comments';
|
||||
|
||||
public $name = 'Comment';
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
App::uses('TestSource', 'TestPlugin.Model/Datasource');
|
||||
class TestLocalDriver extends TestSource {
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* Test suite app/Model/Datasource/Session session handler
|
||||
*
|
||||
*/
|
||||
|
||||
App::uses('CakeSessionHandlerInterface', 'Model/Datasource/Session');
|
||||
|
||||
class TestAppLibSession implements CakeSessionHandlerInterface {
|
||||
|
||||
public function open() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function close() {
|
||||
}
|
||||
|
||||
public function read($id) {
|
||||
}
|
||||
|
||||
public function write($id, $data) {
|
||||
}
|
||||
|
||||
public function destroy($id) {
|
||||
}
|
||||
|
||||
public function gc($expires = null) {
|
||||
}
|
||||
|
||||
}
|
||||
27
lib/Cake/Test/test_app/Model/Datasource/Test2OtherSource.php
Normal file
27
lib/Cake/Test/test_app/Model/Datasource/Test2OtherSource.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
class Test2OtherSource extends DataSource {
|
||||
|
||||
public function describe($model) {
|
||||
return compact('model');
|
||||
}
|
||||
|
||||
public function listSources($data = null) {
|
||||
return array('test_source');
|
||||
}
|
||||
|
||||
public function create(Model $model, $fields = null, $values = null) {
|
||||
return compact('model', 'fields', 'values');
|
||||
}
|
||||
|
||||
public function read(Model $model, $queryData = array(), $recursive = null) {
|
||||
return compact('model', 'queryData');
|
||||
}
|
||||
|
||||
public function update(Model $model, $fields = array(), $values = array(), $conditions = null) {
|
||||
return compact('model', 'fields', 'values');
|
||||
}
|
||||
|
||||
public function delete(Model $model, $id = null) {
|
||||
return compact('model', 'id');
|
||||
}
|
||||
}
|
||||
27
lib/Cake/Test/test_app/Model/Datasource/Test2Source.php
Normal file
27
lib/Cake/Test/test_app/Model/Datasource/Test2Source.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
class Test2Source extends DataSource {
|
||||
|
||||
public function describe($model) {
|
||||
return compact('model');
|
||||
}
|
||||
|
||||
public function listSources($data = null) {
|
||||
return array('test_source');
|
||||
}
|
||||
|
||||
public function create(Model $model, $fields = null, $values = null) {
|
||||
return compact('model', 'fields', 'values');
|
||||
}
|
||||
|
||||
public function read(Model $model, $queryData = array(), $recursive = null) {
|
||||
return compact('model', 'queryData');
|
||||
}
|
||||
|
||||
public function update(Model $model, $fields = array(), $values = array(), $conditions = null) {
|
||||
return compact('model', 'fields', 'values');
|
||||
}
|
||||
|
||||
public function delete(Model $model, $id = null) {
|
||||
return compact('model', 'id');
|
||||
}
|
||||
}
|
||||
60
lib/Cake/Test/test_app/Model/PersisterOne.php
Normal file
60
lib/Cake/Test/test_app/Model/PersisterOne.php
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
/**
|
||||
* Test App Comment Model
|
||||
*
|
||||
*
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
* @link http://cakephp.org CakePHP Project
|
||||
* @package Cake.Test.test_app.Model
|
||||
* @since CakePHP v 1.2.0.7726
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
class PersisterOne extends AppModel {
|
||||
|
||||
public $useTable = 'posts';
|
||||
|
||||
public $name = 'PersisterOne';
|
||||
|
||||
public $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne');
|
||||
|
||||
public $hasMany = array('Comment', 'TestPlugin.TestPluginComment');
|
||||
|
||||
public $validate = array(
|
||||
'title' => array(
|
||||
'custom' => array(
|
||||
'rule' => array('custom', '.*'),
|
||||
'allowEmpty' => true,
|
||||
'required' => false,
|
||||
'message' => 'Post title is required'
|
||||
),
|
||||
'between' => array(
|
||||
'rule' => array('between', 5, 15),
|
||||
'message' => array('You may enter up to %s chars (minimum is %s chars)', 14, 6)
|
||||
)
|
||||
),
|
||||
'body' => array(
|
||||
'first_rule' => array(
|
||||
'rule' => array('custom', '.*'),
|
||||
'allowEmpty' => true,
|
||||
'required' => false,
|
||||
'message' => 'Post body is required'
|
||||
),
|
||||
'second_rule' => array(
|
||||
'rule' => array('custom', '.*'),
|
||||
'allowEmpty' => true,
|
||||
'required' => false,
|
||||
'message' => 'Post body is super required'
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
31
lib/Cake/Test/test_app/Model/PersisterTwo.php
Normal file
31
lib/Cake/Test/test_app/Model/PersisterTwo.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* Test App Comment Model
|
||||
*
|
||||
*
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
* @link http://cakephp.org CakePHP Project
|
||||
* @package Cake.Test.test_app.Model
|
||||
* @since CakePHP v 1.2.0.7726
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
class PersisterTwo extends AppModel {
|
||||
|
||||
public $useTable = 'posts';
|
||||
|
||||
public $name = 'PersisterTwo';
|
||||
|
||||
public $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne');
|
||||
|
||||
public $hasMany = array('Comment', 'TestPlugin.TestPluginComment');
|
||||
|
||||
}
|
||||
27
lib/Cake/Test/test_app/Model/Post.php
Normal file
27
lib/Cake/Test/test_app/Model/Post.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Test App Comment Model
|
||||
*
|
||||
*
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
* @link http://cakephp.org CakePHP Project
|
||||
* @package Cake.Test.test_app.Model
|
||||
* @since CakePHP v 1.2.0.7726
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
class Post extends AppModel {
|
||||
|
||||
public $useTable = 'posts';
|
||||
|
||||
public $name = 'Post';
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue