This commit is contained in:
Timothy Warren 2012-12-04 18:52:54 -05:00
parent 887dc7ff8d
commit 2004f6f383
5 changed files with 14 additions and 17 deletions

View File

@ -20,7 +20,7 @@ int main(int argc, char *argv[])
{
PHP_EMBED_START_BLOCK(argc,argv)
/* Change extension directory */
zend_alter_ini_entry("extension_dir", sizeof("extension_dir"), ".", sizeof("."), PHP_INI_ALL, PHP_INI_STAGE_RUNTIME);
zend_alter_ini_entry("extension_dir", sizeof("extension_dir"), "./", sizeof("./"), PHP_INI_ALL, PHP_INI_STAGE_RUNTIME);
zend_eval_string(" \
chdir(dirname($argv[0])); \
require ('OpenSQLManager.php'); \

View File

@ -36,7 +36,6 @@ define('OSM_RESOURCE_DIR', realpath(__DIR__.'/../Resources'));
define('OSM_SETTINGS_DIR', __DIR__);
define('OSM_PROGRAM_NAME', 'OpenSQLManager');
define('OSM_VERSION', '0.2.0pre');
echo OSM_RESOURCE_DIR . "\n";
// --------------------------------------------------------------------------
@ -52,7 +51,7 @@ function log_fatal()
$fatal = [E_ERROR, E_PARSE, E_RECOVERABLE_ERROR];
// Log error.
//if(in_array($error['type'], $fatal))
if(in_array($error['type'], $fatal))
{
file_put_contents('errors.txt', print_r($error, TRUE), FILE_APPEND);
}
@ -63,7 +62,7 @@ register_shutdown_function('OpenSQLManager\log_fatal');
// --------------------------------------------------------------------------
// Make sure wxphp works
if ( ! class_exists('wxApp'))
if ( ! extension_loaded('wxwidgets'))
{
// Try to load wxphp if possible
// Windows is special
@ -73,7 +72,7 @@ if ( ! class_exists('wxApp'))
}
else
{
$name .= 'wxwidgets.'.PHP_SHLIB_SUFFIX;
$name = 'wxwidgets.'.PHP_SHLIB_SUFFIX;
}
$res = dl($name);
@ -183,8 +182,7 @@ class OpenSQLManager extends \wxApp {
public function OnInit()
{
// The main Window object
$main = new Main();
$main->show();
(new Main())->show();
return 0;
}
@ -204,11 +202,8 @@ class OpenSQLManager extends \wxApp {
// Create the app instance
$app = new OpenSQLManager();
// Create platform information object
$platform = new \wxPlatformInfo();
// Define the platform for later use
define('PLATFORM', $platform->GetOperatingSystemId());
define('PLATFORM', (new \wxPlatformInfo())->GetOperatingSystemId());
// Start the wx event loop
\wxApp::SetInstance($app);

View File

@ -62,7 +62,7 @@ class Connection_Sidebar extends \wxPanel {
*
* @var wxListCtrl
*/
private $list;
public $list;
/**
* Reference to the image list control that holds connection images
@ -157,7 +157,11 @@ class Connection_Sidebar extends \wxPanel {
break;
case self::MENU_DELETE_CONNECT:
alert("Delete");
$res = confirm("Do you want to delete this item?");
if ($res)
{
print_r($event);
}
break;
default:

View File

@ -221,9 +221,6 @@ class Connection_Manager extends \wxFrame {
}
$this->settings->add_db($params->name, $params);
$this->parent->Update();
$this->Destroy();
}

View File

@ -156,7 +156,8 @@ class Main extends \wxFrame {
// Add the connection sidebar
$this->connection_sidebar =& Connection_Sidebar::get_instance($win);
$win2 = new Db_tabs($win);
$win2 = new Db_tabs($win);
$win2->add_tab('');
// Add the widgets to the split window
$win->SplitVertically($this->connection_sidebar, $win2);