Skip to content

Commit

Permalink
PHPDocumentor configuration file to create Exponent API Documentation…
Browse files Browse the repository at this point in the history
…. It's assumed you have a fully functional installation of PHPDocumentor. Simply 'cd' to the project folder and run 'phpdoc' (shell or via php) with the '-c' command and the config name 'phpdoc.ini' e.g., 'phpdoc -c phpdoc.ini'

Produces the api documentation in a folder adjacent to the project named 'exponent-cms-doc', however this is all controlled from within the phpdoc.ini config file.
This is an initial implementation and SHOULD run on all OS's and also the PHPDocumentor web interface, BUT was only tested on Win7 Shell
  • Loading branch information
dleffler committed Jun 16, 2011
1 parent 273a3b4 commit 0edd4b2
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 87 deletions.
65 changes: 46 additions & 19 deletions install/include/upgradescript.php
@@ -1,29 +1,48 @@
<?php
##################################################
#
# Copyright (c) 2007-2008 OIC Group, Inc.
# Written and Designed by Adam Kessler
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/**
* This file is part of Exponent
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file that holds the upgradescript class
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
* @copyright 2004-2011 OIC Group, Inc.
* @author Adam Kessler <adam@oicgroup.net>
* @version 2.0.0
*/

/**
* This is the class upgradescript
*
* @subpackage Upgrade
* @package Installation
*/
class upgradescript {
protected $from_version = '9999.99.99'; //set this ridiculously high so that it NEVER runs
protected $to_version = '9999.99.99'; //set this to something ridiculously high so it always runs
protected $from_version = '9999.99.99'; //set this default ridiculously high so that it NEVER runs
protected $to_version = '9999.99.99'; //set this default to something ridiculously high so it always runs

/**
* name/title of upgrade script
* @return string
*/
function name() { return "Base Model for the Upgrade Scripts"; }

/**
* generic description of upgrade script
* @return string
*/
function description() { return "This Script attempts to ".$this->name(); }

/**
* test version number (code vs database) to see if upgrade script should be run
* @param $version
* @return bool
*/
function checkVersion($version) {
// if this upgrade applies to only one version then check to see if we have a match
if ($this->from_version == $this->to_version && $version == $this->from_version) {
Expand All @@ -35,10 +54,18 @@ function checkVersion($version) {
}
}

/**
* additional test(s) to see if upgrade script should be run
* @return bool
*/
function needed() {
return true;
return false; // subclasses MUST return true to be run
}

/**
* main routine of upgrade script to upgrade Exponent
* @return bool
*/
function upgrade() {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion install/pages/upgrade-1.php
Expand Up @@ -34,7 +34,7 @@
<!--</p>-->
<!--<a class="awesome large green" href="?page=upgrade-2">--><?php //echo gt("Continue to Install Tables"); ?><!--</a>-->
<?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.
Next, we'll 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>
54 changes: 38 additions & 16 deletions install/upgrades/clear_cache.php
@@ -1,27 +1,49 @@
<?php
##################################################
#
# Copyright (c) 2007-2008 OIC Group, Inc.
# Written and Designed by Adam Kessler
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/**
* This file is part of Exponent
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file that holds the clear_cache class
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
* @copyright 2004-2011 OIC Group, Inc.
* @author Adam Kessler <adam@oicgroup.net>
* @version 2.0.0
*/

/**
* This is the class clear_cache
*
* @subpackage Upgrade
* @package Installation
*/
class clear_cache extends upgradescript {
protected $from_version = '1.99.0';
// protected $to_version = '1.99.2';

/**
* name/title of upgrade script
* @return string
*/
function name() { return "Clear the Caches"; }

/**
* additional test(s) to see if upgrade script should be run
* @return bool
*/
function needed() {
return true;
}

/**
* cleans out all the cache folders
* @return bool
*/
function upgrade() {
// work our way through all the tmp files and remove them
if (!defined('SYS_FILES')) include_once(BASE.'subsystems/files.php');
Expand Down
54 changes: 38 additions & 16 deletions install/upgrades/install_tables.php
@@ -1,27 +1,49 @@
<?php
##################################################
#
# Copyright (c) 2007-2008 OIC Group, Inc.
# Written and Designed by Adam Kessler
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/**
* This file is part of Exponent
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file that holds the install_tables class
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
* @copyright 2004-2011 OIC Group, Inc.
* @author Adam Kessler <adam@oicgroup.net>
* @version 2.0.0
*/

/**
* This is the class install_tables
*
* @subpackage Upgrade
* @package Installation
*/
class install_tables extends upgradescript {
protected $from_version = '0.96.3';
// protected $to_version = '1110.97.0'; //set this to something ridiculously high so it always runs

/**
* name/title of upgrade script
* @return string
*/
function name() { return "Upgrade Database Tables"; }

/**
* additional test(s) to see if upgrade script should be run
* @return bool
*/
function needed() {
return true;
}

/**
* updates all database tables to current schema
* @return bool
*/
function upgrade() {
global $db;
?>
Expand Down
63 changes: 44 additions & 19 deletions install/upgrades/remove_headlinecontroller.php
@@ -1,30 +1,55 @@
<?php
##################################################
#
# Copyright (c) 2007-2008 OIC Group, Inc.
# Written and Designed by Adam Kessler
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/**
* This file is part of Exponent
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file that holds the remove_headlinecontroller class
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
* @copyright 2004-2011 OIC Group, Inc.
* @author Adam Kessler <adam@oicgroup.net>
* @version 2.0.0
*/

/**
* This is the class remove_headlinecontroller
*
* @subpackage Upgrade
* @package Installation
*/
class remove_headlinecontroller extends upgradescript {
// TODO next two lines are commented out to disable this script
// protected $from_version = '1.99.0';
// protected $to_version = '2.0.1';
protected $from_version = '1.99.0';
protected $to_version = '2.0.1';

/**
* name/title of upgrade script
* @return string
*/
function name() { return "Remove the (deprecated) Headline Controller"; }

/**
* generic description of upgrade script
* @return string
*/
function description() { return "Beginning with Exponent 2.0.0 Beta4, the Headline Controller is replaced by the Text Controller. This Script converts headline modules to text modules and then deletes the headlines"; }

/**
* additional test(s) to see if upgrade script should be run
* @return bool
*/
function needed() {
return false; // TODO this line is set to false to disable this sample script
}

/**
* coverts all headline modules/items into text modules/items and deletes headline controller files
* @return bool
*/
function upgrade() {
global $db;

Expand Down
54 changes: 38 additions & 16 deletions install/upgrades/version_tracking.php
@@ -1,29 +1,47 @@
<?php
##################################################
#
# Copyright (c) 2007-2008 OIC Group, Inc.
# Written and Designed by Adam Kessler
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/**
* This file is part of Exponent
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file that holds the version_tracking class
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
* @copyright 2004-2011 OIC Group, Inc.
* @author Adam Kessler <adam@oicgroup.net>
* @version 2.0.0
*/

/**
* This is the class version_tracking
*
* @subpackage Upgrade
* @package Installation
*/
class version_tracking extends upgradescript {
protected $from_version = '1.99.0';
// protected $to_version = '99';

/**
* name/title of upgrade script
* @return string
*/
function name() { return "Install Version Tracking"; }

/**
* generic description of upgrade script
* @return string
*/
function description() { return "Beginning with Exponent 2.0.0 Beta3, the system begins keeping track of its versions and upgrades."; }

/**
* additional test(s) to see if upgrade script should be run
* @return bool
*/
function needed($version) {
global $db;

Expand All @@ -32,6 +50,10 @@ function needed($version) {
return ($ver->version <= $version) ? true : false;
}

/**
* adds or updates version tracking information in database
* @return bool
*/
function upgrade() {
global $db;
// $version = EXPONENT_VERSION_MAJOR.'.'.EXPONENT_VERSION_MINOR.'.'.EXPONENT_VERSION_REVISION.'-'.EXPONENT_VERSION_TYPE.''.EXPONENT_VERSION_ITERATION;
Expand Down

0 comments on commit 0edd4b2

Please sign in to comment.