Cakephp 3.x => 4.0 migration: Fatal error in PHPStan\Analyser\MutatingScope - cakephp

When I run the rector script bin/cake upgrade rector --rules cakephp40 ../project/src I get the following error:
Notice: Undefined property: PhpParser\Node\Stmt\ClassMethod::$attrGroups in phar:///Users/uscreen/Sites/upgrade/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php on line 216
Warning: Invalid argument supplied for foreach() in phar:///Users/uscreen/Sites/upgrade/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php on line 216
Fatal error: PHPStan\Analyser\MutatingScope cannot implement PHPStan\Analyser\Scope - it is not an interface in phar:///Users/uscreen/Sites/upgrade/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php on line 92
The script then exits with no changes made, but it echos Rector applied successfully. I don`t know where to start to debug this.

Related

Vivado HLS RTL/Cosimulation Fail

I have problem in Vivado HLS
I'm developing an ipcore that the input is AXI-Stream and the output is AXI-Stream too.
There is no problem in C Syntheseis, and also it works well in C Simulation.
But RTL/Cosimulation is failing.
My Top Function is like this :
void CT(point_in SetA[2 * M], point_out Centers[M]){
#pragma HLS INTERFACE axis register both port=SetA
#pragma HLS INTERFACE axis register both port=Centers
...
}
This is the console message when I try to run RTL/Cosimulation:
...
Starting static elaboration
ERROR: [VRFC 10-147] xbip_pipe_v3_0_5.xbip_pipe_v3_0_5_viv_comp failed to restore
ERROR: [VRFC 10-213] Registering Dependencies Error: The library 'xbip_pipe_v3_0_5' could not be found during restore
ERROR: [VRFC 10-147] floating_point_v7_1_6.floating_point_v7_1_6_viv failed to restore
ERROR: [VRFC 10-147] xbip_pipe_v3_0_5.xbip_pipe_v3_0_5_viv_comp failed to restore
ERROR: [VRFC 10-213] Registering Dependencies Error: The library 'xbip_pipe_v3_0_5' could not be found during restore
ERROR: [VRFC 10-147] floating_point_v7_1_6.floating_point_v7_1_6_viv failed to restore
ERROR: [VRFC 10-147] xbip_pipe_v3_0_5.xbip_pipe_v3_0_5_viv_comp failed to restore
ERROR: [VRFC 10-213] Registering Dependencies Error: The library 'xbip_pipe_v3_0_5' could not be found during restore
ERROR: [VRFC 10-147] floating_point_v7_1_6.floating_point_v7_1_6_viv failed to restore
WARNING: [VRFC 10-122] floating_point_v7_1_6_viv remains a black-box since it has no binding entity [/wrk/2018.2/continuous/2018_06_14_2258646/packages/customer/vivado/data/ip/xilinx/floating_point_v7_1/hdl/floating_point_v7_1_vh_rfs.vhd:91730]
WARNING: [VRFC 10-982] library name floating_point_v7_1_6 of instantiated unit conflicts with visible identifier [C:/Users/Dropbox/Vivado_projects/Coreset_Tree/test4/test_coreset/solution1/sim/verilog/ip/xil_defaultlib/CoresetTree_ap_fadd_3_full_dsp_32.vhd:195]
ERROR: [XSIM 43-3322] Static elaboration of top level Verilog design unit(s) in library work failed.
ERROR: Please check the snapshot name which is created during 'xelab',the current snapshot name "xsim.dir/CoresetTree/xsimk.exe" does not exist
INFO: [COSIM 212-211] II is measurable only when transaction number is greater than 1 in RTL simulation. Otherwise, they will be marked as all NA. If user wants to calculate them, please make sure there are at least 2 transactions in RTL simulation.
command 'ap_source' returned error code
while executing
"source C:/Users/Dropbox/Vivado_projects/Coreset_Tree/test4/test_coreset/solution1/cosim.tcl"
invoked from within
"hls::main C:/Users/Dropbox/Vivado_projects/Coreset_Tree/test4/test_coreset/solution1/cosim.tcl"
("uplevel" body line 1)
invoked from within
"uplevel 1 hls::main {*}$args"
(procedure "hls_proc" line 5)
invoked from within
"hls_proc $argv"
Finished C/RTL cosimulation.

Using wagtail start mysite returns syntax error

I am using pip, virtualenv and Python 3 to install wagtail. I am working on Ubuntu.
To backtrack a bit:
I was trying to install initially and got this error:
unicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 47: ordinal not in range(128)
I fixed this by changing my env to use Python 3.
This allows wagtail to start installing, but returned this list of errors while installing:
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/feedgenerator.py'...
File "/home/ubuntu/workspace/env/build/Django/django/utils/feedgenerator.py", line 82
**kwargs,
^
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/functional.py'...
File "/home/ubuntu/workspace/env/build/Django/django/utils/functional.py", line 12
return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs})
^
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/log.py'...
File "/home/ubuntu/workspace/env/build/Django/django/utils/log.py", line 229
)
^
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/tree.py'...
l File "/home/ubuntu/workspace/env/build/Django/django/utils/tree.py", line 76
return hash((self.__class__, self.connector, self.negated, *make_hashable(self.children)))
^
SyntaxError: can use starred expression only as assignment target
It gave me a success message despite the syntax errors.
Successfully installed wagtail html5lib Django six Unidecode draftjs-exporter djangorestframework django-taggit pytz django-modelcluster Willow Pillow beautifulsoup4 requests django-treebeard webencodings urllib3 chardet idna certifi
Cleaning up...
After trying to start wagtail I have this final error message:
Traceback (most recent call last):
File "/home/ubuntu/workspace/env/bin/wagtail", line 7, in <module>
from wagtail.bin.wagtail import main
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/wagtail/bin/wagtail.py", line 10, in <module>
from django.core.management import ManagementUtility
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 11, in <module>
from django.conf import settings
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/conf/__init__.py", line 18, in <module>
from django.utils.functional import LazyObject, empty
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/utils/functional.py", line 12
return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs})
This final error is the one I have not been able to solve. I opened the file functional.py and reviewed the contents and it looks correct to me. Any ideas on how to fix the error or what the root cause could be?
You are running Python 3.4, which is not supported by the current version of Django (2.1). You should either upgrade to Python 3.5 or above, or downgrade Django to 2.0.x by running pip install "Django>=2.0,<2.1".

FosUserBundle + Symfony 3.4

Since 7 days I tried to repair HwiOauthFukingBundle with facebook + FosUserOtherFukingBundle + Symfony 3.4.
And now, I have this incomprehensible errors in prod but not in dev.
[2018-03-17 14:45:27] php.WARNING: Warning:
require(/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php):
failed to open stream: No such file or directory
{"exception":"[object] (ErrorException(code: 0): Warning:
require(/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php):
failed to open stream: No such file or directory at
/var/www/vhosts/domaine.fr/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:223)"}
[]
And this one
[2018-03-17 14:45:27] request.CRITICAL: Uncaught PHP Exception
Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error:
require(): Failed opening required
'/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php'
(include_path='.:/opt/plesk/php/7.1/share/pear')" at
/var/www/vhosts/domaine.fr/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
line 223 {"exception":"[object]
(Symfony\Component\Debug\Exception\FatalErrorException(code: 0):
Compile Error: require(): Failed opening required
'/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php'
(include_path='.:/opt/plesk/php/7.1/share/pear') at
/var/www/vhosts/domaine.fr/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:223)"}
[]
What's going on ?
I have clean the cache folder etc. but this error seems to be falling from the sky... this is a nightmare...

Mailchimp with cakephp

I am download sample code from mailchimp site and copy paste in my c:/xampp folder now i am run the index.php file but i got following warning and error
Warning:
include(C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master/Vendor/pear-pear.cakephp.org/CakePHP\Cake\bootstrap.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master\webroot\index.php
on line 107
Warning: include(): Failed opening
'C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master/Vendor/pear-pear.cakephp.org/CakePHP\Cake\bootstrap.php'
for inclusion (include_path='.;C:\xampp\php\PEAR') in
C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master\webroot\index.php
on line 107
Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to
the directory containing your \cake core directory and your \vendors
root directory. in
C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master\webroot\index.php
on line 114
Now I am install composer and create phar file and try to update with composer update command but following error display
http://prntscr.com/5d2cgw
In composer.json file change require property with this lines
"require": {
"cakephp/cakephp": "2.5.*",
"mailchimp/mailchimp": ">=2.0.0"
},

CakePHP cake bake giving error after selecting default

I just created a new project with CakePHP according to the main page you get after configuring everything i'm all in the green even database connection.
i run this command:
octavius#octavius-VirtualBox:/opt/lampp/htdocs/acltutorial/cake/console$ ./cake bake all
and this happens:
Welcome to CakePHP v1.3.7 Console
---------------------------------------------------------------
App : app
Path: /opt/lampp/htdocs/acltutorial/app
---------------------------------------------------------------
---------------------------------------------------------------
Bake All
---------------------------------------------------------------
Use Database Config: (default/test)
[default] >
PHP Fatal error: Call to undefined function mysql_query() in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 600
Fatal error: Call to undefined function mysql_query() in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 600
I went into my php.ini file and added extension = 'mysql.so' and it still doesn't work. Anybody have any ideas?
PS: Doing table by table yields the same error
EDIT: After doing what dogmatic69 suggested i got these warnings:
PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 552
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 552
PHP Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 558
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 558
PHP Warning: mysql_get_server_info() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 566
Warning: mysql_get_server_info() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 566
PHP Warning: mysql_query() expects parameter 2 to be resource, boolean given in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 600
Warning: mysql_query() expects parameter 2 to be resource, boolean given in /opt/lampp/htdocs/acltutorial/cake/libs/model/datasources/dbo/dbo_mysql.php on line 600
Your database does not have any tables.
Still doesn't work.
undo the changes you have made and then do something like this
sudo apt-get install php5-mysql
sudo service apache2 restart
It's not CakePHP error for sure. This means that mysql library is not loaded. When you added the extension did you restart the server? run phpinfo() in a file and see if the mysql is loaded.
This wasn't a cake error, apparently I had to specify the port in the database.php file like so:
'port' => '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock'
it couldn't connect to the database for baking, though it worked for the app itself, this fixed it.
This was running me crazy as well. I am on Ubuntu with XAMPP. Managed to fix it using 8vius' solution
In the /app/config/database.php file
'port' => '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock'

Resources