/
update.php
663 lines (616 loc) · 26.2 KB
/
update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
<?php
/**
* @version $Id$
* @author Matthew McNaney <mcnaney at gmail dot com>
*/
function core_update(&$content, $version)
{
$content[] = '';
// Versions previous to 1.9.8 removed 2 May, 2013.
switch (1) {
case version_compare($version, '1.9.8', '<'):
$content[] = '<h2>Sorry</h2>
<p>Your version of phpWebSite is too old to update using 1.8.0. Please update to
1.7.3 and return.</p>';
case version_compare($version, '2.0.0', '<'):
if (\phpws\PHPWS_Core::isBranch()) {
$content[] = 'This update can only be performed on the hub.';
return false;
}
if (!PHPWS_Boost::inBranch()) {
$config_dir = PHPWS_SOURCE_DIR . 'config/core/';
if (!is_writable($config_dir)) {
$content[] = '<p>Core update can not continue until your hub installation\'s <strong>config/core/</strong> directory is writable.</p>';
return false;
}
$source_http = sprintf("<?php\ndefine('PHPWS_SOURCE_HTTP', '%s');\n?>",
\phpws\PHPWS_Core::getHomeHttp());
if (!file_put_contents($config_dir . 'source.php', $source_http)) {
$content[] = '<p>Could not create config/core/source.php file.</p>';
return false;
}
$content[] = <<<EOT
<pre>2.0.0 changes
-----------------
+ Hub/Branch overhaul. Branches pull config, templates, javascript,
and theme files from hub instead of locally.
+ Added Icon class. Standardizes icons and prevents overlap.
+ Added Tag class: extendable class used with Image and Form2.
+ Added tag_implode function.
+ Created Form2 class.
+ Added CKeditor.
+ Added Lightbox.
+ getConfigFile does not throw error now.
+ Dutch translation updated.
+ Added autoload function for core classes.
+ Source dir derived from file path and not simply "./"
+ Added Image class.
+ Critical functions changed to throw exceptions.
+ Setup steamlined.</pre>
<p><strong>Note:</strong> this update creates a backup of your config/core/config.php file named<br />
config-prior170.php.<br />
If your installation is working, this file may be safely deleted.</p>
<p>IMPORTANT! Many settings in the old config.php have been moved to core/conf/defines.php in the hub.
You can delete all settings <strong>except</strong> the following:</p>
<ul><li>PHPWS_SOURCE_DIR</li>
<li>PHPWS_HOME_DIR</li>
<li>PHPWS_SOURCE_HTTP</li>
<li>SITE_HASH</li>
<li>PHPWS_DSN</li>
<li>PHPWS_TABLE_PREFIX</li></ul>
</pre>
EOT;
}
if ($branch = PHPWS_Boost::inBranch(true)) {
if (!PHPWS_File::copy_directory(PHPWS_SOURCE_DIR . 'javascript/editors/fckeditor/',
$branch->directory . 'javascript/editors/fckeditor',
true)) {
mkdir($branch->directory . 'images/ckeditor/');
$this->content[] = 'Failed to copy FCKeditor to branch.';
} else {
$content[] = 'FCKeditor not copied to branch. Check directory permissions.';
}
} else {
mkdir(PHPWS_SOURCE_DIR . 'images/ckeditor/');
}
case version_compare($version, '2.0.1', '<'):
$content[] = <<<UPDATES
<pre>2.0.1 changes
----------------------
+ Fixed captcha trying to pull from branch directory.
+ Fixed templates ignoring use_hub_themes setting.
+ Image class will accept tilde in source directory.
+ Database fix for insert and update on multiple tables.
+ Powerpoint types added to file check.
+ Background mode added to index (allows for selective loading on Ajax calls)
+ Freecap ereg_replace updated to preg_replace
+ Fix for js_calendar
+ Fix for javascript alert script
+ Fixes for Fckeditor and Tinymce
+ Inclusion of ngBackup
</pre>
UPDATES;
case version_compare($version, '2.0.2', '<'):
$content[] = <<<UPDATES
<pre>2.0.2 changes
----------------------
+ Added To top icon
+ Fixed table bug where names used in foreign key constrains (in CREATE TABLE statements) were not prefixed correctly
+ Removed HTML from some translations.
+ Fixed bug causing a table name to be repeated in a JOIN statement
+ Fixed some PHP notice errors.
+ Fixed some hub icon directory problems (Thanks Eloi).
+ Image resizing reworked to correct problems with irregular images.
+ ngBackup updates.
+ Fixed some templating issues (Thanks Tommy, Eloi).
+ URL validity checking in Text was made more robust.
+ Fixed some label id issues in form.
+ Fixed a loadDimensions error in Image (Thanks Eloi)
+ Fixed DBPager duplicating table insertions (Thanks Eloi)
+ Fixed some PEAR PHP 5 warnings.
+ Changed URL forwarding - if first value after the module is numeric, it is cast as an id.
+ Removed deny-all .htaccess file from file directory.
</pre>
UPDATES;
case version_compare($version, '2.1.0', '<'):
$content[] = <<<UPDATES
<pre>2.1.0 changes
----------------------
+ Another Powerpoint file mimetype added to file_types.php
+ Turned off collapse_urls as a default condition.
+ Added cosign configuration example in defines.dist.php
+ More static warnings silenced.
Classes
----------------
+ Form.php
- Fixed bug with addCheckAssoc
- Added onbeforeclose protection to forms
- Fixed array handling in PHPWS_Form::grab(). If the array of elements isn't
indexed by integers, it will return the entire array instead of trying to
return element 0.
+ Error.php
- Pear method call was called all lowercase. Probably a hold over
from when function name case was irrelevant.
+ Cookie.php
- Cookie assumes a cookie is set before deletion. Changed function
call to check prior to operation.
+ File.php
- Fix to file extension checking.
+ Core.php
- Moved some logic for finding the site Base URL out of Layout and
into Core, as the getBaseURL() function
+ Text.php
- Missing variable added to parameter list.
- Faulty parse_url is being silenced on failure and getGetValues returns null.
- Filtering out high ascii using parseOutput
+ Init.php
- Fixed overwrite problem with defines.php on updating.
+ Database.php
- Removed restrictive join check
- Database substitutes table "as" if it exists on column call and/or set order
- Allow parenthesis and commas in addOrder, so we can order by function,
like "order by coalesce(...)"
- Fixed splat usage with count in addColumn and getColumn
+ DBPager.php
- Rewrote CSV parser to use fputcsv
- Fixed bug with csv reporting
Javascript
------------------
+ captcha/recaptcha - added recycle instructions
+ required_input - file inputs can now be required fields
+ protect_form - new javascript to prevent user leaving fields blank
+ jquery - updated
+ flowplayer - updated version
+ editors
+ ckeditor - added File Cabinet functionality
+ cleditor - added Cleditor by Hilmar
</pre>
UPDATES;
case version_compare($version, '2.1.1', '<'):
$content[] = <<<UPDATES
<pre>
2.1.1 changes
-----------------
Core Classes
-----------------
+ Fixed bugs with Key and Database. Registered users (not deities) were having problems
with editing and view restricted items. PHPWS_DB::groupIn rewritten.
+ Core now has better error messages for Branches problems.
+ Image - removed px from width and height for xhtml compatibility.
+ Static notice fixes
+ Removed clone function call in Icon.
Javascript
----------------
+ jquery_ui and jquery updated
</pre>
UPDATES;
case version_compare($version, '2.2.0', '<'):
$changes = file_get_contents(PHPWS_SOURCE_DIR . 'core/boost/changes/2_2_0.txt');
$content[] = "<pre>$changes</pre>";
case version_compare($version, '2.3.0', '<'):
try {
include_once PHPWS_SOURCE_DIR . 'core/boost/updates/2_3_0.php';
update_core_2_3_0();
} catch (\Exception $e) {
$content[] = 'Error: ' . $e->getMessage();
return false;
}
$changes = file_get_contents(PHPWS_SOURCE_DIR . 'core/boost/changes/2_3_0.txt');
$content[] = "<pre>$changes</pre>";
case version_compare($version, '2.3.1', '<'):
$db = \Database::newDB();
$db->setConditional($db->addTable('modules')->getFieldConditional('title',
'comments'));
$db->delete();
$db = \Database::newDB();
$db->setConditional($db->addTable('controlpanel_link')->getFieldConditional('itemname',
'comments'));
$db->delete();
$db = \Database::newDB();
if ($db->tableExists('comments_items')) {
$db->buildTable('comments_items')->drop();
}
if ($db->tableExists('comments_items_seq')) {
$db->buildTable('comments_items_seq')->drop();
}
if ($db->tableExists('comments_monitors')) {
$db->buildTable('comments_monitors')->drop();
}
if ($db->tableExists('comments_permissions')) {
$db->buildTable('comments_permissions')->drop();
}
if ($db->tableExists('comments_ranks')) {
$db->buildTable('comments_ranks')->drop();
}
if ($db->tableExists('comments_ranks_seq')) {
$db->buildTable('comments_ranks_seq')->drop();
}
if ($db->tableExists('comments_threads')) {
$db->buildTable('comments_threads')->drop();
}
if ($db->tableExists('comments_threads_seq')) {
$db->buildTable('comments_threads_seq')->drop();
}
if ($db->tableExists('comments_users')) {
$db->buildTable('comments_users')->drop();
}
if ($db->tableExists('comments_user_ranks')) {
$db->buildTable('comments_user_ranks')->drop();
}
if ($db->tableExists('comments_user_ranks_seq')) {
$db->buildTable('comments_user_ranks_seq')->drop();
}
$db = \Database::newDB();
if ($db->tableExists('categories')) {
$db->buildTable('categories')->drop();
}
if ($db->tableExists('categories_seq')) {
$db->buildTable('categories_seq')->drop();
}
if ($db->tableExists('categories_permissions')) {
$db->buildTable('categories_permissions')->drop();
}
if ($db->tableExists('category_items')) {
$db->buildTable('category_items')->drop();
}
if ($db->tableExists('category_items_seq')) {
$db->buildTable('category_items_seq')->drop();
}
$db = \Database::newDB();
$db->setConditional($db->addTable('modules')->getFieldConditional('title',
'categories'));
$db->delete();
$db = \Database::newDB();
$db->setConditional($db->addTable('controlpanel_link')->getFieldConditional('itemname',
'categories'));
$db->delete();
$content[] = '<pre>Core 2.3.1 Changes
-------------------
+ Removed Comments module
+ Removed Categories module
</pre>';
case version_compare($version, '2.3.2', '<'):
$content[] = '<pre>Core 2.3.2 Changes
-------------------
+ Bootstrap
- Updated Bootstrap theme to Bootstrap 3.0.1
- Added Bootstrap table styles to several modules.
- Removed class name "label" from several templates as it is a reserved class name
in Bootstrap. Leaving it caused white text.
+ Font Awesome
- Font Awesome replaced several module icons.
- Updated Icon class to use Font Awesome 4
+ Changed phpDSNLoader to accept the table prefix as a parameter instead of relying on a define.
+ added loadPDO to exec method should it get unset.
+ Removed remnants of category calls.
+ xml2php changed to catch an exception.
+ Added Dutch translation from Han Velthuis.
+ Rewrote some Global error messages to be more descriptive.
+ Removed "simple" theme.
+ Fixed define bug casuing setup errors.
+ Pear deprecated when possible.
+ Filter code (BB and pear) removed from Text parsing.
+ Removed firebug code, ngboost and ngcom.
+ A theme can now define default classes for inputs, labels, and element groups.
+ date_default_timezone_set added to index.php to conform with new PHP standards.
+ Error check on PHPWS_Form class added.
+ Removed setup/manager.php
+ Fixed GD version detection. Was causing resampled images to be downgraded.
+ Swiftmail library added. Not in use yet but will replace other mail functions.
+ Added abbr tag to allowed_tags.
+ Global\Server
- fixed getCurrentUrl adding extra slashes
+ Global\Variable
- setRange and setIncrement return $this to allow method chaining.
- setText will change a bool to a 0 or 1 for display.
- Integer creates a ranged select if setInputType is set to select.
- Unlimited String will create a text column in the database and no longer a varchar.
- Text input is no longer the default type for a Variable object
- Fixed: String validity check would fail on empty or null values.
- String-type variable limits raised to reflect higher varchar limits
- Added unlink method to File class.
- Boolean now shows up in a Debug call
+ Global\Form
- Form can now define groupings for use with Bootstrap
- Form Labels are now a class instead of a string.
- addInputClass will plug a css class to every input in the Global\Form.
- Placeholders can now be added to input objects.
- Required check works with onblur instead of change allowing blanks to be detected.
- Submit button will be disabled if form set to use required inputs.
- Choice\Select now allows first choice to be blank
- Input\Text now allow apostrophes.
- Added to ability to theme buttons
- Added return to Text to allow method chaining.
- Removed code that automatically copied the options of integer keyed arrays
over the key. Instead added a copyOptionToValue method.
+ Global\Database
- Added addFieldConditional method to Table class.
- Text added as datatype.
- Added joinResources method to replace join method
- Large update to allow multiple conditionals to join statements
- Update to subselects and tables to work properly with fields.
- Added Exists class which is an extension of Conditional. Works with subselects.
- DB quote changed to static method.
- Conditionals were missing proper quoting methods.
- Added stringAsField method to Expression.
- Conditional checks for alias on getLeft
+ Global\Resource returns the id of the resource as a hidden input.
- createTable returns a table object
+ Global\Request added methods for returning FILES information
- Added new functions to Request to assist with command branching.
- Added lastCommand method
+ Global\ResourceFactory selectInto fixed as private and protected variables would not work
+ Global\Pager
- Added addJsonData and json_data variable. Allows entering a key=>value pair
that will be included in the JSON return.
- Fixed search box display
- Fixed search clear
- Added page count to JSON result. Not in UI yet.
- Added method to set the data url to the pager template.
- Added undefined check to prevent javascript error.
+ Global\DatabasePager
- added showQuery function and show_query variable. If variable is true, the
select query will be inserted into the JSON return for evaluation
- Total row calculation moved up in process so current page count is correct.
</pre>';
case version_compare($version, '2.4.0', '<'):
$db = \Database::newDB();
$tbl = $db->addTable('modules');
$tbl->addFieldConditional('title', 'clipboard');
$db->delete();
$db->clearConditional();
$tbl->addFieldConditional('title', 'demographics');
$db->delete();
$db->clearTables();
if ($db->tableExists('demographics')) {
$tbl = $db->addTable('demographics');
$tbl->drop();
}
$content[] = <<<EOF
<pre>Core 2.4.0 Changes
--------------------------------
+ Dropping clipboard module.
+ Dropping demographics module.
</pre>
EOF;
case version_compare($version, '2.4.1', '<'):
$db = \Database::newDB();
$db->addTable('modules')->addFieldConditional('title', 'version');
$db->delete();
$content[] = <<<EOF
<pre>Core 2.4.1 Changes
--------------------------------
+ Removed Version module from Core modules
+ Pear DB changed to MDB2.
+ MDB2 using mysqli class instead of mysql class to prevent MySQL deprecation warnings.
+ Fixed GD library identification.
+ DTTIME format now includes hour, minute, and seconds set to zero as "all day" is interpreted differently by ical.
+ ResourceFactory returns True on successful load and false otherwise. Previously returned void.
+ Added aspell plugin for CKEditor. Written by Christian Boisjoli.
+ CKeditor
- altered to have smoother button transitions when width is changed.
- removed Style button
- default width is 100% instead of hard coded pixel
- imports images with img-responsive class added
+ Javascript added to avoid image loading on small screens
+ Fixed createConfig function in setup script
EOF;
case version_compare($version, '2.4.2', '<'):
$db = \Database::newDB();
$t1 = $db->addTable('settings');
$indexes = $t1->getIndexes();
if (empty($indexes)) {
$t1->createPrimaryIndexId();
}
$content[] = <<<EOF
<pre>
Core 2.4.2 Changes
--------------------
+ Index added to the Settings table
+ dropIndex and createPrimaryIndexId methods added to Database Table
+ Update autoloader to allow modules classes to be in their own top-level namespace
+ Global/Module: Unnecessary ampersand removed from afterRun
+ Global/Form: setAction missing https check.
+ Global/Form/Input/Date: Added min, max, and step parameters to conform with HTML5
+ Global/Form/Input/Date: setValue parses integer values
+ Global/Form/Label: required parameter made private. It was breaking the required tag.
+ Global/Modal: new class that allows for easier insertion of a bootstrap modal window.
+ Global/Variable/Integer: fixed typo with class name Exception
+ Global/Form: Added removeInput method
+ core/class/PHPWS_DB: Previously, Pear's DB class would return two column results
as an array with the key as the first column and the value as the second. This
behavior was inconsistent with the expected functionality. We had code programmed
expecting this behavior. MDB2 did not replicate it, so two column results were
broken. New code brings the result back to the expected action.
+ core/class/Link: addClass method added. setClass accepts an array
+ CKeditor: Allows i tags for use with Font Awesome and to not strip spans.
+ CKeditor: Shortened max height on autogrow. Previously, 600px frequently pushed
it outside the monitor bounds.
</pre>
EOF;
case version_compare($version, '2.5.0', '<'):
$content[] = <<<EOF
<pre>
Core 2.5.0 Changes
------------------
+ Added selectAsCSV to Global Database class.
</pre>
EOF;
case version_compare($version, '2.6.0', '<'):
$content[] = <<<EOF
<pre>
Core 2.6.0 Changes
------------------
+ Improved DBPager Search bar and pagination
+ Updated CKEditor from 3 to 4.
+ Removed Editor class.
+ Added PHPWS_File stub file to work with autoload.
+ Added method to set width and height on Modal.
+ Added method to pull hidden variables.
+ Removed Simple and Tinymce editors
+ Updated datetimepicker script
</pre>
EOF;
case version_compare($version, '2.7.0', '<'):
$content[] = <<<EOF
<pre>
+ Bug Fix: CKEditor images folder returned.
+ Bug Fix: Database - Blank schema error check added to mysql Table class.
+ Bug Fix: Database - Mislabeled return on getDateType.
+ Change: datepicker - script tags put into head.js
+ Update: Bootstrap and Font Awesome version
+ Feature: Database - added "using" ability. Helps with multi-table deletions.
+ Update: Flowplayer version upped. Captioning ability added.
+ Removed: javascript/editor/ directory and all wysiwyg editors outside of ckeditor
+ Removed: Unsupported modules: phpwsbb, podcaster, and profiler
+ Bug Fix: core/class/DBPager - setDefaultOrder was ignored
+ Bug Fix: Removed @ error suppressors throughout code. Should be fun right?
+ Feature: Added exception messages to JsonErrorView.
Previously info had to be dug out of an html encoded exception object.
+ Bug Fix: Global/Pager Search icon with bad class name
+ Feature: Global/Pager Search columns can now be set manually instead of depending on the headers.
+ Feature: Global/Tag - removeClass method - removes a class previously added to the class variable stack
+ Feature: Added authkey javascript for insertion of the authkey value for use in other js scripts.
+ Added: <s> as allowed tag.
+ Feature: CKEditor Save button added for use with some modules.
</pre>
EOF;
case version_compare($version, '2.8.0', '<'):
$db = \Database::newDB();
$t = $db->addTable('settings');
$dt_old = $t->getDataType('setting');
$dt_update = new \Database\Datatype\Text($t, 'setting');
$dt_update->setIsNull(true);
$t->alter($dt_old, $dt_update);
$content[] = <<<EOF
<pre>2.8.0 changes
--------------------
+ Settings table setting column is now TEXT not VARCHAR.
</pre>
EOF;
case version_compare($version, '2.8.1', '<'):
if ($db->getDatabaseType() == 'mysql') {
$db = \Database::newDB();
$t = $db->addTable('settings');
$dt_old = $t->getDataType('setting');
$dt_new = \Database\Datatype::factory($t, 'settings',
'mediumtext');
$dt_new->setIsNull(true);
$t->alter($dt_old, $dt_new);
}
$content[] = <<<EOF
<pre>2.8.1 changes
--------------------
+ Settings table setting column is now MEDIUMTEXT not TEXT in MySQL.
</pre>
EOF;
case version_compare($version, '2.8.2', '<'):
$db = \Database::getDB();
$tbl = $db->addTable('settings');
if ($tbl->columnExists('id')) {
$indexes = $tbl->getIndexes();
if (empty($indexes)) {
$tbl->dropColumn('id');
$tbl->createPrimaryIndexId();
}
} else {
$tbl->createPrimaryIndexId();
}
$content[] = <<<EOF
<pre>2.8.2 changes
--------------------
+ Fixed: settings table missing primary key.
+ Updated url regular expression check on Variable/Url
+ Added option to force rollbacks on destruction of DB object.
+ Fixed discrepancy between Varchar limit and String.
</pre>
EOF;
case version_compare($version, '2.9.0', '<'):
$db = \Database::getDB();
$tbl = $db->addTable('settings');
if (!$tbl->columnExists('id')) {
$tbl->createPrimaryIndexId();
}
$content[] = <<<EOF
<pre>2.9.0 changes
--------------------
+ Overhaul of Core and Global classes. Now namespaced.
+ Fixed: settings table missing primary key again because install wasn't doing it.
</pre>
EOF;
case version_compare($version, '2.9.1', '<'):
$db = \phpws2\Database::getDB();
$tbl = $db->addTable('settings');
$setting = $tbl->getDatatype('setting');
$new_setting = new \phpws2\Database\Datatype\Text($tbl, 'setting');
$new_setting->setIsNull(true);
$tbl->alter($setting, $new_setting);
$content[] = <<<EOF
<pre>2.9.1 changes
--------------------
+ Fixed: settings table value made is null.
</pre>
EOF;
case version_compare($version, '2.9.2', '<'):
$db = \phpws2\Database::getDB();
$tbl = $db->addTable('phpws_key_register');
$c1 = $db->createConditional($tbl->getField('module'), 'categories');
$c2 = $db->createConditional($tbl->getField('module'), 'comments');
$c3 = $db->createConditional($c1, $c2, 'or');
$db->addConditional($c3);
$db->delete();
$content[] = <<<EOF
<pre>2.9.2 changes
--------------------
+ Removed deprecated unregisters
</pre>
EOF;
case version_compare($version, '2.10.0', '<'):
$content[] = <<<EOF
<pre>2.10.0 changes
--------------------
+ Expanded Request functionality
+ Fixed makeResourcestringArray in ResourceFactory
+ Changed all "new \Variable calls" to "new \phpws2\Variable"
</pre>
EOF;
case version_compare($version, '2.10.1', '<'):
$db = \phpws2\Database::getDB();
$tbl = $db->addTable('modules');
$newdt = new \phpws2\Database\Datatype\Varchar($tbl, 'title', 40);
$tbl->alter($tbl->getDataType('title'), $newdt);
$newdt2 = new \phpws2\Database\Datatype\Varchar($tbl, 'proper_name',
40);
$tbl->alter($tbl->getDataType('proper_name'), $newdt2);
$newdt3 = new \phpws2\Database\Datatype\Varchar($tbl, 'version', 20);
$tbl->alter($tbl->getDataType('version'), $newdt3);
$db->clearTables();
$tbl = $db->addTable('registered');
$newdt = new \phpws2\Database\Datatype\Varchar($tbl, 'module', 40);
$tbl->alter($tbl->getDataType('module'), $newdt);
$newdt2 = new \phpws2\Database\Datatype\Varchar($tbl,
'registered_to', 40);
$tbl->alter($tbl->getDataType('registered_to'), $newdt2);
$content[] = <<<EOF
<pre>2.10.1
-------------------
+ Update the CHAR columns in modules table to VARCHAR.
+ Update the CHAR columns in registered table to VARCHAR
</pre>
EOF;
}
return true;
}
function coreUpdateFiles($files, &$content)
{
if (PHPWS_Boost::updateFiles($files, 'core')) {
$content[] = ' --- Updated the following files:';
$good = true;
} else {
$content[] = ' --- Unable to update the following files:';
$good = false;
}
$content[] = " " . implode("\n ", $files);
$content[] = '';
return $good;
}