Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 19 2020 03:15
    garrettw commented #50
  • Oct 17 2020 09:07
    technicalreju opened #50
  • Oct 02 2020 01:39
    iamnishan opened #49
  • Oct 01 2020 17:41
    Aakash225 closed #47
  • Oct 01 2020 17:34
    garrettw commented #47
  • Oct 01 2020 16:12
    mjrider commented #48
  • Oct 01 2020 11:14
    tunggnu commented #48
  • Oct 01 2020 09:17
    Khushboo-Bhatia opened #48
  • Sep 30 2020 18:46
    Aakash225 opened #47
  • Aug 19 2020 07:19
    DavidGitonga opened #4
  • May 31 2020 18:00
    dracony commented #11
  • May 31 2020 18:00

    dracony on 3.8

    (compare)

  • May 31 2020 18:00

    dracony on master

    social provider VK api fix ver… VK, users.get backwards compati… Merge pull request #11 from kip… (compare)

  • May 31 2020 18:00
    dracony closed #11
  • May 31 2020 08:39
    kip260384 commented #11
  • May 31 2020 08:38
    kip260384 synchronize #11
  • May 30 2020 18:44
    dracony commented #11
  • May 24 2020 11:33
    kip260384 opened #11
  • May 11 2020 17:05

    dracony on 3.3.1

    (compare)

  • May 11 2020 17:03

    dracony on 3.2.5

    (compare)

Mitzhuo Yuenians Abarca Jimenez
@mitzhuoy_gitlab
Hello everyone, I am learning to use PHPixie, I would like your guidance to create a custom password provider similar to 'auth-login', in addition to a custom user model for that provider. I try to follow the final part of this web page https://phpixie.com/components/auth.html. Thanks for your help.
Roman Tsiupa
@dracony
@pforret Thanks! I had the renewal script running automatically but it seems I missed to update the server script
Now its fine
A good example of a custom provider is the auth-social package https://github.com/PHPixie/Auth-Social
@mitzhuoy_gitlab It should have most of what you need. I think the only tricky part is registering your own provider
Adding your own providers
At some point you will probably need to add your own login providers (e.g. for social networks), to do that you need to satisfy a PHPixie\Auth\Providers\Builder interface and pass it along with the other extensions. Try looking at the AuthLogin component for an example. If you are using the PHPixie Framework you can pass your custom extensions to the Auth component by overloading this method.
from bottom of page
if you have any specific questions just tell me
Stephen Ibbotson
@steveibbo1986_twitter
Hi, I'm new to phpixie! Just wondering if there are any tutorials to make an image uploader?
Roman Tsiupa
@dracony
this should be easy
first you create a form like:
<form method="POST" action="/some/route" enctype="multipart/form-data">
<div>
<span>Upload a File:</span>
<input type="file" name="uploadedFile" />
</div>

<input type="submit" name="uploadBtn" value="Upload" />
</form>
and then in your controller you move the uploaded file
$uploadedFile = $request->uploads()->get('uploadedFile');
$uploadedFile->move('/images/fairy.png');
@steveibbo1986_twitter
Bloodoff
@Bloodoff
Hi, how I can return a error code (ex. 404 or 407) from HTTP processor ?
Roman Tsiupa
@dracony
$response->setStatus('404', 'Not Found');
Or
$http->responses->response("Not Found", [], 404, "Not Found");
@Bloodoff
Bloodoff
@Bloodoff
thnx, but responses is not property
inside framework working example: return $this->responses->response("Authorization required", [], 401);
edit: return $this->responses()->response("Authorization required", [], 401)
Bloodoff
@Bloodoff
hi, how to disable debug output on error in http processor? to prevent leakage of source on code in production env
Roman Tsiupa
@dracony
yes
change too your own template here
you can show any error page that way
Bloodoff
@Bloodoff
thnx
$missingKeys = array_intersect($required, $keys);
but missing keys are not intersect of arrays required and all keys
Bloodoff
@Bloodoff
How to define ORM Wrappers ? the way described in documentation not working after update
Bloodoff
@Bloodoff
found a way :)
Roman Tsiupa
@dracony
Thanks! Will fix
Tiago
@TiagoGomesPires
Hello
is someone here?
Bloodoff
@Bloodoff
yes
Hi
Bloodoff
@Bloodoff
@dracony , the certifiacte on site has expired
Anton Kolenkov
@dorantor

Hi All. What is a proper way to work with Response? According to what I see in code it's not what promised in docs. For example, this will not work:

$response->headers->set('Content-Type', 'text/csv');
// ->headers are protected property
// ->set() there is no such method

If you have created response with

$response = $responses->string('hello world');

You also cannot set headers.

Currently I'm accumulating headers separately and building response object right at the end of processor action logic, just before return. But that's feels lame. Am I missing something?

Roman Tsiupa
@dracony
set() is public
and responses get the editable version, here:
Anton Kolenkov
@dorantor

A-ha. This is the part I've missed, thanks.
And what about body? Is it proper way?

// inside Processor action method
$this->response = $this->responses()->string('');
//...
$this->response->body()->write($someString);

What would be proper way and moment to create response within React like environment? Should it be within __constructor() or inside process() where I already catch and save Request for further processing. Or, maybe, there is a better way to access current Request object inside action method?

Roman Tsiupa
@dracony
Why do you need to write() after building the string response? If its to stream data incrementally there are better reponse types in the Responses class
I think the best would be to create the Reaponse as late as possible just before returning vs mutating it
But its just preference. There is nothing special about the response class itself really. I would definitely create it in process() then in constructor. Constructor to me seems to be just for wiring things and technically a single processor can serve multiple requests in sequential calls to process()
Anton Kolenkov
@dorantor

Why do you need to write() after building the string response? If its to stream data incrementally there are better reponse types in the Responses class

Because I need response to attach headers first. And, at the last moment, when everything else is in place(within Response object) I'm adding last piece - body. In my flow, headers and body are set separately in different places.

I think the best would be to create the Reaponse as late as possible just before returning vs mutating it

This is what I do now - collect headers in array and create Response just before Action return. But it feels slightly wrong - instead of single object responsible for response I have few.

But its just preference. There is nothing special about the response class itself really. I would definitely create it in process() then in constructor. Constructor to me seems to be just for wiring things and technically a single processor can serve multiple requests in sequential calls to process()

Good point, actually. Especially according to my context, where I'm trying to run application inside RoadRunner(React-like environment). So it's not just preference.