use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.
the class PSqlDriverManager method getPool.
@Signature
public static PSqlConnectionPool getPool(Environment env, String url, String driverName, @Nullable Properties properties) throws SQLException {
HikariConfig config = new HikariConfig(properties == null ? new Properties() : properties);
if (config.getDataSourceClassName() == null) {
config.setDataSourceClassName(dataSourceClasses.get(driverName));
}
HikariDataSource pool = new HikariDataSource(config);
pool.setDriverClassName(_getDriverClass(driverName));
pool.setJdbcUrl("jdbc:" + url);
return new PSqlConnectionPool(env, pool);
}
use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.
the class ReflectionFunctionAbstract method getExtension.
@Signature
public Memory getExtension(Environment env, Memory... args) {
if (getClosureEntity() != null)
return Memory.NULL;
Extension extension = getEntity().getExtension();
if (extension == null)
return Memory.NULL;
else {
ReflectionExtension ext = new ReflectionExtension(env, env.fetchClass("ReflectionExtension"));
ext.setExtension(extension);
return new ObjectMemory(ext);
}
}
use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.
the class WrapConfiguration method getArray.
@Signature
public Memory getArray(String key, ArrayMemory def) {
if (has(key)) {
Memory memory = get(key);
String[] split = StringUtils.split(memory.toString(), '|');
ArrayMemory result = new ArrayMemory();
for (String s : split) {
result.add(s.trim());
}
return result.toConstant();
} else {
return def;
}
}
use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.
the class FsUtils method hasExt.
@Signature
public static boolean hasExt(Environment env, String path, Memory extensions, boolean ignoreCase) {
Set<String> exts = new HashSet<>();
if (extensions.isTraversable()) {
ForeachIterator iterator = extensions.getNewIterator(env);
while (iterator.next()) {
String value = iterator.getValue().toString();
if (ignoreCase) {
value = value.toLowerCase();
}
exts.add(value);
}
} else {
exts.add(ignoreCase ? extensions.toString().toLowerCase() : extensions.toString());
}
String ext = ext(path);
if (ignoreCase && ext != null) {
ext = ext.toLowerCase();
}
return exts.contains(ext);
}
use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.
the class WrapDomElement method getAttributes.
@Signature
public ArrayMemory getAttributes() {
NamedNodeMap attributes = getWrappedObject().getAttributes();
ArrayMemory result = new ArrayMemory();
for (int i = 0; i < attributes.getLength(); i++) {
Attr item = (Attr) attributes.item(i);
result.putAsKeyString(item.getName(), StringMemory.valueOf(item.getValue()));
}
return result.toConstant();
}
Aggregations