cubrid-setup.sh 823 Bytes
Newer Older
1 2
#!/bin/sh
#
3
# install CUBRID DBMS
4

Carsten Brandt committed
5 6 7 8 9
if (php --version | grep -i HHVM > /dev/null); then
    echo "Skipping CUBRID on HHVM"
    exit 0
fi

10 11
# cubrid dbms
echo 'yes' | sudo add-apt-repository ppa:cubrid/cubrid
12
sudo apt-get update
13 14 15
sudo apt-get install cubrid
/etc/profile.d/cubrid.sh
sudo apt-get install cubrid-demodb
16

17
# cubrid pdo
18 19 20 21 22 23 24 25 26 27 28 29 30
install_pdo_cubrid() {
    wget "http://pecl.php.net/get/PDO_CUBRID-9.2.0.0001.tgz" &&
    tar -zxf "PDO_CUBRID-9.2.0.0001.tgz" &&
    sh -c "cd PDO_CUBRID-9.2.0.0001 && phpize && ./configure && make && sudo make install"

    echo "extension=pdo_cubrid.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

    return $?
}

install_pdo_cubrid > ~/pdo_cubrid.log || ( echo "=== PDO CUBRID BUILD FAILED ==="; cat ~/pdo_cubrid.log )

echo "Installed CUBRID `dpkg -s cubrid |grep Version`"