Git Product home page Git Product logo

plugins.cakephp.org's Introduction

A CakePHP Application Skeleton

Build Status License Version Total Downloads

A fork of the official skeleton for creating applications with CakePHP 3.x. It should be more or less "batteries included"

Installation

  1. Download Composer or update composer self-update.
  2. Run php composer.phar create-project --prefer-dist josegonzalez/app [app_name].

If Composer is installed globally, run

composer create-project --prefer-dist josegonzalez/app [app_name]

In case you want to use a custom app dir name (e.g. /myapp/):

composer create-project --prefer-dist josegonzalez/app myapp

You can now either use your machine's webserver to view the default home page, or start up the built-in webserver with:

bin/cake server -p 8765

Then visit http://localhost:8765 to see the welcome page.

Update

Since this skeleton is a starting point for your application and various files would have been modified as per your needs, there isn't a way to provide automated upgrades, so you have to do any updates manually.

Features

Installed Packages and Plugins

The following is a list of CakePHP plugins that are installed and pre-configured:

The following is a list of PHP packages that are installed and pre-configured:

Configuration

By default, this skeleton will use josegonzalez/php-dotenv to load configuration from the following files:

  • config/app.php
  • config/.env
    • if this file does not exist, config/.env.default

For "global" configuration that does not change between environments, you should modify config/app.php. As this file is ignored by default, you should also endeavor to add sane defaults to app.default.php.

For configuration that varies between environments, you should modify the config/.env file. This file is a bash-compatible file that contains export KEY_1=VALUE statements. Underscores in keys are used to expand the key into a nested array, similar to how \Cake\Utility\Hash::expand() works.

As a convenience, certain variables are remapped automatically by the config/env.php file. You may add other paths at your leisure to this file.

Asset Compression

The markstory/asset_compress plugin is installed and enabled by default. It is used by the CrudView plugin, but does not currently have an integration with the default layout.

Crud Defaults

By default, the crud plugin has been enabled with all known customizations. Simply creating a controller will enable all CRUD-actions in the default RESTful api mode.

Note that we also default pagination sorting to the table's primaryKey (if there is a single primaryKey field).

Crud View Defaults

Crud View is enabled for all admin-prefixed actions in the Application::beforeFilter. You may also turn it on automatically for a controller by setting the controller's $isAdmin property to true.

Note that the scaffold.brand is set to the constant APP_NAME, which can be modified in your config/.env.default or config/.env files.

Customizing Bake

There now exists a config/bake_cli.php. This file should contain all bake-related event handlers. It is used to speed up the re-bake process such that we don't need to go in and re-add customizations.

As an example, the following event handler will add the Josegonzalez/Upload.Upload plugin to the Users.photo field:

EventManager::instance()->on('Bake.beforeRender.Model.table', function (Event $event) {
    $view = $event->subject();
    $name = Hash::get($view->viewVars, 'name', null);
    if ($name == 'Users') {
        $behaviors = Hash::normalize(Hash::get($view->viewVars, 'behaviors', []));
        $behaviors['Josegonzalez/Upload.Upload'] = ['photo' => []];
        $view->set('behaviors', $behaviors);
    }
});

Please refer to the bake documentation for more details.

Error Handling

Custom error handlers that ship errors to external error tracking services are set via the josegonzalez/php-error-handers package. To configure one, you can add the following key configuration to your config/app.php:

[
    'Error' => [
        'config' => [
            'handlers' => [
                // configuring the BugsnagHandler via an env var
                'BugsnagHandler' => [
                    'apiKey' => env('BUGSNAG_APIKEY', null)
                ],
            ],
        ],
    ],
];

Then simply set the proper environment variable in your config/.env or in your platform's configuration management tool.

Heroku Support

Heroku and other PaaS-software are supported by default. If deploying to Heroku, simply run the following and - assuming you have the proper remote configuration - everything should work as normal:

git push heroku master

Migrations for the core application will run by default. If you wish to run migrations for plugins, you will need to modify the key scripts.compile in your composer.json.

Queuing

Queuing support is provided through the Queuesadilla php package, with a CakePHP plugin providing integration.

You can start a queue off the jobs mysql table:

# ensure everything is migrated and the jobs table exists
bin/cake migrations migrate

# default queue
bin/cake queuesadilla

# also the default queue
bin/cake queuesadilla --queue default

# some other queue
bin/cake queuesadilla --queue some-other-default

# use a different engine
bin/cake queuesadilla --engine redis

You can customize the engine configuration under the Queuesadilla.engine array in config/app.php. At the moment, it defaults to a config compatible with your application's mysql database config.

Need to queue something up?

// assuming mysql engine
use josegonzalez\Queuesadilla\Engine\MysqlEngine;
use josegonzalez\Queuesadilla\Queue;

// get the engine config:
$config = Configure::read('Queuesadilla.engine');

// instantiate the things
$engine = new MysqlEngine($config);
$queue = new Queue($engine);

// a function in the global scope
function some_job($job)
{
    var_dump($job->data());
}
$queue->push('some_job', [
    'id' => 7,
    'message' => 'hi'
]);

See here for more information on defining jobs.

Layout

The app skeleton uses a subset of Foundation CSS framework by default. You can, however, replace it with any other library or custom styles.

plugins.cakephp.org's People

Contributors

admad avatar arhell avatar dependabot[bot] avatar dereuromark avatar josegonzalez avatar markstory avatar othercorey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugins.cakephp.org's Issues

Generate a composer repository with all the plugins

Most of the plugins in the CakePHP community cannot be loaded using Composer without declaring a custom package. It would be great to make plugins.cakephp.org a Composer repository, using Satis for instance : http://getcomposer.org/doc/articles/handling-private-packages-with-satis.md

This ticket is created to start discussions about this feature.
I think the information available for now are sufficient for working on a POC, and there will be rooms for improvements later.

Here are my thoughts:

  1. Implement a Satis configuration file generator from the database. Here is an untested draft:
{
    "name": "CakePHP Plugins",
    "homepage": "http://plugins.cakephp.org",
    "repositories": [
        {
            // Package example for a repository without composer.json file
            "type": "package",
            "package": {
                "type": "cakephp-plugin",
                "name": "CakeDC/migrations",
                "version": "master",
                "source": {
                    "url": "git://github.com/CakeDC/migrations.git",
                    "type": "git",
                    "reference": "master"
                },
                "require": {
                      "php": ">=5.2", // This information is not yet available on plugins.cakephp.org, but it is an example of improvement
                      "pear-cakephp/CakePHP": "2.1.3", // Another improvement example
                      "shama/baton": "*" // important so we can use installer for CakePHP specific types
                }
            }
        },
        { "type": "vcs", "url": "http://github.com/mycompany/privaterepo2" }, // if a composer.json file is detected
        { "type": "pear", "url": "http://pear.cakephp.org/" }
    ],
    "require-all": true
}
  1. Regenerate the file using a cron task to build the static Composer repository with satis (after each repository monitoring)

Promoting Composer as a plugin installer makes sense since it becomes widely used in the PHP ecosystem. It would be better imo than a custom made API as suggested in #23

Integrate a project’s readme

it's a bitch to parse all the different readme formats... perhaps a textarea with the source would be enough (since we can all read most of the formats by site)... just enough to get a summary of an unfamiliar project

[PACKAGES] RSS Sanitization Escaping issues

RSS feeds are escaped at the moment. While this is necessary to remove possible XSS-attacks, we should be mindful of other character sets (Japanese) that totally get screwed up by this process.

Github OAuth login

Integrate with GitHub’s OAuth implementation for user accounts. This should only allow users to login to the user record where the github IDs match. Also to consider is whether or not we should allow users to administrate Organizations. See issue #17 for more information.

file_get_contents() throws an error if 404 on packages/view

I added some extra goodness to the packages/view page that are things I've always wished someone else would simply show to give you more feedback about the activity of projects. As you can see, I hackishly hardcoded the urls to try and get to the README (or README.markdown) but unfortunately due to the nature of file_get_contents() if either of those pages are missing (404) I get rather ungraceful warnings.

I was hoping you would know the proper way to clean that snippet of code up?

[USERS] Enable OAuth Authentication

When I was using Authsome for authentication, I had an experimental behavior that added Github/Twitter authentication, allowing users to authenticate using Github and then allowing them to curate their own plugins - either by adding more meta-data or specifying versions etc. We should bring this back now that we are in 2.0 and can write arbitrary Authentication adapters for AuthComponent.

parse download count / forks

Again, this would be in an effort to identify popular/active projects.... more forks/downloads = more popular

Api Controller is not able to return search results

I have setup the packages repo locally and nearly got it working.

The api no longer shows search results via BakingPlate.search

I have found the following two issue which get more working
View/Api/json/one_install.ctp is missing
and in ApiController checking $this->request->params['url'] does not return results perhaps $this->request->pass

Maintainer login.

I know you don't want login right now, but I think it would be nice if we eventually cater to letting maintainers login so they can help update their own package/account info. I don't think we should let people register however, just let them submit for a new password with their existing emails only.

Allow users to submit new packages for inclusion in the index

Currently the process of adding a new package to the index is a bit hapharzard:

  • Login as administrator
  • Ensure maintainer is added through /github/add_maintainer/MAINTAINER_NAME
  • Add package through /github/add_package/MAINTAINER_NAME/PACKAGE_NAME

This automatically queues up jobs to handle all the logic. Ideally the workflow would be thus:

  • Authenticate via github
  • Submit url of github repository to a form
    • Optionally show a list of your own repos to get added
  • Email sent to admin
  • Admin reviews the repository straight from the email
  • One-click link for admin to add the repository from the email
  • Maintainer/Package add job gets queued and processes the Maintainer/Package

Better Package Characterizer

At the moment, the Package Characterization system uses token_get_all() to figure out what kind of code a particular project has. While nice, it does not detect whether a piece of code is following CakePHP standards, nor whether it is in a proper plugin/app format.

Ideally, we'd have a more robust package characterizer that would use ReflectionClass, but not bork on Fatal Errors from not being able to include files. The solution to this does not have to be in PHP.

Set CakeDjjob default retry to 1

On occasion, Jobs are unable to find tables. While this may be some logic error somewhere in the app, these jobs typically run okay if reset, so adding a default retry of 1 would help mitigate this issue.

[SHELL] Process Google Alerts for new repositories

At some point, I had a cron working that processed incoming google alerts to a given email address. It would be nice to bring this back.

  • Once an hour, a shell retrieves a Google Alert rss feed
  • Process the urls of each item in the list to retrieve the base url for the repository
    • This should throw out anything in a specific blacklist, like cakephp/cakephp
    • Throw out all non-repository urls. Maybe keep gist urls?
  • Match all repositories against existing repos. If they exist, throw out the item
  • Check to see if the repository is a fork. If so, throw it out
    • At some point, we may want to list forks, or at least have the option of making it the "mainline", especially for migrations to 2.0
  • Get a list of all branches, the repository name, and some stats
  • Insert the repos into a table for later processing
  • Send an email to the site admin with a list of all new potential repos

The email would have some general data about the packages, including the link to the repo, the description, and other stats collected, as well as a link to automatically approve the package on plugins.cakephp.org. We can use a token system so that logging in is not required for approving the package.

Thoughts?

User Dashboard

It might be possible to aggregate different information for users in one distinct dashboard. Might integrate a risingcake.com like news dashboard, with possible "watching" of up to three projects.

Search Results should be sorted

I've been fiddling with the code, nothing worth pulling yet, mostly trying out a few ideas.

One thing I've noticed is that search results usually suck (except for the first few results). I looked around the searchable plugin but I'm not 100% sure how you are building your queries, I figure you're using some SQL 'LIKE' condition or other that searches for peices of the search term, instead of a literal comparison of the whole term.

Of course those results are still relevant, however they're usually pretty far off. It would be nice if you could group them seperately, like have a list of results at the top for the ones that matched a literal search and then a list of results that didn't below. However thinking about how to implement this would probably take a lot more time than the whole thing is worth, lol.

delimiter on multiple search terms

New layout and new functionality :)

There are now "max # of open issues" etc to be search for.
But the help text does not tell the user how to concatenate multiple such search terms.
is it , [comma] or some other delimiter?

obviously it is a comma: "watchers:2, forks:2"
but that you need to find out via trial and error.

Bad result sort ordering

Looks like results are being sorted oldest -> newest
Should probably be the other way around.

"Load more" package pagination

Hello everyone.

First of all I apologize because I know it's not the best place to ask but I didn't know how to contact the devs of this app...

I'm trying to achieve the "load more" ajax pagination that appends the results like in this page : http://plugins.cakephp.org/

But even after lurking the code I can't manage to make it work...

Can you give me any insight ?

Again, I'm sorry for asking here.

Thanks a lot for your time.

Social Integration (Commenting, Rating, Tagging)

Because of the way the app was built, there is no way at the moment to rate, comment, or tag packages. Ideally we could take off-the shelf plugins and build this into the app quickly, but we still need lots of UI work to make it all look great.

Line 37 of App_Model.php

That line, hell I think a few lines above it too, were causing errors in a few places. I'm being lame and not giving use cases... sorry. As soon as I come up again I will be sure to do so, I just wanted to note this somewhere in case I forget.

I believe it occurs on the tags/view during Tag->read($id)

[SITE] Add a maintenance page

It would be useful, when performing migrations, to be able to show a maintenance page from within the app, in case migrations don't go as planned.

Could also be used during deployment.

[ADMIN] Kick off admin jobs via a form

Would be nice to have a dropdown of all available jobs, with the parameters they take, and a small form for each job so that we can manually create jobs on the fly.

/Concole dependancy on root folder execution

Ive struggled with the migration tool for a few hours now, just to realise that executing the Console scritps from within the Console folder fails.
Apparently I am required to be within the main /app.
This is a limitation that is not very obvious at all. Please remove this strict pathing in this, otherwise really useful tool

[ADMIN] Manually update package attributes

Should also make them sticky, as the automatic categorization throws away the old attrs.

Would also be good to make it so that it's straightforward to add new attribute fields.

[ADMIN] Use client-side JS to submit new packages to index

This should only be available to admins, but the idea is that you can:

  • Login
  • Fill out a form with maintainer/repository name
  • Javascript queries the GH api for the requisite info
  • This is submitted to the server
  • Server processes it and creates the repo on the fly

This would relieve the need to have to wait for a background job which might potentially fail.

"Internal Server Error" because of .htacces file in webroot

i get "Internal Server Error" because of .htacces file in webroot

and its working when i remove this line:
<FilesMatch ".(eot|svg|ttf|woff)$">
ExpiresDefault "access plus 7 days"


Server version: Apache/2.2.20 (Ubuntu)
Server built: Feb 14 2012 16:35:35

[ADMIN] Ability to tag/re-tag packages

Of note is that tagging is currently completely unimplemented. We should definitely investigate the process of allowing users to add tags to packages once we have a user system in place.

Also, we should be able to blacklist tags, in case anyone tries to spam it up.

Admin controls check is kinda weak? Doesn't use session?

I copy-pasted the code that checks the config file and displays links to add/edit/delete almost everywhere I myself put those links. I didn't look too much into it, but it seems like this check is for dev-environment vs production environment rather than a check to see if the user is logged in (or an admin). Perhaps we should update this throughout?

Note: this check is also done in the resource_helper under tagTree() so I don't forget to update here too.

[GITHUB] Update datasource

This is currently partially broken since the move to API V3. Perhaps simply using a wrapper class would be the best solution.

Full Plugin Installer API

There is currently an ApiController which should integrate with package_installer, but its barely working and because there are no plans to support anything other than GitHub's API - contributions welcome! - the ideas behind it are outdated.

If anyone would like to lead the charge, that would be great. I can write up some ideas for it if need be.

Refs #33 - Add new theme with more powerful searching

Refs #33 - we should add a new theme with more powerful searching, comma-delimited terms with key-value pairs separated by a colon.

Note: instructions should be present on the page so the user doesn't find the search features via trial and error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.