Skip to content

Commit

Permalink
update class name from JsonNet to Jsonnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeke committed May 27, 2018
1 parent b96cef8 commit e276b0b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion CREDITS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
JsonNet
Jsonnet
Chitao Gao ( [email protected] )
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ var_dump(Jsonnet::evaluateSnippet($Snippet));
```
/usr/local/php/php-7.0.6-zts-debug/bin/php --re jsonnet
Extension [ <persistent> extension #40 Jsonnet version v1.3.0 ] {
Extension [ <persistent> extension #40 Jsonnet version v1.3.1 ] {
- Constants [2] {
Constant [ string JSONNET_PHP_VERSION ] { v1.3.0 }
Constant [ string JSONNET_PHP_VERSION ] { v1.3.1 }
Constant [ string JSONNET_PHP_AUTHOR ] { Chitao.Gao [ [email protected] ] }
}
Expand Down
6 changes: 3 additions & 3 deletions include/Jsonnet.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
| JsonNet |
| Jsonnet |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license, |
| that is bundled with this package in the file LICENSE, and is |
Expand All @@ -27,8 +27,8 @@
#include "Zend/zend_exceptions.h"
#include "php7_wrapper.h"

#define JSONNET_RES_NAME "JsonNet"
#define JSONNET_PHP_VERSION "v1.3.0"
#define JSONNET_RES_NAME "Jsonnet"
#define JSONNET_PHP_VERSION "v1.3.1"
#define JSONNET_PHP_AUTHOR "Chitao.Gao [ [email protected] ]"

#define SL_S(s) s, sizeof(s) - 1
Expand Down
2 changes: 1 addition & 1 deletion include/php7_wrapper.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
| JsonNet |
| Jsonnet |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license, |
| that is bundled with this package in the file LICENSE, and is |
Expand Down
28 changes: 14 additions & 14 deletions jsonnet.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
| JsonNet |
| Jsonnet |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license, |
| that is bundled with this package in the file LICENSE, and is |
Expand Down Expand Up @@ -132,11 +132,11 @@ PHP_RSHUTDOWN_FUNCTION(jsonnet)
PHP_MINFO_FUNCTION(jsonnet)
{
php_info_print_table_start();
php_info_print_table_header(2, "JsonNet support", "Enabled");
php_info_print_table_row(2, "JsonNet LibJsonNet Information", LIB_JSONNET_VERSION);
php_info_print_table_row(2, "JsonNet Version", JSONNET_PHP_VERSION);
php_info_print_table_row(2, "JsonNet Author", JSONNET_PHP_AUTHOR);
php_info_print_table_row(2, "JsonNet Supports", "https://github.com/Neeke/Jsonnet-PHP");
php_info_print_table_header(2, "Jsonnet support", "Enabled");
php_info_print_table_row(2, "Jsonnet LibJsonnet Information", LIB_JSONNET_VERSION);
php_info_print_table_row(2, "Jsonnet Version", JSONNET_PHP_VERSION);
php_info_print_table_row(2, "Jsonnet Author", JSONNET_PHP_AUTHOR);
php_info_print_table_row(2, "Jsonnet Supports", "https://github.com/Neeke/Jsonnet-PHP");
php_info_print_table_end();

DISPLAY_INI_ENTRIES();
Expand Down Expand Up @@ -208,15 +208,15 @@ PHP_METHOD(JSONNET_RES_NAME, evaluateFile)
{
JSONNET_ZVAL_PTR_DTOR(result);
JSONNET_ZVAL_PTR_DTOR(resultZval);
zend_throw_exception(php_com_exception_class_entry, "JsonNet::evaluateFile #error", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::evaluateFile #error", CODE_ERROR TSRMLS_CC);
return;
}

JSONNET_ZVAL_PTR_DTOR(result);
RETURN_ZVAL(resultZval,1,1);
}

zend_throw_exception(php_com_exception_class_entry, "JsonNet::evaluateFile('filePath'), filePath is null", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::evaluateFile('filePath'), filePath is null", CODE_ERROR TSRMLS_CC);
}

PHP_METHOD(JSONNET_RES_NAME, evaluateSnippet)
Expand Down Expand Up @@ -263,15 +263,15 @@ PHP_METHOD(JSONNET_RES_NAME, evaluateSnippet)
{
JSONNET_ZVAL_PTR_DTOR(result);
JSONNET_ZVAL_PTR_DTOR(resultZval);
zend_throw_exception(php_com_exception_class_entry, "JsonNet::evaluateSnippet #error", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::evaluateSnippet #error", CODE_ERROR TSRMLS_CC);
return;
}

JSONNET_ZVAL_PTR_DTOR(result);
RETURN_ZVAL(resultZval,1,1);
}

zend_throw_exception(php_com_exception_class_entry, "JsonNet::evaluateSnippet('string'), string is null", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::evaluateSnippet('string'), string is null", CODE_ERROR TSRMLS_CC);
}

PHP_METHOD(JSONNET_RES_NAME, fmtFile)
Expand Down Expand Up @@ -315,14 +315,14 @@ PHP_METHOD(JSONNET_RES_NAME, fmtFile)
if(Z_TYPE_P(result) == IS_NULL)
{
JSONNET_ZVAL_PTR_DTOR(result);
zend_throw_exception(php_com_exception_class_entry, "JsonNet::fmtFile #error", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::fmtFile #error", CODE_ERROR TSRMLS_CC);
return;
}

RETURN_ZVAL(result,1,1);
}

zend_throw_exception(php_com_exception_class_entry, "JsonNet::fmtFile('filePath'), filePath is null", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::fmtFile('filePath'), filePath is null", CODE_ERROR TSRMLS_CC);
}

PHP_METHOD(JSONNET_RES_NAME, fmtSnippet)
Expand Down Expand Up @@ -366,12 +366,12 @@ PHP_METHOD(JSONNET_RES_NAME, fmtSnippet)
if(Z_TYPE_P(result) == IS_NULL)
{
JSONNET_ZVAL_PTR_DTOR(result);
zend_throw_exception(php_com_exception_class_entry, "JsonNet::fmtSnippet #error", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::fmtSnippet #error", CODE_ERROR TSRMLS_CC);
return;
}

RETURN_ZVAL(result,1,1);
}

zend_throw_exception(php_com_exception_class_entry, "JsonNet::fmtSnippet('string'), string is null", CODE_ERROR TSRMLS_CC);
zend_throw_exception(php_com_exception_class_entry, "Jsonnet::fmtSnippet('string'), string is null", CODE_ERROR TSRMLS_CC);
}
18 changes: 9 additions & 9 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0"
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>JsonNet</name>
<name>Jsonnet</name>
<channel>pecl.php.net</channel>
<summary>The Google JsonNet for PHP.</summary>
<summary>The Google Jsonnet for PHP.</summary>
<description>
The Google JsonNet for PHP.
The Google Jsonnet for PHP.

Jsonnet language, from its most basic features to its powerful object model, punctuated with examples drawn from
the world of cocktails. These examples are meant to be fun, and although a little contrived, do not restrict our
Expand Down Expand Up @@ -38,7 +38,7 @@
</stability>
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache2.0</license>
<notes>
- Update Lib JsonNet use v0.10.0.
- Update Lib Jsonnet use v0.10.0.
- Support PHP 7.
</notes>
<contents>
Expand All @@ -57,7 +57,7 @@
<file role="src" name="php7_wrapper.h"/>
</dir>
<dir name="CodeTips">
<file role="src" name="JsonNetCodeTips.php"/>
<file role="src" name="JsonnetCodeTips.php"/>
</dir>
<dir name="test">
<file role="src" name="bar_menu.1.jsonnet"/>
Expand Down Expand Up @@ -175,7 +175,7 @@
</stability>
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache2.0</license>
<notes>
- Update Lib JsonNet use v0.8.9.
- Update Lib Jsonnet use v0.8.9.
- Fixed issue #1 #2, install error and .so load failed.
</notes>
</release>
Expand Down Expand Up @@ -208,9 +208,9 @@
</stability>
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache2.0</license>
<notes>
- Update Lib JsonNet use v0.9.5.
- Add function JsonNet::fmtFile.
- Add function JsonNet::fmtSnippet.
- Update Lib Jsonnet use v0.9.5.
- Add function Jsonnet::fmtFile.
- Add function Jsonnet::fmtSnippet.
</notes>
</release>
</changelog>
Expand Down
18 changes: 9 additions & 9 deletions test/test.jsonnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
var_dump(jsonnet_get_author());


var_dump(JsonNet::evaluateFile('bar_menu.1.jsonnet'));
var_dump(JsonNet::fmtFile('bar_menu.1.jsonnet'));
var_dump(JsonNet::evaluateFile('bar_menu.2.jsonnet'));
var_dump(JsonNet::evaluateFile('bar_menu.3.jsonnet'));
var_dump(JsonNet::evaluateFile('bar_menu.5.jsonnet'));
var_dump(JsonNet::evaluateFile('bar_menu.6.jsonnet'));
var_dump(JsonNet::evaluateFile('utf8.jsonnet'));
var_dump(Jsonnet::evaluateFile('bar_menu.1.jsonnet'));
var_dump(Jsonnet::fmtFile('bar_menu.1.jsonnet'));
var_dump(Jsonnet::evaluateFile('bar_menu.2.jsonnet'));
var_dump(Jsonnet::evaluateFile('bar_menu.3.jsonnet'));
var_dump(Jsonnet::evaluateFile('bar_menu.5.jsonnet'));
var_dump(Jsonnet::evaluateFile('bar_menu.6.jsonnet'));
var_dump(Jsonnet::evaluateFile('utf8.jsonnet'));

$Snippet = '
{
Expand Down Expand Up @@ -47,8 +47,8 @@
';

var_dump(JsonNet::fmtSnippet($Snippet));
var_dump(JsonNet::evaluateSnippet($Snippet));
var_dump(Jsonnet::fmtSnippet($Snippet));
var_dump(Jsonnet::evaluateSnippet($Snippet));
} catch (Exception $e) {

var_dump($e->getCode());
Expand Down

0 comments on commit e276b0b

Please sign in to comment.