Skip to content

Commit

Permalink
Merge remote branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
illiphilli committed Jun 14, 2011
2 parents 0d40522 + 4398144 commit c4044cd
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 23 deletions.
8 changes: 4 additions & 4 deletions exponent.php
Expand Up @@ -7,7 +7,7 @@
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file thats holds the expRecord class
* The file that initializes everything
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
Expand Down Expand Up @@ -93,24 +93,24 @@

// Initialize permissions variables
exponent_permissions_initialize();
// initialize the expRouter
/**
* initialize the expRouter
* the routing/link/url object
* @global expRouter $router
* @name $router
*/
$router = new expRouter();

// initialize this users cart if they have ecomm installed.
/**
* initialize this users cart if they have ecomm installed.
* the shopping cart/order object
* @global order $order
* @name $order
*/
if (controllerExists('cart')) $order = order::getUserCart();

//Initialize the navigation heirarchy
/**
* Initialize the navigation hierarchy
* the list of sections/pages for the site
* @global array $sections
* @name $sections
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/banners/controllers/bannerController.php
Expand Up @@ -19,7 +19,7 @@

class bannerController extends expController {
//public $basemodel_name = '';
public $remove_configs = array('aggregation', 'comments', 'files','rss');
public $remove_configs = array('aggregation', 'comments', 'files','rss','tags');
public $useractions = array('showall'=>'Display Banner(s)');
public $codequality = 'beta';

Expand Down
2 changes: 1 addition & 1 deletion framework/modules/blog/controllers/blogController.php
Expand Up @@ -25,7 +25,7 @@ class blogController extends expController {
'dates'=>"Dates",
);

public $remove_configs = array('ealerts');
public $remove_configs = array('ealerts','tags');
//public $add_permissions = array('approve');
public $codequality = 'beta';

Expand Down
Expand Up @@ -26,7 +26,7 @@ class companyController extends expController {
'comments',
//'files',
'rss',
//'tags'
'tags'
);

function name() { return $this->displayname(); } //for backwards compat with old modules
Expand Down
Expand Up @@ -26,6 +26,7 @@ class filedownloadController extends expController {
'ealerts',
'files',
'rss',
'tags'
);
public $codequality = 'beta';

Expand Down
7 changes: 6 additions & 1 deletion install/pages/upgrade-1.php
Expand Up @@ -28,8 +28,13 @@
"); ?>
</p>
<p>
<?php //echo gt("
//Next, we'll <a href=\"http://docs.exponentcms.org/docs/current/install-tables\" target=\"_blank\">Install Tables</a>, and run through any upgrade scripts needed to bring your code and database up to date.
//"); ?>
<!--</p>-->
<!--<a class="awesome large green" href="?page=upgrade-2">--><?php //echo gt("Continue to Install Tables"); ?><!--</a>-->
<?php echo gt("
Next, we'll run through any upgrade scripts needed to bring your code and database up to date.
Next, we'll <a href=\"http://docs.exponentcms.org/docs/current/install-tables\" target=\"_blank\">Install Tables</a>, and run through any upgrade scripts needed to bring your code and database up to date.
"); ?>
</p>
<a class="awesome large green" href="?page=upgrade-3"><?php echo gt('Continue Upgrade') ?></a>
18 changes: 14 additions & 4 deletions install/pages/upgrade-2.php
Expand Up @@ -122,9 +122,11 @@
<tbody>
<?php
$row = "even";
$line = 0;
foreach ($tables as $table => $statusnum) {
if ($statusnum != TMP_TABLE_EXISTED) {
?>

<tr class="<?php echo $row ?>">
<td>
<?php echo gt($table) ?>
Expand Down Expand Up @@ -153,10 +155,18 @@
<?php } ?>
</td>
</tr>
<?php
$row = $row == "even" ? "odd" : "even";
} ?>
<?php
$row = $row == "even" ? "odd" : "even";
$line++;
}
?>
<tbody>
</table>
<?php
}
if ($line == 0) {
echo "<b>No Tables Were Changed!</b>";
}
?>

<a class="awesome large green" href="?page=upgrade-3"><?php echo gt('Continue Upgrade') ?></a>
50 changes: 47 additions & 3 deletions install/upgrades/clear_cache.php
Expand Up @@ -20,12 +20,56 @@ class clear_cache extends upgradescript {
protected $from_version = '1.99.0';
// protected $to_version = '1.99.2';

function name() { return "Clear the Cache"; }
function name() { return "Clear the Caches"; }

function upgrade() {
$files = exponent_theme_remove_smarty_cache();
return count($files['removed'])." files were removed from the cache.";
// work our way through all the tmp files and remove them
if (!defined('SYS_FILES')) include_once(BASE.'subsystems/files.php');
$files = array(
BASE.'tmp/cache',
// BASE.'tmp/css', // css cache??
BASE.'tmp/mail',
BASE.'tmp/minify', // minify cache
BASE.'tmp/pods',
BASE.'tmp/rsscache',
BASE.'tmp/views_c', // smarty cache
);

// delete the files.
$removed = 0;
$errors = 0;
foreach ($files as $file) {
$files = exponent_files_remove_files_in_directory($file);
$removed += count($files['removed']);
$errors += count($files['not_removed']);
}

// delete the entire img_cache and recreate the folder
if (file_exists(BASE.'tmp/img_cache')) $this->cleardir_recursive(BASE.'tmp/img_cache');

return "Caches were cleared.<br>".$errors." files could not be removed.";
}

/**
* recursively clear a directories contents, but leave the directory
* @param $dir
*/
function cleardir_recursive($dir) {
$files = scandir($dir);
array_shift($files); // remove '.' from array
array_shift($files); // remove '..' from array
foreach ($files as $file) {
if (substr($file, 0, 1) != '.') { // don't remove dot files
$file = $dir . '/' . $file;
if (is_dir($file)) {
cleardir_recursive($file);
rmdir($file);
} else {
unlink($file);
}
}
}
// rmdir($dir);
}
}

Expand Down
13 changes: 10 additions & 3 deletions install/upgrades/install_tables.php
Expand Up @@ -125,7 +125,9 @@ function upgrade() {
<tbody>
<?php
$row = "even";
$line = 0;
foreach ($tables as $table => $statusnum) {
if ($statusnum != TMP_TABLE_EXISTED) {
?>

<tr class="<?php echo $row ?>">
Expand Down Expand Up @@ -157,12 +159,17 @@ function upgrade() {
</td>
</tr>
<?php
$row = $row == "even" ? "odd" : "even";
} ?>
$row = $row == "even" ? "odd" : "even";
$line++;
}
?>
<tbody>
</table>
<?php
}
if ($line == 0) {
echo "<p class=\"success\">No Tables Were Changed!</p>";
}
}
}

?>
8 changes: 3 additions & 5 deletions install/upgrades/remove_headlinecontroller.php
Expand Up @@ -17,8 +17,9 @@
##################################################

class remove_headlinecontroller extends upgradescript {
protected $from_version = '1.99.0';
protected $to_version = '2.0.1';
// TODO next two lines are commented out to disable this script
// protected $from_version = '1.99.0';
// protected $to_version = '2.0.1';

function name() { return "Remove the (deprecated) Headline Controller"; }

Expand Down Expand Up @@ -79,9 +80,6 @@ function upgrade() {
$headlines_converted += 1;
}

// FIXME - remove when final
return "TEST - We're NOT removing the headline table nor the files yet...<br>".$modules_converted." Headline modules were converted.<br>".$headlines_converted." Headlines were converted.<br>";

// delete headline table
$db->dropTable('headline');

Expand Down

0 comments on commit c4044cd

Please sign in to comment.