Skip to content

Commit

Permalink
Merge pull request #185 from jphp-compiler/webserver-extension
Browse files Browse the repository at this point in the history
Implement webserver extension.
  • Loading branch information
dim-s committed Apr 23, 2015
2 parents 299915d + 5d65ac5 commit e0bb215
Show file tree
Hide file tree
Showing 52 changed files with 1,268 additions and 240 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ configure([
project(':jphp-gdx-ext'),
project(':jphp-mail-ext'),
project(':jphp-sql-ext'),
project(':jphp-webserver-ext'),

project(':jphp-android'),
project(':jphp-scripting'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.develnext.jphp.core.syntax.generators.manually;


import org.develnext.jphp.core.common.Separator;
import org.develnext.jphp.core.syntax.SyntaxAnalyzer;
import org.develnext.jphp.core.syntax.generators.ExprGenerator;
import org.develnext.jphp.core.syntax.generators.FunctionGenerator;
Expand All @@ -22,11 +23,8 @@
import org.develnext.jphp.core.tokenizer.token.stmt.FunctionStmtToken;
import php.runtime.common.Callback;
import php.runtime.common.Messages;
import org.develnext.jphp.core.common.Separator;
import php.runtime.env.TraceInfo;
import php.runtime.exceptions.ParseException;
import php.runtime.ext.core.classes.lib.PromiseUtils;
import php.runtime.reflection.support.ReflectionUtils;

import java.util.*;

Expand All @@ -40,9 +38,6 @@ public class SimpleExprGenerator extends Generator<ExprStmtToken> {
add("get_defined_vars");
add("eval");
}};
private static final Set<String> dynamicLocalClasses = new HashSet<String>(){{
add(ReflectionUtils.getClassName(PromiseUtils.class).toLowerCase());
}};

public SimpleExprGenerator(SyntaxAnalyzer analyzer) {
super(analyzer);
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/tests/resources/ext/standard/lib/num_001.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--FILE--
<?php

use php\lib\num;
use php\lib\Number as num;

var_dump(num::compare(3.1, 3));
var_dump(num::compare(3, 3));
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/tests/resources/ext/standard/lib/num_002.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--FILE--
<?php

use php\lib\num;
use php\lib\Number as num;

var_dump(num::toBin(100500));
var_dump(num::toHex(100500));
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/tests/resources/ext/standard/lib/num_003.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--FILE--
<?php

use php\lib\num;
use php\lib\Number as num;

var_dump(num::format(100500900.123456, '###,###', '.', ' '));
var_dump(num::format(100500900.123456, '###,###.000', '.', ' '));
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/tests/resources/ext/standard/lib/str_001.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--FILE--
<?php

use php\lib\str;
use php\lib\String as str;

echo "pos(Ob_foobar, ob) == " . str::pos('Ob_foobar', 'ob'), "\n";
echo "pos(Ob_foobar, ob, 4) == " . str::pos('Ob_foobar', 'ob', 7), "\n";
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/tests/resources/ext/standard/lib/str_002.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--FILE--
<?php

use php\lib\str;
use php\lib\String as str;


echo "equalsIgnoreCase(foo, foo) == " . str::equalsIgnoreCase('foo', 'foo'), "\n";
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/tests/resources/ext/standard/lib/str_003.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--FILE--
<?php

use php\lib\str;
use php\lib\String as str;

echo "length(foobar) == " . str::length('foobar'), "\n";
echo "lower(FOObar) == " . str::lower('FOObar'), "\n";
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/tests/resources/ext/standard/lib/str_004.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--FILE--
<?php

use php\lib\str;
use php\lib\String as str;

echo "--test-split\n";
echo "split('f,o,o,b,a,r', ',') == "; var_dump(str::split('f,o,o,b,a,r', ','));
Expand Down
49 changes: 42 additions & 7 deletions jphp-runtime/src/main/resources/JPHP-INF/sdk/php/io/Stream.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ namespace php\io;

use Iterator;

abstract class Stream {
abstract class Stream
{
/**
* @var string
*/
Expand Down Expand Up @@ -79,18 +80,24 @@ abstract class Stream {
* @param null|string $mode
* @return Stream
*/
public function __construct($path, $mode = null){ }
public function __construct($path, $mode = null)
{
}

/**
* @param $context
* @return void
*/
public function setContext($context) { }
public function setContext($context)
{
}

/**
* @return mixed
*/
public function getContext(){ }
public function getContext()
{
}


/**
Expand All @@ -99,16 +106,44 @@ abstract class Stream {
* @return Stream
* @throws IOException
*/
public static function of($path, $mode = 'r') { }
public static function of($path, $mode = 'r')
{
}

/**
* Create a stream, call and return the result of the readFully() method, finally call the close() method.
* @param string $path
* @param string $mode
* @return string binary
* @throws IOException
*/
public static function getContents($path, $mode = 'r')
{
}

/**
* Create a stream, call and return the result of the write() method, finally call the close() method.
* @param string $path
* @param string $data
* @param string $mode
* @throws IOException
*/
public static function putContents($path, $data, $mode = 'w+')
{
}

/**
* @param string $protocol
* @param string $className
*/
public static function register($protocol, $className) { }
public static function register($protocol, $className)
{
}

/**
* @param $protocol
*/
public static function unregister($protocol) { }
public static function unregister($protocol)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ final class System {
*/
public static function gc() { }

/**
* @return string[]
*/
public static function getEnv() { }

/**
* Gets a system property by name
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Class Binary
* @package php
*/
class bin {
class Binary {

private function __construct() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Class num
* @package php\lib
*/
class num {
class Number {

private function __construct() { }

Expand Down
Loading

0 comments on commit e0bb215

Please sign in to comment.