Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 16 00:45

    nicksagona on 3.3.1

    (compare)

  • Feb 16 00:45

    nicksagona on master

    Update composer (compare)

  • Feb 16 00:44

    nicksagona on v3-dev

    Update composer (compare)

  • Feb 14 22:54

    nicksagona on 3.5.1

    (compare)

  • Feb 14 22:52

    nicksagona on master

    Update composer (compare)

  • Feb 14 22:52

    nicksagona on v3-dev

    Update composer (compare)

  • Feb 14 22:32

    nicksagona on 5.0.5

    (compare)

  • Feb 14 22:31

    nicksagona on master

    Update pop-debug (compare)

  • Feb 14 22:31

    nicksagona on v5-dev

    Update pop-debug (compare)

  • Jan 31 17:46

    nicksagona on 5.0.4

    (compare)

  • Jan 31 17:45

    nicksagona on master

    Add callable object for use of … (compare)

  • Jan 31 17:45

    nicksagona on v5-dev

    Add callable object for use of … (compare)

  • Jan 28 19:33

    nicksagona on 3.4.0

    (compare)

  • Jan 28 19:33

    nicksagona on 3.4.0

    (compare)

  • Jan 28 19:32

    nicksagona on master

    Update docblocks (compare)

  • Jan 28 19:32

    nicksagona on v3-dev

    Update docblocks (compare)

  • Jan 28 18:02

    nicksagona on 3.4.0

    (compare)

  • Jan 28 18:02

    nicksagona on 3.4.0

    (compare)

  • Jan 28 18:01

    nicksagona on master

    Update versions (compare)

  • Jan 28 18:01

    nicksagona on v3-dev

    Update versions (compare)

Nick Sagona
@nicksagona
Also just cut a new release for pop-http -> 3.5.5
added a $streamToFile parameter to the Pop\Http\Request class constructor (4th parameter.) This allows for the streaming of large raw data from php://input to a file on disk (instead of storing it in memory)
it can be used in a couple of different ways:
// Set to true: stores the raw data file in the system tmp folder
$request = new Pop\Http\Request(null, null, null, true);

// Access the file location
$rawDataFile = $request->getRawData(); // would be something like /tmp/pop-http-5edc43ad
// Set to specific folder: stores the raw data file in folder of your choosing
$request = new Pop\Http\Request(null, null, null, '/my-folder');

// Access the file location
$rawDataFile = $request->getRawData(); // would be something like /my-folder/pop-http-5edc43ad
// Set to specific folder and file: stores the raw data file in the exact file of your choosing
$request = new Pop\Http\Request(null, null, null, '/my-folder/my-file');

// Access the file location
$rawDataFile = $request->getRawData(); // would be something like /my-folder/my-file
Nick Sagona
@nicksagona
If that new parameter isn't set, then the raw data stream coming in from php://input will behave as before, so for example, if the stream was some string of JSON data {"user_id": 123}
and you called $request->getRawData() it would just return the raw JSON string from memory
John Esteban Astete Arambarri
@johnnestebann
thanks!
Nick Sagona
@nicksagona
ok 4.5.0 beta-3 just released, includes these updates:
  • Improved support for standard SQL functions in pop-db (v5.0.3)
  • Better support of large raw data streams storing to file (instead of in memory) in pop-http (v3.5.5)
  • Added support for output variations under one source in pop-i18n (3.1.0)
Nick Sagona
@nicksagona
Hey everyone , 4.5.0 beta-4 just released. Updates include:
  • Addition of the CallableObject class in pop-utils (v1.1.0) to help manage various callable entities and their parameters
  • Refactored the event manager and service locator in popphp (3.4.0) to utiltize the new CallableObject features in pop-utils
John Esteban Astete Arambarri
@johnnestebann
I have a question when I do "composer create-project popphp/popphp-framework blog"
maybe could be a problem about dependencies/requirements
John Esteban Astete Arambarri
@johnnestebann
the pop-kettle version installed is 1.0.2, but this version have BC breaks, for example the changes between setHeader and addHeader functions on AbstractController
and if I want to update the component, I have a conflict about "requirements or minimun-stability"
Nick Sagona
@nicksagona
Hey - yea, check the README for the popphp-framework repo... you need to use -s beta
composer create-project -s beta popphp/popphp-framework project-folder
4.5 should be out of beta soon... everything's ready to go, just trying to finish off some functionality/features for pop-pdf
that's the only component still in beta really
Nick Sagona
@nicksagona
Hey everyone - looking for some input regarding some changes I'd like to make to the pop-http component.
Basically, I wanted to better differentiate between the server request/response classes and the client request/response classes
had a couple of people suggest it might be confusing since the server classes are top level (Pop\Http\Request and Pop\Http\Response) vs the client classes are down in the Pop\Http\Client namespace like Pop\Http\Client\Request and Pop\Http\Client\Response
I was thinking about normalizing it so the server classes have their own namespace as well, like Pop\Http\Server\Request and Pop\Http\Server\Response
which may clear up any confusion.... but would lead to possible BC breaks
anyone have any thoughts or input on this topic? Thanks in advance
here's some of the work I've done on a v4-dev branch so far: https://github.com/popphp/pop-http/tree/v4-dev/src
John Esteban Astete Arambarri
@johnnestebann
I'm active on some developments with version 4.1.0 and 4.5.0-beta-4, but I think you're right, it's better understood
Nick Sagona
@nicksagona
ok thanks for the feedback... I think the worse case is people will have to add \Server to their use statements - for example, changing from Pop\Http\Request to Pop\Http\Server\Request
Nick Sagona
@nicksagona
Ok v4 of pop-http is complete... not live yet... I haven't cut a release yet. If anyone wants to look it over, you can do so over on the v4-dev branch here: https://github.com/popphp/pop-http/tree/v4-dev
Nick Sagona
@nicksagona
Ok Pop PHP Framework 4.5.0 beta-5 was just released. The framework and all corresponding components use the newly re-factored pop-http v4. I believe BC breaks have been kept to a minimum and the main thing that will have to change is any references to Pop\Http\Request and Pop\Http\Response will have to change to Pop\Http\Server\Request and Pop\Http\Server\Response, respectively
Furthermore, those of you using pop-kettle, make sure you have v1.3.0 which now comes with the proper updates to the underlying templates to utilize pop-http v4.
Thanks!
John Esteban Astete Arambarri
@johnnestebann
Hi! I'm using the 4.5 beta-5, and I having some troubles with Relationships and Associations. I have this relationships: movie hasOne quality and quality hasMany movie, but when I wanna show the movie list with his qualities, it show me a bad list
Nick Sagona
@nicksagona
Hey - I'm looking into this right now
Nick Sagona
@nicksagona
so here's some quick code to illustrate how it should work:
assume 2 classes like this:
class Movies extends Pop\Db\Record
{
    public function qualities()
    {
        return $this->hasMany('Qualities', 'movie_id'); // 'movie_id' is the FK 
    }
}
class Qualities extends Pop\Db\Record
{
    public function movie()
    {
        return $this->belongsTo('Movies', 'id'); // 'id' is the primary key that is used to get the parent relationship
    }
}
Here's the results of the following queries:
$movie = Movies::findById(1);        // Get a single movie
$qualities = $movie->qualities();  // Get all qualities of that movie
print_r($movie->toArray());
print_r($qualities->toArray());
this gives you:
// Movie
Array
(
    [id] => 1
    [title] => Avengers
)
// Qualities of the movie
Array
(
    [0] => Array
        (
            [id] => 1
            [movie_id] => 1
            [type] => Great
        )

    [1] => Array
        (
            [id] => 2
            [movie_id] => 1
            [type] => Exciting
        )

)
And in reverse:
$quality = Qualities::findById(1);       // Get a single quality
$parentMovie = $quality->movie();  // Get that quality's parent movie
print_r($quality->toArray());
print_r($movie->toArray());
and that gives you:
// Quality
Array
(
    [id] => 1
    [movie_id] => 1
    [type] => Great
)
// Movie the quality belongs to
Array
(
    [id] => 1
    [title] => Avengers
)
so the DB schema is a table movies and a table qualities with a FK qualities.movie_id referencing back to movies.id
Nick Sagona
@nicksagona
you set up the helper functions in the Record classes like above, and you should be able to get the child relationships (hasMany) and parent relationships (belongsTo or hasOne)
Let me know if this makes sense and is working for you in this way. Thanks.