Content-Length: 545412 | pFad | http://github.com/MaticSulc/revolution/commit/5de99e143ef50a34e077b9e54778ab0ffd4209f9

EC Fix new installations on xPDO 3.x · MaticSulc/revolution@5de99e1 · GitHub
Skip to content

Commit

Permalink
Fix new installations on xPDO 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
opengeek committed Nov 21, 2015
1 parent 42fda7a commit 5de99e1
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 22 deletions.
5 changes: 5 additions & 0 deletions core/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
This file shows the changes in recent releases of MODX. The most current release is usually the
development release, and is only shown to give an idea of what's currently in the pipeline.

MODX Revolution 3.0.0-beta1 (TBD)
====================================
- Update to xPDO 3.x via Composer


MODX Revolution 2.4.1-pl (September 23, 2015)
====================================
- Update PHPMailer to v5.2.13
Expand Down
8 changes: 4 additions & 4 deletions core/docs/version.inc.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
$v= array ();
$v['version']= '2'; // Current version.
$v['major_version']= '4'; // Current major version.
$v['minor_version']= '1'; // Current minor version.
$v['patch_level']= 'pl'; // Current patch level.
$v['version']= '3'; // Current version.
$v['major_version']= '0'; // Current major version.
$v['minor_version']= '0'; // Current minor version.
$v['patch_level']= 'dev'; // Current patch level.
$v['code_name']= 'Revolution'; // Current codename.
$v['distro']= '@git@';
$v['full_version']= $v['version'] . ($v['major_version'] ? ".{$v['major_version']}" : ".0") . ($v['minor_version'] ? ".{$v['minor_version']}" : ".0") . ($v['patch_level'] ? "-{$v['patch_level']}" : "");
Expand Down
5 changes: 1 addition & 4 deletions core/xpdo/xPDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@
* file that was distributed with this source code.
*/

class xPDO extends \xPDO\xPDO
{

}
class_alias('xPDO\xPDO', 'xPDO');
2 changes: 1 addition & 1 deletion setup/controllers/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

$install->getConnection();

if (!is_object($install->xpdo) || !($install->xpdo instanceof xPDO)) {
if (!is_object($install->xpdo) || !($install->xpdo instanceof \xPDO\xPDO)) {
$errors['message'] = $install->lexicon('xpdo_err_ins');
} else if (!$install->xpdo->connect()) {
/* allow this to pass for new installs only; will attempt to create during installation */
Expand Down
2 changes: 1 addition & 1 deletion setup/includes/config.core.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', MODX_INSTALL_PATH . 'core/');
if (!defined('MODX_CONFIG_KEY')) define('MODX_CONFIG_KEY', 'config');
if (!defined('MODX_CONFIG_KEY')) define ('MODX_CONFIG_KEY', 'revo_3_x');
define ('MODX_SETUP_KEY', '@git@');
2 changes: 2 additions & 0 deletions setup/includes/error/modinstallerror.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/

use xPDO\Om\xPDOObject;

/**
* Abstract error handler for request processing.
*
Expand Down
3 changes: 2 additions & 1 deletion setup/includes/modinstall.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ public function getInstallMode() {
* @return xPDO The xPDO instance to be used by the installation.
*/
public function _connect($dsn, $user = '', $password = '', $prefix = '', array $options = array()) {
if (class_exists('\\xPDO\\xPDO')) {
require_once MODX_CORE_PATH . 'vendor/autoload.php';
if (class_exists('\xPDO\xPDO')) {
$this->xpdo = new xPDO($dsn, $user, $password, array_merge(array(
xPDO::OPT_CACHE_PATH => MODX_CORE_PATH . 'cache/',
xPDO::OPT_TABLE_PREFIX => $prefix,
Expand Down
5 changes: 4 additions & 1 deletion setup/includes/request/modinstallclirequest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once strtr(realpath(MODX_SETUP_PATH.'includes/request/modinstallrequest.class.php'),'\\','/');

use xPDO\xPDO;

/**
* modInstallCLIRequest
*
Expand Down Expand Up @@ -303,7 +306,7 @@ public function checkDatabase() {
$this->end($this->install->lexicon('db_err_create_database'));
} else {
$xpdo = $this->install->getConnection($mode);
if (!is_object($xpdo) || !($xpdo instanceof xPDO)) {
if (!is_object($xpdo) || !($xpdo instanceof \xPDO\xPDO)) {
$this->end($this->install->lexicon('xpdo_err_ins'));
}
}
Expand Down
4 changes: 2 additions & 2 deletions setup/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@

/* check for compatible PHP version */
define('MODX_SETUP_PHP_VERSION', phpversion());
$php_ver_comp = version_compare(MODX_SETUP_PHP_VERSION, '5.1.1');
$php_ver_comp = version_compare(MODX_SETUP_PHP_VERSION, '5.4.0');
if ($php_ver_comp < 0) {
die('<html><head><title></title></head><body><h1>FATAL ERROR: MODX Setup cannot continue.</h1><p>Wrong PHP version! You\'re using PHP version '.MODX_SETUP_PHP_VERSION.', and MODX requires version 5.1.1 or higher.</p></body></html>');
die('<html><head><title></title></head><body><h1>FATAL ERROR: MODX Setup cannot continue.</h1><p>Wrong PHP version! You\'re using PHP version '.MODX_SETUP_PHP_VERSION.', and MODX requires version 5.4.0 or higher.</p></body></html>');
}

/* make sure json extension is available */
Expand Down
4 changes: 2 additions & 2 deletions setup/processors/connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
define('MODX_INSTALL_PATH', $installPath);

if (!@include(MODX_SETUP_PATH . 'includes/config.core.php')) die('Error loading core files!');
require_once MODX_CORE_PATH . 'xpdo/xpdo.class.php';
require_once MODX_CORE_PATH . 'vendor/autoload.php';
require_once MODX_SETUP_PATH . 'includes/modinstall.class.php';

$install = new modInstall();
Expand All @@ -29,4 +29,4 @@
$install->getService('request','request.modInstallConnectorRequest');
$install->request->handle();
@session_write_close();
exit();
exit();
6 changes: 3 additions & 3 deletions setup/processors/database/collation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/* get an instance of xPDO using the install settings */
$xpdo = $install->getConnection($mode);
$dbExists = false;
if (!is_object($xpdo) || !($xpdo instanceof xPDO)) {
if (!is_object($xpdo) || !($xpdo instanceof \xPDO\xPDO)) {
$this->error->failure($install->lexicon('xpdo_err_ins'));
}

Expand Down Expand Up @@ -50,7 +50,7 @@
$this->error->failure($install->lexicon('db_err_create_database'), $errors);
} else {
$xpdo = $install->getConnection($mode);
if (!is_object($xpdo) || !($xpdo instanceof xPDO)) {
if (!is_object($xpdo) || !($xpdo instanceof \xPDO\xPDO)) {
$this->error->failure($install->lexicon('xpdo_err_ins'), $errors);
}
$xpdo->setLogTarget(array(
Expand Down Expand Up @@ -84,4 +84,4 @@
$this->error->failure($install->lexicon('test_table_prefix_nf'), $errors);
}

$this->error->success($install->lexicon('db_success'), $data);
$this->error->success($install->lexicon('db_success'), $data);
6 changes: 3 additions & 3 deletions setup/processors/database/connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

$errors = array();
$dbExists = false;
if (!is_object($xpdo) || !($xpdo instanceof xPDO)) {
if (!is_object($xpdo) || !($xpdo instanceof \xPDO\xPDO)) {
if (is_bool($xpdo)) {
$this->error->failure($install->lexicon('xpdo_err_ins'));
} else {
Expand All @@ -52,7 +52,7 @@
,$install->settings->get('database_password')
,$install->settings->get('table_prefix')
);
if (!is_object($xpdo) || !($xpdo instanceof xPDO)) {
if (!is_object($xpdo) || !($xpdo instanceof \xPDO\xPDO)) {
$this->error->failure($install->lexicon('xpdo_err_ins'), $errors);
}
$xpdo->setLogTarget(array(
Expand Down Expand Up @@ -111,4 +111,4 @@
'database_collation' => $data['collation'],
));

$this->error->success($install->lexicon('db_success'), $data);
$this->error->success($install->lexicon('db_success'), $data);

0 comments on commit 5de99e1

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/MaticSulc/revolution/commit/5de99e143ef50a34e077b9e54778ab0ffd4209f9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy