Code Monkey home page Code Monkey logo

ssshell's Introduction

ssshell

REPL for SilverStripe running on Psy Shell ๐Ÿš€

Install

Install the (latest) version in your current project with:

  $ composer require --dev pstaender/ssshell dev-master

Optionally: To use the handy ssshell command, install it globally (ensure that .config/composer/vendor/bin is in the path):

  $ composer global require pstaender/ssshell dev-master

Usage

To use ssshell just type ./vendor/bin/ssshell (or ssshell if its installed globally) in your project folder and you can start using the shell:

  Psy Shell v0.9.9 (PHP 7.3.6 โ€” cli) by Justin Hileman
  Loading live environment (SilverStripe Framework ^ v4.0.0)
  >>>

Features

Namespaces and views of objects and lists

ssshell comes with a set of frequent used namespaces for convenient REPL handling.

By default all DataObjects, DataLists, ArrayLists and Query objects will be displayed in a human-readable fashion.

As example, creating a SilverStripe User would be:

  >>> Member::create(['Email' => 'editor', 'Password' => 'password'])->write()
  => 1
  >>> Member::get()->first()
  => SilverStripe\Security\Member {#3229
      +ClassName: "SilverStripe\Security\Member",
      +LastEdited: "2019-07-01 11:34:54",
      +Created: "2019-07-01 11:34:54",
      +Email: "editor",
      +Password: "$2y$10$9b5f51921992948f40cf7uHeqjQLuG9Bnqf4sq54TBnsB80CmwJhC",
      +PasswordEncryption: "blowfish",
      +Salt: "10$9b5f51921992948f40cf75",
      +Locale: "en_US",
      +FailedLoginCount: 0,
      +ID: 1,
      +RecordClassName: "SilverStripe\Security\Member",
      +LoggedPasswords: [
        [
          "ClassName" => "SilverStripe\Security\MemberPassword",
          "LastEdited" => "2019-07-01 11:34:54",
          "Created" => "2019-07-01 11:34:54",
          "Password" => "$2y$10$9b5f51921992948f40cf7uHeqjQLuG9Bnqf4sq54TBnsB80CmwJhC",
          "Salt" => "10$9b5f51921992948f40cf75",
          "PasswordEncryption" => "blowfish",
          "MemberID" => 1,
          "ID" => 1,
          "RecordClassName" => "SilverStripe\Security\MemberPassword",
        ],
      ],
      +RememberLoginHashes: [],
      +LinkTracking: [],
      +FileTracking: [],
      +Groups: [],
    }

Sake command

You can use all familiar sake commands:

  >>> sake dev/build
  Building database SS_test using SilverStripe\ORM\Connect\MySQL 8.0.16


  CREATING DATABASE TABLES

  * File (0 records)
    * CHECK TABLE command disabled for PDO in native mode
  * SiteConfig (1 records)
  โ€ฆ
>>> sake dev/tasks
SILVERSTRIPE DEVELOPMENT TOOLS: Tasks
--------------------------

 * Migrate SiteTree Linking Task: sake dev/tasks/MigrateSiteTreeLinkingTask
 * Database Migrations: sake dev/tasks/MigrationTask
โ€ฆ

Static Command

View available static properties / methods of classes.

Displays static properties and methods:

>>> static SilverStripe\Control\Director

To display only one of them:

>>> static props SilverStripe\Control\Director
โ€ฆ
>>> static methods SilverStripe\Control\Director
โ€ฆ

ssshell's People

Contributors

pstaender avatar ssmarco avatar

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.