-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathphp_context.h
More file actions
87 lines (77 loc) · 1.67 KB
/
php_context.h
File metadata and controls
87 lines (77 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* PhpContext.h
*
* The main javascript context class as it is exposed to PHP space
*
* @copyright 2015 - 2025 Copernica B.V.
*/
/**
* Include guard
*/
#pragma once
/**
* Dependencies
*/
#include <phpcpp.h>
#include "core.h"
/**
* Start namespace
*/
namespace JS {
/**
* Class definition
*/
class PhpContext : public Php::Base
{
private:
/**
* Shared pointer to the actual core data
* @var std::shared_ptr<Core>
*/
std::shared_ptr<Core> _core;
public:
/**
* Constructor
*/
PhpContext();
/**
* No copying allowed
* @param that the object we cannot copy
*/
PhpContext(const PhpContext &that) = delete;
/**
* Destructor
*/
virtual ~PhpContext() = default;
/**
* Assign a variable to the javascript context
*
* @param params array of parameters:
* - string name of property to assign required
* - mixed property value to assign required
* - integer property attributes optional
*
* The property attributes can be one of the following values
*
* - ReadOnly
* - DontEnum
* - DontDelete
*
* If not specified, the property will be writable, enumerable and
* deletable.
*
* @return Php::Value
*/
Php::Value assign(Php::Parameters ¶ms);
/**
* Parse a piece of javascript code
* @param params array with one parameter: the code to execute
* @return Php::Value
* @throws Php::Exception
*/
Php::Value evaluate(Php::Parameters ¶ms);
};
/**
* End namespace
*/
}