diff --git a/.gitignore b/.gitignore index a424021..da38a8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Ignore the stupid .DS_Store files +# Ignore stupid files and build-specific files *.DS_Store settings.json errors.txt @@ -7,4 +7,5 @@ test_config.json nbproject/* *.o *.app/* -OpenSQLManager \ No newline at end of file +OpenSQLManager +*.app* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c445e22..a416838 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,9 @@ before_script: - sh -c "psql -c 'create database test;' -U postgres" - sh -c "mysql -e 'create database IF NOT EXISTS test;'" - git submodule update --init - - cd sys/db + - cd src/sys/db - git checkout master - git pull origin master - - cd ../../ + - cd ../../../ script: php ./tests/index.php \ No newline at end of file diff --git a/OpenSQLManager.c b/OpenSQLManager.c index e10e581..bf7add3 100644 --- a/OpenSQLManager.c +++ b/OpenSQLManager.c @@ -20,6 +20,8 @@ int main(int argc, char *argv[]) { PHP_EMBED_START_BLOCK(argc,argv) zend_eval_string(" \ + $name = 'wxwidgets.'.PHP_SHLIB_SUFFIX; \ + dl($name); \ chdir(dirname($argv[0])); \ require ('OpenSQLManager.php'); \ ", NULL, "TEST" TSRMLS_CC); diff --git a/build_osx_bundle.php b/build_osx_bundle.php index 6697e1a..94b647d 100644 --- a/build_osx_bundle.php +++ b/build_osx_bundle.php @@ -1,7 +1,9 @@ $sub_folder) + { + // Folder with subfolders + if (is_array($sub_folder)) + { + $new_path = "{$path}/{$folder}"; + if ( ! is_dir($new_path)) mkdir($new_path); + call_user_func(__FUNCTION__, $sub_folder, $new_path); + } + else + { + $new_path = "{$path}/{$sub_folder}"; + if ( ! is_dir($new_path)) mkdir($new_path); + } + } +} + /** * Create bundle folder structure */ function create_dirs() { - if ( ! is_dir(APP_PATH)) mkdir(APP_PATH); - - if ( ! is_dir(CONTENTS)) - { - mkdir(CONTENTS); - //mkdir(CONTENTS.'/Frameworks'); - } - - if ( ! is_dir(RESOURCES)) - { - mkdir(RESOURCES); - mkdir(RESOURCES.'/images'); - } + $dir_tree = [ + 'OpenSQLManager.app' => [ + 'Contents' => [ + 'Frameworks', + 'Resources' => [ + 'images' + ], + 'MacOS' => [ + 'sys' => [ + 'common', + 'db' => [ + 'classes', + 'drivers' => [ + 'mysql', + 'pgsql', + 'sqlite', + 'odbc', + 'firebird' + ] + ], + 'widgets', + 'windows' + ] + ] + ] + ] + ]; - if ( ! is_dir(MAC_OS)) - { - mkdir(MAC_OS); - mkdir(MAC_OS.'/sys'); - mkdir(MAC_OS.'/sys/common'); - mkdir(MAC_OS.'/sys/db'); - mkdir(MAC_OS.'/sys/widgets'); - mkdir(MAC_OS.'/sys/windows'); - mkdir(MAC_OS.'/sys/db/classes'); - mkdir(MAC_OS.'/sys/db/drivers'); - mkdir(MAC_OS.'/sys/db/drivers/mysql'); - mkdir(MAC_OS.'/sys/db/drivers/pgsql'); - mkdir(MAC_OS.'/sys/db/drivers/sqlite'); - mkdir(MAC_OS.'/sys/db/drivers/odbc'); - mkdir(MAC_OS.'/sys/db/drivers/firebird'); - } + make_dir_tree($dir_tree); } /** @@ -82,7 +109,7 @@ function copy_src() // Drop to shell because php treats it as text $src = __DIR__.'/OpenSQLManager'; $dest = MAC_OS; - `cp {$src} {$dest}`; + `mv {$src} {$dest}`; $raw_src_files = glob_recursive(SRC_DIR.'/*.php'); $src_files = array(); @@ -119,13 +146,6 @@ function copy_src() // Copy the files copy($resource, $new_rs); } - - // Copy frameworks - /*if (is_dir('/Library/Frameworks/Firebird.Framework')) - { - $new_path = FRAMEWORKS; - `cp -R /Library/Frameworks/Firebird.framework/ {$new_path}/Firebird.framework`; - }*/ } /** @@ -136,30 +156,30 @@ function create_plist() $version = VERSION; $plist = << - !DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> - - - CFBundleGetInfoString - App for managing databases. - CFBundleExecutable - OpenSQLManager - CFBundleIdentifier - com.aviat4ion.OpenSQLManager - CFBundleName - OpenSQLManager - CFBundleIconFile - OpenSQLManager.icns - CFBundleShortVersionString - {$version} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - LSMinimumSystemVersion - 10.6.0 - - + + + + + CFBundleGetInfoString + App for managing databases. + CFBundleExecutable + OpenSQLManager + CFBundleIdentifier + com.aviat4ion.OpenSQLManager + CFBundleName + OpenSQLManager + CFBundleIconFile + OpenSQLManager.icns + CFBundleShortVersionString + {$version} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + LSMinimumSystemVersion + 10.6.0 + + XML; // Add the plist to the bundle diff --git a/makefile b/makefile index 641c023..c779543 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,4 @@ CFLAGS = -c `/opt/php-embed/bin/php-config --includes` -Wall -g - LDFLAGS = -L/Library/Frameworks/Firebird.framework/Libraries -L/opt/php-embed/lib -lphp5 `/opt/php-embed/bin/php-config --libs` all: OpenSQLManager.c @@ -11,4 +10,6 @@ release: OpenSQLManager.c ${CC} -Os -o OpenSQLManager OpenSQLManager.o ${LDFLAGS} clean: - rm -f OpenSQLManager.o \ No newline at end of file + rm -f OpenSQLManager.o + rm -f OpenSQLManager + rm -rf OpenSQLManager.app \ No newline at end of file diff --git a/resources/OpenSQLManager.icns b/resources/OpenSQLManager.icns index c049fdf..ebb6ec5 100644 Binary files a/resources/OpenSQLManager.icns and b/resources/OpenSQLManager.icns differ diff --git a/resources/OpenSQLManager.ico b/resources/OpenSQLManager.ico new file mode 100644 index 0000000..d9e3f2a Binary files /dev/null and b/resources/OpenSQLManager.ico differ diff --git a/resources/OpenSQLManager.png b/resources/OpenSQLManager.png new file mode 100644 index 0000000..ac5b9d8 Binary files /dev/null and b/resources/OpenSQLManager.png differ