Giter VIP home page Giter VIP logo

belugas-php's Introduction

Made with Love by Icalia Labs

Overview

belugas-php is an engine for detecting application features for PHP projects based on static analysis, in other words belugas-php engine can detect the language, framework and database your PHP application is using.

This engine works as command line interface on your local machine of a Docker container:

Table of contents

Why?

belugas-php is part of the Whales ecosystem: A set of tools to automatically dockerize your applications.

What is a feature?

A feature is an application attribute detected during the static analysis. This analysis is the act of derivating data from code such as programming language, frameworks, service dependencies and so on. See here for a list of attributes this engine currently supports.

A feature has the following format:

{
  "type":"feature",
  "name":"PHP",
  "version":"5.6.30",
  "description":"The application uses PHP",
  "content":"",
  "categories":["Language"],
  "cue_locations":[""],
  "engines":["belugasd","belugas-php"]
}

Where:

  • type: Will always be a feature.
  • name: This is the name of the language, framework or database that is being used in the application.
  • version: The detected version of the feature. This one is optional
  • description: A string explaining the feature that was detected.
  • content: A markdown snippet describing the feature, including deeper explanations and links to other resources. This one is optional
  • categories: Features are associated with one or more categories, for now we're only handling three diferent categories: Framework, Language & Database
  • cue_locations: An array of Location objects representing the places in the source code that provide evidence of the detected feature. This one is optional
  • engines: An array of engine names that detected the feature, or refined the data detected by the previous engines.

Supported Features

Currently belugas-php can detect the following PHP frameworks:

  • CodeIgniter
  • CakePHP
  • Laravel
  • Yii
  • Zend

And the following databases:

  • MySQL
  • PostgreSQL
  • SQLite

We detect this features following Composer guideliness, so make sure it's included in your project.

Installation

Prerequisites

The Belugas PHP CLI is distributed and run as a Docker image, so you only need to have Docker installed and running on your machine.

Setup

Fire up your terminal and run:

docker pull gueils/belugas-php:development

And that's it!

Usage

Here's where the magic begins, first of all in your terminal go to the project directory you want to analyze:

cd code/path_to_project/

And then just execute the following command:

docker run \
  --interactive --tty --rm \
  --volume "$PWD":/code \
  gueils/belugas-php:development

And voilá! The terminal will stream a json output for each of the features detected in the following format:

{
  "type":"feature",
  "name":"posgresql",
  "version":"9.5",
  "description":"The application uses PGSQL",
  "categories":["Database"],
  "content": "",
  "cue_locations":[""],
   "engines":["belugas","belugas-php"]
}
{
  "type":"feature",
  "name":"PHP",
  "version":"5.6.30",
  "description":"The application uses PHP",
  "content":"",
  "categories":["Language"],
  "cue_locations":[""],
  "engines":["belugasd","belugas-php"]
}
{
  "type":"feature",
  "name":"laravel",
  "version":"5.1",
  "description":"The application uses LARAVEL",
  "content":"",
  "categories":["Framework"],
  "cue_locations":[""],
  "engines":["belugas","belugas-php"]
}

Contributing

Everyone is freely to collaborate, just make sure you follow our code of conduct. Thank you contributors!

Create an Issue

Find a bug and don't know how to fix it? Have trouble following the documentation or have a question about the project? Then by all means, please create an issue.

Just please make sure you check existing issues to see if what you're running into has been addressed already.

Submit a Pull Request

That's great! Just follow this steps:

  1. Create a separate branch for your edits
  2. Make sure your changes doesn't break the project by running your changes against current specs. We love tests! so it'll be even better if you create new ones when needed
  3. Open your pull request against master

Once you've created a pull request, mainteners will chime in to review your proposed changes and to merged it if everything is right 🎉

I want to contribute but don't know where to start

That's great also! We already have some open issues for you to dive in.

Credits

See LICENSE

Icalia Labs

Belugas-PHP is maintained by Icalia Labs

belugas-php's People

Contributors

mayra-cabrera avatar thelastinuit avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

belugas-php's Issues

Update documentation

  • Overview: Resume and Gif Demo

  • Getting Started
    Installation: Through Docker
    how to use: Command line

  • Whats new? Changelog about releases

  • Contributing: Guide to collaborate

  • Credits

Update image at docker hub

This is going to be the last step. It should be done once all the issues for this new milestone are complete

Update gif on readme

The current one is using icalialabs organization name, and it should use the new name instead

Documentation: Downcase repository name

We need to change belugas command on Usage & Setup sections on readme, from this:

docker run \
  --interactive --tty --rm \
  --volume "$PWD":/code \
  WhalesIL/belugas-php

To this

docker run \
  --interactive --tty --rm \
  --volume "$PWD":/code \
  whalesil/belugas-php

Otherwise Docker will complain

docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.

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.