function get($args, $opts=array())
{
-
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
$this->checkSystem();
echo "Checi options\n";
$this->checkOpts($opts);
-
+ $response = $this->curl("http://localhost{$this->local_base_url}/Core/UpdateDatabase/VerifyExtensions");
+ $json = json_decode($response, true);
+
+ if(empty($json['data']) || $json['data'] != 'DONE'){
+ echo $response. "\n";
+ echo "Please install the above extensions and restart the apache.\n";
+ exit;
+ }
// do this first, so the innodb change + utf8 fixes column max sizes
}
HTML_FlexyFramework::get()->generateDataobjectsCache(true);
-
$this->updateDataEnums();
$this->updateDataGroups();
$this->updateDataCompanies();
$c = DB_DataObject::Factory('I18n');
$c->buildDB();
-
-
-
-
}
function fixMysqlInnodb()
<?php
-require_once 'Pman_Core_UpdateDatabase';
+require_once 'Pman.php';
-class VerifyExtensions extends Pman_Core_UpdateDatabase
+class Pman_Core_UpdateDatabase_VerifyExtensions extends Pman
{
+ static $cli_opts = array(
+
+ );
+
+ function getAuth()
+ {
+ return true;
+ }
+
function get($base, $opts = array())
{
- print_r($this->required_extensions);exit;
+ $extensions = $error = array();
+
+ $ff = HTML_FlexyFramework::get();
+
+ foreach($this->modulesList() as $m) {
+
+ $fd = $ff->rootDir. "/Pman/$m/UpdateDatabase.php";
+
+ if (!file_exists($fd)) {
+ continue;
+ }
+ require_once $fd;
+ $cls = new ReflectionClass('Pman_'. $m . '_UpdateDatabase');
+ $props = $cls->getDefaultProperties();
+
+ if(!empty($props['required_extensions'])) {
+ $extensions = array_merge($extensions, $props['required_extensions']);
+ }
+ }
+
+ foreach ($extensions as $e){
+
+ if(extension_loaded($e)) {
+ continue;
+ }
+
+ $error[] = "Error: Please install php extension: {$e}";
+ }
+
+ if(!empty($error)) {
+ $this->jerr($error);
+ }
+
+ $this->jok("DONE");
+
}
}
\ No newline at end of file