-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added php-gtk helper file for functions, and start to handle errors o…
…f parameters
- Loading branch information
Showing
7 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
#include "php-gtk.h" | ||
|
||
bool phpgtk_check_parameter(Php::Value value, Php::Type expected_type, bool required) | ||
{ | ||
Php::call("var_dump", "OK1"); | ||
if(required) { | ||
Php::call("var_dump", "OK2"); | ||
if(value.type() == Php::Type::Null) { | ||
Php::call("var_dump", "OK3"); | ||
throw Php::Exception("tipo errado"); | ||
} | ||
Php::call("var_dump", "OK4"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef _PHPGTK_H_ | ||
#define _PHPGTK_H_ | ||
|
||
#include <phpcpp.h> | ||
#include <iostream> | ||
#include <gtk/gtk.h> | ||
|
||
|
||
bool phpgtk_check_parameter(Php::Value value, Php::Type expected_type, bool required); | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters