Giter VIP home page Giter VIP logo

sliver's Introduction

Sliver

Tinker with a sliver of your code with an interactive debugger and REPL for SilverStripe, powered by psysh.

Inspired by Laravel's artisan tinker, and powered by psysh, Sliver allows you to play with your SilverStripe code during runtime with the added debugging functionality from psysh.

Installation

Install the Sliver cli globally by running the following command:

$ composer global require littlegiant/sliver

Usage

  • Simply run sliver in the root of your SilverStripe project.
  • Write your line of PHP code and hit enter.
  • That line of code will then be run and the output value of that line will be displayed in console.

For more information, check out psysh's documentation.

License

Sliver is released under the MIT license

Contributing

Code guidelines

This project follows the standards defined in:

sliver's People

Contributors

samwalshnz avatar stevie-mayhew avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

helpfulrobot

sliver's Issues

different results from CLI and browser

I'm getting different results from CLI and browser for a command, I don't know why. It is a security feature of psysh or sliver? [edited] means a string was there that for security reasons has been edited out.

From CLI I run

$Mautic = new Mautic();
=> Mautic {#197
     +class: null,
     +"_contextapi": [],
   }
$Mautic->getSettings();
=> [
     "baseUrl" => "[edited]",
     "version" => "BasicAuth",
     "clientKey" => "[edited]",
     "clientSecret" => "[edited]",
     "callback" => false,
     "access_token" => "[edited]",
     "expires" => "[edited]",
     "token_type" => "[edited]",
     "refresh_token" => "[edited]",
     "userName" => null,
     "password" => null,
   ]

From browser the same code

$Mautic = new Mautic();
$s=$Mautic->getSettings();
var_dump($s);
die();

returns

array(11) {
  ["baseUrl"]=>
  string(29) "[edited]"
  ["version"]=>
  string(9) "[edited]"
  ["clientKey"]=>
  string(52) "[edited]"
  ["clientSecret"]=>
  string(50) "[edited]"
  ["callback"]=>
  string(41) "[edited]"
  ["access_token"]=>
  string(86) "[edited]"
  ["expires"]=>
  string(10) "[edited]"
  ["token_type"]=>
  string(6) "[edited]"
  ["refresh_token"]=>
  string(86) "[edited]"
  ["userName"]=>
  string(9) "[edited]"
  ["password"]=>
  string(10) "[edited]"
}

note that callback, userName and password bear different values. I went crazy tried to find the bug in the code, found out that it was a bug in the CLI. The settings you see are simply values recorded in the SilverStripe 3.6.5 SiteConfig. I wonder if there's a problem with the sliver bootstrap.

Sliver fails to start if environment is the only source of DB name

My team has some projects where mysite is shared across multiple sites as a composer module. The global $database variable is the empty string and the DB name is entirely defined by SS_DATABASE_PREFIX & SS_DATABASE_SUFFIX via ConfigureFromEnv. Under such conditions, sliver fails to initialise with the message "Please configure your database connection details."

update psych dependancy from v0.7.2 to v0.9.6

  • Problem: sliver cannot be installed
  • Procedure: composer global require littlegiant/sliver
  • Expected result: installation complete
  • Obtained result: Error message
  • Environment: Mac OSX High Sierra, PHP v7.1.17 via HomeBrew
  • Suggested operation: Update composer.json dependancies for psy/psysh to ^0.9.6
  • Log:
composer global require littlegiant/sliver
Changed current directory to ~/.composer
Using version ^0.1.0 for littlegiant/sliver
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: psy/psysh[v0.7.2, v0.9.6].
    - Can only install one of: psy/psysh[v0.9.6, v0.7.2].
    - Can only install one of: psy/psysh[v0.7.2, v0.9.6].
    - littlegiant/sliver 0.1.0 requires psy/psysh ^0.7.2 -> satisfiable by psy/psysh[v0.7.2].
    - Installation request for littlegiant/sliver ^0.1.0 -> satisfiable by littlegiant/sliver[0.1.0].
    - Installation request for psy/psysh (locked at v0.9.6, required as @stable) -> satisfiable by psy/psysh[v0.9.6].


Installation failed, reverting ./composer.json to its original content.

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.