<?php header("Content-Type: text/html;charset=utf-8"); require "../include/config.php"; require "../include/db.class.php"; require "../include/lib.class.php"; require "../include/config.class.php"; $DB = new MyPDO(DB_HOST, DB_USER, DB_PASS, DB_NAME); $config = new MyConfig(); $config->read();
<?php //Read configurations include 'include/config.php'; $config = MyConfig::read('include/settings.php'); $en_gram = $config['en_gram']; $lv_gram = $config['lv_gram']; $de_gram = $config['de_gram']; $fr_gram = $config['fr_gram']; //Get input data if ($_POST['src'] != '') { $src = $_POST['src']; } if ($_POST['srclang'] != '') { $srclang = $_POST['srclang']; } if ($_POST['trglang'] != '') { $trglang = $_POST['trglang']; } switch ($srclang) { case "English": $grammarFile = $en_gram; break; case "Latvian": $grammarFile = $lv_gram; break; case "German": $grammarFile = $de_gram; break; case "French": $grammarFile = $fr_gram;
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ require 'vendor/autoload.php'; require_once 'config/myconfig.php'; //Created MyConfig instance $myconfig = new MyConfig(); //Read db settings file $db_config = MyConfig::read('config/db_settings.php'); $whoops = new \Whoops\Run(); $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler()); $whoops->register(); //create a new "Capsule" manager instance use Illuminate\Database\Capsule\Manager as Capsule; $capsule = new Capsule(); $capsule->addConnection(['driver' => 'mysql', 'host' => 'localhost', 'database' => $db_config['db_name'], 'username' => $db_config['db_username'], 'password' => $db_config['db_password'], 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci']); // Set the event dispatcher used by Eloquent models... (optional) use Illuminate\Events\Dispatcher; use Illuminate\Container\Container; $capsule->setEventDispatcher(new Dispatcher(new Container())); // Make this Capsule instance available globally via static methods... (optional) $capsule->setAsGlobal(); // Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher()) $capsule->bootEloquent(); // SELECT * FROM `posts` WHERE `status`='published' //$results = Capsule::table('url')->get(); //$results = Capsule::select('select * from url where id = ?', array(1));