This repository was archived by the owner on Sep 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -103,14 +103,14 @@ function step2Action()
103
103
{
104
104
$ databaseConfig = parse_ini_file (BASE_PATH .'/core/configs/database.ini ' , true );
105
105
$ MyDirectory = opendir (BASE_PATH ."/core/database/ " .$ type );
106
- while ( $ Entry = readdir ( $ MyDirectory ))
107
- {
108
- if ( strpos ( $ Entry , " .sql " ) != false )
109
- {
110
- $ sqlFile = BASE_PATH . " /core/database/ " . $ type . " / " . $ Entry ;
111
- }
112
- }
113
- if (!isset ($ sqlFile ))
106
+
107
+ require_once BASE_PATH . ' /core/controllers/components/UpgradeComponent.php ' ;
108
+ $ upgradeComponent = new UpgradeComponent ();
109
+ $ upgradeComponent -> dir = BASE_PATH . " /core/database/ " . $ type ;
110
+ $ upgradeComponent -> init = true ;
111
+ $ sqlFile = $ upgradeComponent -> getNewestVersion ( true );
112
+ $ sqlFile = BASE_PATH . " /core/database/ " . $ type . " / " . $ sqlFile . ' .sql ' ;
113
+ if (!isset ($ sqlFile ) ||! file_exists ( $ sqlFile ) )
114
114
{
115
115
throw new Zend_Exception ("Unable to find sql file " );
116
116
}
Original file line number Diff line number Diff line change 3
3
class UpgradeComponent extends AppComponent
4
4
{
5
5
6
- protected $ dir ;
6
+ public $ dir ;
7
7
protected $ module ;
8
8
protected $ db ;
9
9
protected $ dbtype ;
10
10
protected $ dbtypeShort ;
11
- protected $ init = false ;
11
+ public $ init = false ;
12
12
13
13
/** init upgrade Componenet*/
14
14
public function initUpgrade ($ module , $ db , $ dbtype )
@@ -87,6 +87,15 @@ public function getMigrationFiles()
87
87
'version ' => $ versionNumber ,
88
88
'versionText ' => $ versionText );
89
89
}
90
+ if (preg_match ('/^([0-9]+)(.)([0-9]+)(.)([0-9]+)\.sql/i ' , $ entry , $ matches ) )
91
+ {
92
+ $ versionText = basename (str_replace (".sql " , "" , $ entry ));
93
+ $ versionNumber = $ this ->transformVersionToNumeric ($ versionText );
94
+ $ files [$ versionNumber ] = array (
95
+ 'filename ' => $ entry ,
96
+ 'version ' => $ versionNumber ,
97
+ 'versionText ' => $ versionText );
98
+ }
90
99
}
91
100
$ d ->close ();
92
101
}
Original file line number Diff line number Diff line change 42
42
checkDB ( $ ( this ) ) ;
43
43
} ) ;
44
44
45
- $ ( '.dbForm .adminAcountForm input' ) . focusout ( function ( )
45
+ $ ( '.dbForm .adminAcountForm input' ) . keyup ( function ( )
46
46
{
47
47
var obj = $ ( this ) ;
48
48
checkAll ( obj ) ;
You can’t perform that action at this time.
0 commit comments