friendsofphp / pickleweb Goto Github PK
View Code? Open in Web Editor NEWPackagist like application for PHP Extensions, via Pickle or simple index
License: BSD 2-Clause "Simplified" License
Packagist like application for PHP Extensions, via Pickle or simple index
License: BSD 2-Clause "Simplified" License
Now that we have coke, it would be nice to add the respective commands to bin/ to fix CS or detect errors.
I can then use them as git prehook and stop on error
Add meta for extensions, keywords, then use them in elasticsearch
See:
http://www.appelsiini.net/projects/slim-basic-auth
http://www.lornajane.net/posts/2013/oauth-middleware-for-slim
Not sure it is possible the same way using github/bitbucket auth, but just to do not forget it :)
Currently only JSON data is accepted from github, supporting application/x-www-form-urlencoded might be subject of the further refactoring/extending.
For example:
. https://github.com/KnpLabs/packagist-api should work out of the box when using pickleweb
For what packagist does:
Quote from a discussion with Jordi:
It all starts with:
https://packagist.org/packages.json
Then provider-includes define a list of provider listings, e.g.:
p/provider-2013$%hash%.json: {
sha256: "41baf880b781a44db23b1e880f014e25cdc59939b381deb38f8d52d5a74ef717"
},
can be queried at:
And inside that, every provider like:
0x20h/monoconf: {
sha256: "b5bc3eac62b9f38814b140be994c268b7c1f3d9d32bea4dfc53ca15def1f27e1"
},
Can be found at the url defined by providers-url
in the main file, i.e.:
And providers can also be found at just the package name without hash, which might be useful eventually so it's best if you also do it I guess:
That URL is hardcoded to /p/%name%.json
https://packagist.org/p/0x20h/monoconf.json
It's all done in https://github.com/composer/packagist/blob/master/src/Packagist/WebBundle/Package/SymlinkDumper.php for reference.
--- end of the quote
It should be done in a similar way but maybe simpler, from a tree structure point of view.
What are the coding standards used for the project ?
My IDE (phpstorm) is configured with Symfony2 CS but I see @pierrejoye fixing the spaces between . on string concatenation ๐
As I've the habit of regularly launch the auto-format of the code, it would be usefull to know which CS is used and perhaps enforce verification via a tool like https://github.com/M6Web/Coke on build process on Travis CI.
Keep getting this error. Are we relying on the right images?
E: Failed to fetch http://http.debian.net/debian/pool/main/e/expat/libexpat1_2.1.0-6+b3_amd64.deb Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]
E: Failed to fetch http://http.debian.net/debian/pool/main/l/less/less_458-3_amd64.deb Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
For the UI:
Just some thoughts to get the TODOs :)
I might err, but currently we've also an issue with the vendors coming from different locations. Example situation
Those two are different people. Each of them has the same vendor0/extname
. Here we currently run into the situation first with json handling in pickleweb as it's not separated by the vendor location. Say it would save to the same web/json/vendor0
for both vendors.
There's no issue created for pickle yet, but it also doesn't really handle the communication with pickleweb yet. So it would need to match with pickleweb anyway when implemented. In this regard also rmtools is affected, as it'll need to handle the vendors from different locations for uploading the windows builds.
The other sub case of this which needs to be handled is when the name in composer.json doesn't have a vendor. While it can be probably fixed for pickle convert, pickleweb might receive some hand made composer.json.
Upgrade/refactor to slim 3.
Quite a few changes but last bug thing I have been waiting for to go live.
Some data not publish publicly in the service provider should not be available in the users/.json or not secured view of a user profile
Slim Application Error
The application could not run because of the following error:
Details
Type: ErrorException
Code: 8
Message: Undefined index: time
File: E:\repo_pickle\pickleweb\src\Entity\Extension.php
Line: 108
Trace
#0 E:\repo_pickle\pickleweb\src\Entity\Extension.php(108): Slim\Slim::handleErrors(8, 'Undefined index...', 'E:\repo_pickle...', 108, Array)
#1 E:\repo_pickle\pickleweb\src\Controller\PackageController.php(233): PickleWeb\Entity\Extension->setFromRepository(Object(PickleWeb\Repository\Github), Object(Composer\IO\BufferIO))
#2 [internal function]: PickleWeb\Controller\PackageController->registerPackageAction()
#3 E:\repo_pickle\pickleweb\vendor\akrabat\rka-slim-controller\RKA\Slim.php(79): call_user_func_array(Array, Array)
#4 [internal function]: RKA\Slim->RKA{closure}()
#5 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Route.php(468): call_user_func_array(Object(Closure), Array)
#6 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Slim.php(1357): Slim\Route->dispatch()
#7 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Middleware\Flash.php(85): Slim\Slim->call()
#8 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash->call()
#9 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#10 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
#11 E:\repo_pickle\pickleweb\src\Application.php(181): Slim\Slim->run()
#12 E:\repo_pickle\pickleweb\web\index.php(209): PickleWeb\Application->run()
#13 {main}
The way to reproduce:
Any subsequent tag will have similar error message, no exception thrown.
Currently there's no validation of the tag with the version in the composer.json. This difference, besides confusing, would cause the versions compiled/packaged be different from what is shown on the pickleweb site or in phpinfo().
This interfere with the pickle issue FriendsOfPHP/pickle#111 , so pickleweb could be using the pickle itself for the triple validation - tag, composer.json and the version in the header file (or any other way for different engines).
hi,
config.json should be in .gitignore and config.json.in added, to avoid pushing real id by mistake :)
All in the title ;-)
On the home (or upcoming list), make package name a link, same action as "view package"
Implement search using elasticsearch
See FriendsOfPHP/pickle#108 and #27 as well
Before going wild, we should update to slim3 as the work will much easier without being live :)
Guidelines and changes: http://www.slimframework.com/docs/start/upgrade.html
Mainly the flash messages will be a slightly big changes.
ext-vendor/repo or ext-name is the current format used in composer itself.
Supporting this syntax will allow composer dependencies solver to call pickleweb directly before calling pickle
See:
https://packagist.org/packages/doctrine/orm
Something similar has to be done :) Low prio tho for now :)
On failure, already executed transactions must be reverted.
Easy with redis, but for the files it needs slightly more, still not very complicated but added as todo :)
Little hack has been added, see https://github.com/FriendsOfPHP/pickleweb/blob/master/src/Action/AuthGithub.php
Ideas are:
As of now only github is done, so some data normalization is required.
I kept it like that for now as I like to focus mainly on the hooks, to grab release infos, register package, etc. The way it is stored is open as well, it works just fine for now, and easy to cache.
Feel free to totally rewamp that part or even use another OAuth component.
Using:
https://github.com/FriendsOfPHP/pickleweb/blob/master/src/Controller/PackageController.php#L63
Forced to use local variable $user, modify the entity and store it (UserRepository).
Using $this->app->user, no modification are taken into account.
I did not look into the code to figure out why but not very critical for now, would be nice to be able to alter User meta and store them back to redis using the app::user
When the search form contains some query text, then hitting enter submits the form to a URL like http://81fb0b33.ngrok.io/searchhtml/?search_query=aoeuoaeu
which is just an empty page containing the text "null". The form submission should be most likely prevented as the search works per AJAX.
While testing the pickleweb site, I've discovered, that it's not prepared for all the variants of the data delivery from github. Thus, under the option
when any of the options
is used, the payload json format is different. In this case pickleweb fails to parse it so no data update happens to the particular item. The only way i could bring the github data to be accepted right now is using the
option and manually enabling the create event (in addition to the preselected push event). Here are the both different JSON format variants
https://gist.github.com/weltling/f97b1cc4630c071829f3
https://gist.github.com/weltling/13a075879eb91e922d61
Also note that if the create event is enabled manually, then after the tag creation the headers contain
otherwise it contains
small detail, but the header should always reflect the state of the session, if logged, account and register an ext, or other auth'ed link while showing only login if not.
A simple list of the extensions bundled in the core per major version.
pickle cmd line or composer can then fetch them to directly deal correctly with it and tell the user to either enable, install or rebuild them php, alternatively rebuild php.
The list will be:
[
'extname' => false,
'extname' => 'vendor/repo',
]
false means this extension is only maintained in core.
'vendor/repo' is the name of the extensions within pickle, so if an newer external release is available, it can be installed.
Files:
/json/php-core-5.4.json
/json/php-core-5.5.json
/json/php-core-5.6.json
/json/php-core-7.0.json
Delete an extension:
Once the API is in place, the hooks to automatically get new releases can be implemented.
When typing the query hello/
into the search box, the server delivers 500 and the UI doesn't respond anymore. Same with typing a \
in there. So there are two issues:
\
and /
, need some special handlingHere's the exception delivered:
Slim Application Error
The application could not run because of the following error:
Details
Type: Elastica\Exception\ResponseException
Message: SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[dSbwdMkNQSmemFLsqt0NYg][packages][0]: SearchParseException[[packages][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][1]: SearchParseException[[packages][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][2]: SearchParseException[[packages][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][3]: SearchParseException[[packages][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][4]: SearchParseException[[packages][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }]
File: /app/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php
Line: 158
Trace
#0 /app/vendor/ruflin/elastica/lib/Elastica/Request.php(168): Elastica\Transport\Http->exec(Object(Elastica\Request), Array)
#1 /app/vendor/ruflin/elastica/lib/Elastica/Client.php(603): Elastica\Request->send()
#2 /app/vendor/ruflin/elastica/lib/Elastica/Search.php(443): Elastica\Client->request('/_search', 'GET', Array, Array)
#3 /app/src/Controller/SearchController.php(58): Elastica\Search->search('')
#4 [internal function]: PickleWeb\Controller\SearchController->searchHtml()
#5 /app/vendor/akrabat/rka-slim-controller/RKA/Slim.php(79): call_user_func_array(Array, Array)
#6 [internal function]: RKA\Slim->RKA{closure}()
#7 /app/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#8 /app/vendor/slim/slim/Slim/Slim.php(1357): Slim\Route->dispatch()
#9 /app/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#10 /app/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#11 /app/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#12 /app/vendor/slim/slim/Slim/Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
#13 /app/src/Application.php(181): Slim\Slim->run()
#14 /app/web/index.php(209): PickleWeb\Application->run()
#15 {main}
Since @jubianchi PR, composer cs
and composer test
don't work at all ๐ข
move the code from PackageController to a common place
Release happen in the github hook callback.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.