GithubHelp home page GithubHelp logo

sebicas / kohana-cli-reloaded Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 2.0 101 KB

Kohana CLI Reloaded extends default Kohana CLI functionalities with the static methods run(), read(), write(), password(), wait(), color(), error(), beep(), new_line(), clear_screen() & check() mostly adapted from FuelPHP & Minion CLI Framework

PHP 100.00%

kohana-cli-reloaded's Introduction

Kohana CLI Reloaded

Kohana CLI Reloaded Module provides extended Command Line functionalities to the default Kohana CLI Class.

The following the static methods are included:

CLI::run()
CLI::read()
CLI::write()
CLI::password()
CLI::wait()
CLI::color()
CLI::error()
CLI::beep()
CLI::new_line()
CLI::clear_screen()
CLI::check()

Most of the code has been extracted and adapted from:

How to use this module

To use the Kohana CLI Reloaded Model, just:

  1. Download and extract the code from Github.
  2. Configure Paths in ./kohana file
  3. Give executing permissions to ./kohana file ( chmod +x ./kohana )
  4. Place the module into your Kohana instances modules folder.
  5. Enable the module within the application bootstrap within the section entitled modules.

Optionally: You could add your ./kohana file to your PATH adding it to your .bashrc

# Add Kohana CLI Reloaded
export PATH=/home/redremax/modules/kohana-cli-reloaded/:$PATH

Configure Paths:

// Define Application & System Paths
define('INDEX', '/home/myuser/kohana/index.php'); // Use Full Path if Possible
define('PHP_BIN', '/usr/bin/php');

Define your paths to your index.php file and executable php.

Then go to application/bootstrap.php, look for Kohana::modules() and add:

'kohana-cli-reloaded' => MODPATH.'kohana-cli-reloaded', // Kohana CLI Reloaded

Example:

Kohana::modules(array(
    // 'auth'       => MODPATH.'auth',       // Basic authentication
    // 'cache'      => MODPATH.'cache',      // Caching with multiple backends
    // 'codebench'  => MODPATH.'codebench',  // Benchmarking tool
    // 'database'   => MODPATH.'database',   // Database access
    // 'image'      => MODPATH.'image',      // Image manipulation
    // 'orm'        => MODPATH.'orm',        // Object Relationship Mapping
    // 'unittest'   => MODPATH.'unittest',   // Unit testing
    // 'userguide'  => MODPATH.'userguide',  // User guide and API documentation
    'kohana-cli-reloaded' => MODPATH.'kohana-cli-reloaded', // Kohana CLI Reloaded
));

See it working

To see a Demo of the Module working go to the Module directory and type:

./kohana cli_demo

Important: Make sure ./kohana file has executing permissions ( chmod +x ./kohana )

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_markup)
  3. Commit your changes (git commit -am "Added Snarkdown")
  4. Push to the branch (git push origin my_markup)
  5. Create an [Issue][1] with a link to your branch
  6. Enjoy a refreshing orange juice and wait

Colaborators

Thanks to the following colaborators:

kohana-cli-reloaded's People

Contributors

sebicas avatar

Stargazers

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

Watchers

 avatar  avatar

kohana-cli-reloaded's Issues

reloaded.php clean screen ?

Hello,

I saw the following code in reloaded.php:

         fwrite(STDOUT, chr(27)."[H".chr(27)."[2J")

and just wondering what does these magic characters do?

Thank you

Latest Commit: Cli::check()

I think it was OK before: throw an exception, so anyone can do whatever they want to do with the error. What If I don't want people on the Web to even see that there is a Kohana installation? Or less to see that I have a CLI action.

I know I can still check manually Kohana::$is_cli, but for being a generic tool, It should throw an exception IMO.

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.