We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon webtools with warnings about binding

I am a C# developer by trade, and am quite familiar and comfortable with MVC applications in ASP.NET & C#. However,where I work, there are some side projects becoming available that use php and Phalcon. I have some experience with php3 many years ago, but haven't done anything recently. So I set up XAMPP on my Windows 7 system with php and MariaDB. I also installed and set up Phalcon. Thus far everything seems ok. However, when I attempt to access the webtools, I get the following warnings:

Warning: Cannot bind an instance to a static closure in C:\PHPPhalcon\scripts\Phalcon\Web\Tools.php on line 355 Warning: Cannot bind an instance to a static closure in C:\PHPPhalcon\scripts\Phalcon\Web\Tools\views\index.phtml on line 15

I'm not familiar enough with the newer elements of php5 where I could attempt to fix this myself. I've read here it was supposedly fixed, and yet here I am with Phalcon 3.02 and still have this issue.

Any help or assitance would be greatly appreciated...



43.9k

Hi,

first of all: welcome !

You've got a warning during webtools execution, but this is not a fatal error so you may forget it.



512

The warning displays on the webtools page itself, and it not only distracting, just not all that aesthetically pleasing. And it shows up on subsequent pages... Usually warnings are there for a reason, so I'd like to resolve if it I could instead of just ignoring it.



43.9k

Usually warnings are there for a reason, so I'd like to resolve if it I could instead of just ignoring it.

You're right, but webtools are here to help you to quickly scaffold a new application, build models and basic crud operations. And I think that it is better to be concentrate on the application you plan to build.



512

Except if the framework you're trying to use is throwing warnings, with no way of resolving them, then who's to say the final eventual application couldn't have some underlying flaw caused by those warnings. If a tornado warning was issued, and you just ignore it, who do you blame for your house being torn apart in said storm?



43.9k

you're running webtools on a windows computer (with php 7), mine is linux based (with php 5.6). I've just installed the new version of phalcon's developer tools and I've got no warnings.

This tool is a phalcon app itself. So there must be some troubles with that app with your system setup.



512

I'm not using php7, but php 5.6.28... And I do get the warnings, and they are in the actual Phalcon web\tools.php page according to the warning. And the warning itself is due to something that php supposedly doesn't allow for. If I were a better php developer perhpas I could figure it out, but since I'm not, I came here for help. But the only help I've actually received is "just ignore it" which isn't really any help at all.



43.9k

I'm glad that you want to debug webtools.

But are you sure you've got the latest version ? Because there is no line 355 in https://github.com/phalcon/phalcon-devtools/blob/master/scripts/Phalcon/Web/Tools.php

And the latest version doesn't use phtml files anymore, see: https://github.com/phalcon/phalcon-devtools/tree/master/scripts/Phalcon/Web/Tools/Views/index



512

I downloaded Phalcon 3.0.2 - Windows x86 for PHP 5.6.0 (vc11) November 26 2016 17:14:53 EST / sha1: 245b567331da804550ef1abf55b2ec6f764b0d9d

And from GitHub, I simply downloaded the Zip. You don't get to pick versions when you do that, you just get whatever they give you in the ZIP file. I didn;t clone the repository because I don';t use GitHub, or Git at all, so had to do it via the Download.

It's not that I want to debug webtools, I don't. But what I do want is a framework that is stable, and error free. And for me, that includes warnings. Normally I wouldn't even use a framework like this, but it's what's being used at work.



512

I re-downloaded from GitHub... Still had a few problems, but got them resolved, so I suppose it's working. But I gotta say, unless I have something mis-configured, the previous webtools interface, even with the warning, was better looking than this... Perhaps I'll just skip the webtools altogether...



43.9k
edited Dec '16

Hi,

I'm glad that it's ok now.

99,9 % of the time, warnings (and fatal errors) comes from bad coding, not from framework itself. For example, that issue has been solved: https://github.com/phalcon/cphalcon/issues/12191 with 3.0.2 version.

And here the issues labeled as "BUG Medium": https://github.com/phalcon/cphalcon/labels/Bug%20-%20Medium