Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 13 15:50

    roberthusak on semantic-transformations

    Add callable parameter validati… (compare)

  • Dec 13 15:15

    jakubmisek on master

    ERR_CantReadResource message (compare)

  • Dec 13 15:13

    jakubmisek on master

    '.source.metadata.resources' wi… (compare)

  • Dec 13 14:53

    jakubmisek on master

    ReflectionClassConstant::getDoc… (compare)

  • Dec 13 14:51

    jakubmisek on master

    embedded ".source.metadata.reso… (compare)

  • Dec 13 14:31
    jakubmisek closed #520
  • Dec 13 14:31

    jakubmisek on master

    Reflection**.getDocComment() f… (compare)

  • Dec 13 14:14

    jakubmisek on master

    emitting ".source.metadata.reso… (compare)

  • Dec 13 13:28

    jakubmisek on master

    phar compilation produces just … (compare)

  • Dec 13 13:06

    roberthusak on travis-dotnet-install

    Use Ubuntu 18.04 on Travis (compare)

  • Dec 13 12:59

    roberthusak on travis-dotnet-install

    Add Ubuntu Universe repository … (compare)

  • Dec 13 12:40

    roberthusak on travis-dotnet-install

    Use dotnet-sdk-3.1 on Travis (compare)

  • Dec 13 11:24

    roberthusak on semantic-transformations

    Throw errors when invoking inva… (compare)

  • Dec 13 10:06
    jakubmisek commented #542
  • Dec 13 08:03
  • Dec 13 05:38
    menturion commented #542
  • Dec 12 16:31
    jakubmisek closed #528
  • Dec 12 16:31
    jakubmisek commented #528
  • Dec 12 16:29
    jakubmisek closed #583
  • Dec 12 16:29
    jakubmisek commented #583
L!εsAμεr
@liesauer
@jakubmisek no get_Item method now? i have upgraded peachpie from 0.9.44 to 0.9.500.
image.png
image.png
L!εsAμεr
@liesauer
interesting, the top exception occurs because of can not find the resouces dll
L!εsAμεr
@liesauer
{
System.IO.FileNotFoundException: Could not load the specified file.
File name: 'Peachpie.Runtime.resources'
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)
}
Jakub Míšek
@jakubmisek
@Southerndeep_twitter Have yo u been able to run a sample Hello World app? I can help from there
@liesauer PeachPie is the exception handled or unhandled? Because .NET always tries to load **.resources assembly even it does not exist.
Jakub Míšek
@jakubmisek
@liesauer get_Item() might be inaccessible, we need a test case for this feature (it is a workaround for calling an object indexer [] right?)
L!εsAμεr
@liesauer
a long time ago, i tried Attributes["href"] because Attributes has implementd .net indexer, but in fact i cannot invoke in PHP just like .NET does. before i upgrade to 0.9.500, get_Item works fine.(actually u told me about this method a long time ago)
L!εsAμεr
@liesauer
little test case
downgrade to 0.9.44 will work
Anthony Turley
@Southerndeep_twitter
@jakubmisek yes, I have a hello world app that's running the peachpie wordpress project perfectly on my localhost. But I'd like to deploy it to a remote vps running linux ubuntu 18.04
medvedy
@medvedy
Good evening everyone, I'm trying to build my own wordpress widget, but I have a problem with registering the widget. I get the following error: "InvalidOperationException: Call to a member function register() on a non-object". This is my plugin/widget: https://github.com/medvedy/wpwidgetdemo/blob/master/DemoWidget.cs Can anyone give me a hint what I'm doing wrong or provide a working sample? Thank you :-)
Benjamin Fistein
@bfistein
@medvedy sorry for the late response, Gitter sometimes doesn't notify us of new messages. That's actually a great question - would you maybe post this as an issue to the wpdotnet-sdk repo? That way the answer will be documented as well. Thank you!
Jakub Míšek
@jakubmisek
@liesauer yes, get_Item is a "special" method which should not be callable directly. 0.9.500 behaves like C#, we have to implement .NET indexers before 1.0.0 (peachpiecompiler/peachpie#582)
@medvedy do you have a callstack of the exception? It will point to the PHP code where it happens. It will be something before -> operator which supposes to be an object but it isn't
@Southerndeep_twitter the deployment process would be very the same as with any other asp.net core application. I have found
Calvin Baart
@calvinbaart

@jakubmisek Alright, I have some time to investigate further. I have been logging the sizes of the arrays in the New and NewEmpty methods of PhpArray. It seems that after a certain point (still not sure what) the Singleton Empty PhpArray is not empty anymore:

NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
NewEmpty: 0
New Array (2): 1
NewEmpty: 1
NewEmpty: 1
NewEmpty: 1
NewEmpty: 1
NewEmpty: 2
NewEmpty: 2
NewEmpty: 2
NewEmpty: 2
NewEmpty: 2
NewEmpty: 2
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3
NewEmpty: 3

Format = Method: Array Count. For the NewEmpty method it will Count the Empty singleton.
I'm still trying to pin-point the exact line of code that is causing this to happen.

New Array (2) will be the public static PhpArray New(params PhpValue[] values) method
Jakub Míšek
@jakubmisek
that's a good bug :) awesome job @calvinbaart . Is it possible it's causing outputting that Array text in the tests ?
Calvin Baart
@calvinbaart
Yes. It seems that the empty array suddenly has three Arrays in it causing PHPUnit to output some stuff (because it doesn't expect it)
Still trying to figure out from what point the empty array is not empty anymore but haven't found anything
Jakub Míšek
@jakubmisek
that would help, if you can find the code causing this ... sometimes we pass the instance of empty array singleton and expecting (hoping) it won't get changed
Calvin Baart
@calvinbaart
Figured it out @jakubmisek : peachpiecompiler/peachpie#591
Jakub Míšek
@jakubmisek
great!
Calvin Baart
@calvinbaart

@jakubmisek Thanks for the fix! All the tests can run again now:

Tests: 3948, Assertions: 7778, Errors: 557, Failures: 159, Warnings: 3, Skipped: 87.

I'll try to go through a few of them to figure it out

medvedy
@medvedy
@jakubmisek @bfistein Thanks for your replies. The exception is thrown in widgets.php, in function "register_widget( $widget )" when executing "$wp_widget_factory->register( $widget );". $wp_widget_factory seems to be null. I'll post an issue to the wpdotnet-sdk repo.
Jakub Míšek
@jakubmisek
@medvedy good, if you'd have any idea why $wp_widget_factory is NULL, it would help. It does not happen on the standard configuration.
@calvinbaart awesome! seems number of Errors is lower again
medvedy
@medvedy
@jakubmisek It seems, that $GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); is executed before the plugin. That's why the wp_widget_factory is still null when I try to register my plugin.
medvedy
@medvedy
@jakubmisek Correction: I mean $GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); is executed after the plugin registering.
Jakub Míšek
@jakubmisek
@medvedy I see, so you need it to be somehow set before it's being used ... I'll take a look where it can be done
Daniel Llewellyn
@diddledan
@medvedy try changing your hook on widgets_init to just init.
although that shouldn't make a difference, register_widget is used in the function that calls widgets_init so you should be safe to use it at that point, too
oh, I see the problem
You are executing your function RegisterMyWidget when you add_action - this should be a reference to the method, not an invokation of the method
Daniel Llewellyn
@diddledan

your c# code there will do the equivalent to the following php:

add_action( 'widgets_init', RegisterMyWidget() );

which will resolve to:

add_action( 'widgets_init', 0 );

because you are executing RegisterMyWidget and adding the return value of it to the hook. In PHP we create a callable by adding the name of the function in a string, and the class or instance it belongs to both into an array:

add_action( 'widgets_init', [ $instance, 'RegisterMyWidget' ] );
I know more about WordPress and PHP than I do C#, so I don't know how to create a callable for PeachPie to add into the hook functions list
medvedy
@medvedy
@diddledan Thanks, that solved it! I'll post the code here: iolevel/wpdotnet-sdk#59
DDaemonium
@DDaemonium
Hi all, I can't find any manuals regarding themes installation. Could you please explain how can I install it? I uploaded new theme via wordpress themes loader and recompiled my solution but I got errors like: can't find file from theme_name/inc. I tried to do it using wpdotnet from nuget. Also I tried compile solution from gitlab repo, but can't launch application. It crashes with error code 255 in php file.
Jakub Míšek
@jakubmisek
@DDaemonium currently you have to fork either wpdotnet-sdk or peachpie-wordpress github repositories and copy your theme into .../wp-content/themes/ directory. Then run the project - if it crashes or does not compile, please post us the error or exception message. 255 does not help much, there must be something more.
DDaemonium
@DDaemonium
Ok, thank you.
anikeev
@anikeev

Hello. Currently I'm working on porting yii2 framework to Peachpie and have some issues with PDO.PgSql.
Yii tries to create pdo statement first and bind all parameters with their types to the statement next.

$this->pdoStatement = $pdo->prepare($sql);

foreach ($this->_pendingParams as $name => $value) {
    $this->pdoStatement->bindValue($name, $value[0], $value[1]);
 }

But it does not work and throws InvalidOperationException.
Here is stack:

An unhandled exception was thrown by the application.
yii\db\Exception: InvalidOperationException: The Prepare method requires all parameters to have an explicitly set type.
Failed to prepare SQL: SELECT * FROM "dl_pages" WHERE (page_alias = :name) AND (page_lang = :lang) AND (page_status = :status) in vendor/yiisoft/yii2/db/Command.php(259,12)
Stack trace:
#0 vendor/yiisoft/yii2/db/Command.php(1153,8): Command->prepare($forRead)
#1 vendor/yiisoft/yii2/db/Command.php(414,4): Command->queryInternal($method, $fetchMode)
#2 vendor/yiisoft/yii2/db/Query.php(275,4): Command->queryOne($fetchMode)
....

If I change $pdo->prepare to $pdo->query call inside vendor/yiisoft/yii2/db/Command.php(1153,8): Command->prepare I'm receiving same exception but with different stack:

An unhandled exception was thrown by the application.
System.InvalidOperationException: The Prepare method requires all parameters to have an explicitly set type.
   at Npgsql.NpgsqlCommand.Prepare()
   at Peachpie.Library.PDO.PDOStatement.PrepareStatement()
   at Peachpie.Library.PDO.PDOStatement.PrepareStatement(PDO pdo, String statement, PhpArray driver_options)
   at Peachpie.Library.PDO.PDOStatement..ctor(Context ctx, PDO pdo, String statement, PhpArray driver_options)
   at Peachpie.Library.PDO.PDO.CreateStatement(String statement, PhpArray driver_options)
   at Peachpie.Library.PDO.PDO.query(String statement, PhpValue[] args)
   at CallSite.Target(Closure , CallSite , PhpValue , Context , PhpValue& )
   at CallSite.Target(Closure , CallSite , PhpValue , Context , PhpValue& )
   at yii.db.Command.prepare(PhpValue forRead) in vendor/yiisoft/yii2/db/Command.php:line 259
   at yii.db.Command.queryInternal(PhpValue method, PhpValue fetchMode) in vendor/yiisoft/yii2/db/Command.php:line 1153
   at yii.db.Command.queryOne(PhpValue fetchMode) in vendor/yiisoft/yii2/db/Command.php:line 414

Any ideas how can I fix that?

Alfredo Rodriguez Siles
@jarscr

Hello, I create Console App, but now need open exe with parameter
Example: ConsoleApp.exe Invoice 100
Is possible?

Thanks

Jakub Míšek
@jakubmisek
@anikeev honestly we haven't tried PgSql yet, it seems to need to be implemented properly; would you be able to prepare a test case (a docker image with PostgreSQL and sample a php code)
@jarscr yes it is possible, like a regular executable application. In PHP the arguments will be available through $argv and $argc variables
Jakub Míšek
@jakubmisek
FYI we've started generating compatibility matrix
https://docs.peachpie.io/compatibility-status/
Michał Osowski
@OsaPL
Hey, there was a bug, that was fixed, I would love to verify if its actually working. How can I access nightly builds?
Jakub Míšek
@jakubmisek
@OsaPL
latest builds can be found on https://ci.appveyor.com/project/dotnetfoundation/peachpie/history,
nuget feed: https://ci.appveyor.com/nuget/peachpie