This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /** |
||
4 | * The comments controller |
||
5 | * |
||
6 | * @license http://opensource.org/licenses/MIT The MIT License (MIT) |
||
7 | * @author Omar El Gabry <[email protected]> |
||
8 | */ |
||
9 | |||
10 | class CommentsController extends Controller{ |
||
0 ignored issues
–
show
|
|||
11 | |||
12 | public function beforeAction(){ |
||
13 | |||
14 | parent::beforeAction(); |
||
15 | |||
16 | $action = $this->request->param('action'); |
||
17 | $actions = ['getAll', 'create', 'getUpdateForm', 'update', 'getById', 'delete']; |
||
18 | $this->Security->requireAjax($actions); |
||
0 ignored issues
–
show
The property
Security does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
19 | $this->Security->requirePost($actions); |
||
0 ignored issues
–
show
The property
Security does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
20 | |||
21 | switch($action){ |
||
22 | case "getAll": |
||
23 | $this->Security->config("form", [ 'fields' => ['post_id', 'page', 'comments_created']]); |
||
0 ignored issues
–
show
The property
Security does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
24 | break; |
||
25 | case "create": |
||
26 | $this->Security->config("form", [ 'fields' => ['post_id', 'content']]); |
||
0 ignored issues
–
show
The property
Security does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
27 | break; |
||
28 | case "getUpdateForm": |
||
29 | $this->Security->config("form", [ 'fields' => ['comment_id']]); |
||
0 ignored issues
–
show
The property
Security does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
30 | break; |
||
31 | case "update": |
||
32 | $this->Security->config("form", [ 'fields' => ['comment_id', 'content']]); |
||
0 ignored issues
–
show
The property
Security does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
33 | break; |
||
34 | case "getById": |
||
35 | case "delete": |
||
36 | $this->Security->config("form", [ 'fields' => ['comment_id']]); |
||
0 ignored issues
–
show
The property
Security does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
37 | break; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * get all comments |
||
43 | * |
||
44 | */ |
||
45 | public function getAll(){ |
||
46 | |||
47 | $postId = Encryption::decryptId($this->request->data("post_id")); |
||
48 | |||
49 | $pageNum = $this->request->data("page"); |
||
50 | $commentsCreated = (int)$this->request->data("comments_created"); |
||
51 | |||
52 | $commentsData = $this->comment->getAll($postId, $pageNum, $commentsCreated); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
53 | |||
54 | $commentsHTML = $this->view->render(Config::get('VIEWS_PATH') . 'posts/comments.php', array("comments" => $commentsData["comments"])); |
||
55 | $paginationHTML = $this->view->render(Config::get('VIEWS_PATH') . 'pagination/comments.php', array("pagination" => $commentsData["pagination"])); |
||
56 | |||
57 | $this->view->renderJson(array("data" => ["comments" => $commentsHTML, "pagination" => $paginationHTML])); |
||
58 | } |
||
59 | |||
60 | public function create(){ |
||
61 | |||
62 | $postId = Encryption::decryptId($this->request->data("post_id")); |
||
63 | |||
64 | $content = $this->request->data("content"); |
||
65 | |||
66 | $comment = $this->comment->create(Session::getUserId(), $postId, $content); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
67 | |||
68 | if(!$comment){ |
||
69 | $this->view->renderErrors($this->comment->errors()); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
70 | }else{ |
||
71 | |||
72 | $html = $this->view->render(Config::get('VIEWS_PATH') . 'posts/comments.php', array("comments" => $comment)); |
||
73 | $this->view->renderJson(array("data" => $html)); |
||
74 | } |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * whenever the user hits 'edit' button, |
||
79 | * a request will be sent to get the update form of that comment, |
||
80 | * so that the user can 'update' or even 'cancel' the edit request. |
||
81 | * |
||
82 | */ |
||
83 | View Code Duplication | public function getUpdateForm(){ |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
84 | |||
85 | $commentId = Encryption::decryptIdWithDash($this->request->data("comment_id")); |
||
86 | |||
87 | if(!$this->comment->exists($commentId)){ |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
88 | return $this->error(404); |
||
89 | } |
||
90 | |||
91 | $comment = $this->comment->getById($commentId); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
92 | |||
93 | $commentsHTML = $this->view->render(Config::get('VIEWS_PATH') . 'posts/commentUpdateForm.php', array("comment" => $comment[0])); |
||
94 | $this->view->renderJson(array("data" => $commentsHTML)); |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * update comment |
||
99 | * |
||
100 | */ |
||
101 | View Code Duplication | public function update(){ |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
102 | |||
103 | $commentId = Encryption::decryptIdWithDash($this->request->data("comment_id")); |
||
104 | $content = $this->request->data("content"); |
||
105 | |||
106 | if(!$this->comment->exists($commentId)){ |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
107 | return $this->error(404); |
||
108 | } |
||
109 | |||
110 | $comment = $this->comment->update($commentId, $content); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
111 | |||
112 | if(!$comment){ |
||
113 | $this->view->renderErrors($this->comment->errors()); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
114 | }else{ |
||
115 | |||
116 | $html = $this->view->render(Config::get('VIEWS_PATH') . 'posts/comments.php', array("comments" => $comment)); |
||
117 | $this->view->renderJson(array("data" => $html)); |
||
118 | } |
||
119 | } |
||
120 | |||
121 | /** |
||
122 | * get comment by Id |
||
123 | * |
||
124 | */ |
||
125 | View Code Duplication | public function getById(){ |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
126 | |||
127 | $commentId = Encryption::decryptIdWithDash($this->request->data("comment_id")); |
||
128 | |||
129 | if(!$this->comment->exists($commentId)){ |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
130 | return $this->error(404); |
||
131 | } |
||
132 | |||
133 | $comment = $this->comment->getById($commentId); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
134 | |||
135 | $commentsHTML = $this->view->render(Config::get('VIEWS_PATH') . 'posts/comments.php', array("comments" => $comment)); |
||
136 | $this->view->renderJson(array("data" => $commentsHTML)); |
||
137 | } |
||
138 | |||
139 | View Code Duplication | public function delete(){ |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
140 | |||
141 | $commentId = Encryption::decryptIdWithDash($this->request->data("comment_id")); |
||
142 | |||
143 | if(!$this->comment->exists($commentId)){ |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
144 | return $this->error(404); |
||
145 | } |
||
146 | |||
147 | $this->comment->deleteById($commentId); |
||
0 ignored issues
–
show
The property
comment does not exist on object<CommentsController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
148 | |||
149 | $this->view->renderJson(array("success" => true)); |
||
150 | } |
||
151 | |||
152 | public function isAuthorized(){ |
||
153 | |||
154 | $action = $this->request->param('action'); |
||
155 | $role = Session::getUserRole(); |
||
156 | $resource = "comments"; |
||
157 | |||
158 | // only for admins |
||
159 | Permission::allow('admin', $resource, ['*']); |
||
160 | |||
161 | // only for normal users |
||
162 | Permission::allow('user', $resource, ['getAll', 'getById', 'create']); |
||
163 | Permission::allow('user', $resource, ['update', 'delete', 'getUpdateForm'], 'owner'); |
||
164 | |||
165 | $commentId = $this->request->data("comment_id"); |
||
166 | if(!empty($commentId)){ |
||
167 | $commentId = Encryption::decryptIdWithDash($commentId); |
||
168 | } |
||
169 | |||
170 | $config = [ |
||
171 | "user_id" => Session::getUserId(), |
||
172 | "table" => "comments", |
||
173 | "id" => $commentId]; |
||
174 | |||
175 | return Permission::check($role, $resource, $action, $config); |
||
176 | } |
||
177 | } |
||
178 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.