Having a little issue with Zephir. Maybe someone can shed some light on it here since there isn't a Zephir forum to post to???
I have an extension named classes. In my classes/classes/ directory I have two files: config.zep and database.zep. When I try to build my extension, it seems to stop on an odd issue I can't explain. For some background heres my config.zep file.
namespace Classes;
class Config {
protected static config = [];
public static function get(name, default_var = null) {
return isset(self::config[name]) ? self::config[name] : default_var;
}
public static function has(name) {
return array_key_exists(name, self::config);
}
public static function set(string name, value) {
let self::config[name] = value;
}
public static function add(parameters = []) {
let self::config = array_merge(self::config, parameters);
}
public static function getAll() {
return self::config;
}
public static function clear() {
let self::config = [];
}
}
In my database.zep file here's the start of the class (it's been gutted obviously) and it keeps have problems on my first function, the line with var db_ip
namespace Classes;
class Database {
public database;
public function connect(string override_db = '') -> void {
var db_ip = Config::get('db_ip');
var dbs = Config::get('dbs');
}
}
This is the error I get when trying to build my extension.
Zephir\ParseException: Syntax error in /root/zephir_proj/classes/classes/database.zep on line 20
var db_ip = Config::get('db_ip');
------------------------^
Any thoughts? I've try Classes\Config and it doesn't like that. I've tried including use Classes\Config as Config;
under the name space line and it blows up as well. I've tried many variations with no success on why I can't call Config::get(); I've even tried renameing that class to Setting and Settinger with no success. It keeps breaking in the same spot.