mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
fixes #3969, schema name for app dirs with special characters
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6518 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
24ea731e7f
commit
c1ea4dff88
2 changed files with 12 additions and 4 deletions
|
@ -24,9 +24,7 @@
|
|||
* @lastmodified $Date$
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
if (!class_exists('connectionmanager')) {
|
||||
uses('model' . DS . 'connection_manager');
|
||||
}
|
||||
App::import('Model', 'ConnectionManager');
|
||||
/**
|
||||
* Base Class for Schema management
|
||||
*
|
||||
|
@ -82,7 +80,7 @@ class CakeSchema extends Object {
|
|||
}
|
||||
|
||||
if ($this->name === 'Cake') {
|
||||
$this->name = Inflector::camelize(Configure::read('App.dir'));
|
||||
$this->name = Inflector::camelize(Inflector::slug(Configure::read('App.dir')));
|
||||
}
|
||||
|
||||
if (empty($options['path'])) {
|
||||
|
|
|
@ -168,6 +168,16 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
$this->Schema = new TestAppSchema();
|
||||
}
|
||||
|
||||
function testSchemaName() {
|
||||
$Schema = new CakeSchema();
|
||||
$this->assertEqual($Schema->name, 'App');
|
||||
|
||||
Configure::write('App.dir', 'Some.name.with.dots');
|
||||
$Schema = new CakeSchema();
|
||||
$this->assertEqual($Schema->name, 'SomeNameWithDots');
|
||||
|
||||
Configure::write('App.dir', 'app');
|
||||
}
|
||||
|
||||
function testSchemaRead() {
|
||||
$read = $this->Schema->read(array('connection'=>'test_suite', 'name'=>'TestApp', 'models'=>array('SchemaPost', 'SchemaComment', 'SchemaTag')));
|
||||
|
|
Loading…
Add table
Reference in a new issue