cilex / cilex Goto Github PK
View Code? Open in Web Editor NEWCilex a lightweight framework for creating PHP CLI scripts inspired by Silex
Home Page: http://cilex.github.io
License: MIT License
Cilex a lightweight framework for creating PHP CLI scripts inspired by Silex
Home Page: http://cilex.github.io
License: MIT License
To improve the creation of the phar file we should replace our custom compiler with that of box-project. This will reduce the maintenance necessary and eliminate possible bugs thanks to a tried system
Is Cilex ready for a 1.0 release? What's holding it up.
Hello,
In order to add functional tests I was thinking to change the output and check the output stream (as I do on sf2),
In the Symfony\Component\Console\Application
the run
function has public function run(InputInterface $input = null, OutputInterface $output = null)
but the approach is different in Cilex, and I'm not able to change Input and output.
How do you suggest me to do it?
Hi,
Is there a way to call one command from another or to create a batch of commands?
Want to use Pimple 2.* in my application but composer seeing conflict with Cilex and doesn't let me. This is also providing the use of PhpDocumentor since it uses Cilex as well. Have NOT looked to see what all changes were make on Pimple but always prefer using most up to date versions when possible. After a quick look it looks like the main change is that instances are shared by default like share() would do and you use factory() to get something like the old behavior if my reading of the code is right. Not sure how this effects Cilex.
Fresh install:
1008 git clone https://github.com/Cilex/Cilex.git
1009 cd Cilex
1010 composer update
1011 composer install
1012 php bin/compile
1013 php cilex.phar
PHP Warning: require(phar:///private/tmp/Cilex/cilex.phar/vendor/composer/include_paths.php): failed to open stream: phar error: "vendor/composer/include_paths.php" is not a file in phar "/private/tmp/Cilex/cilex.phar" in phar:///private/tmp/Cilex/cilex.phar/vendor/composer/autoload_real.php on line 29
Warning: require(phar:///private/tmp/Cilex/cilex.phar/vendor/composer/include_paths.php): failed to open stream: phar error: "vendor/composer/include_paths.php" is not a file in phar "/private/tmp/Cilex/cilex.phar" in phar:///private/tmp/Cilex/cilex.phar/vendor/composer/autoload_real.php on line 29
PHP Fatal error: require(): Failed opening required 'phar:///private/tmp/Cilex/cilex.phar/vendor/composer/include_paths.php' (include_path='.:') in phar:///private/tmp/Cilex/cilex.phar/vendor/composer/autoload_real.php on line 29
Fatal error: require(): Failed opening required 'phar:///private/tmp/Cilex/cilex.phar/vendor/composer/include_paths.php' (include_path='.:') in phar:///private/tmp/Cilex/cilex.phar/vendor/composer/autoload_real.php on line 29
The ConsoleServiceProvider of Cilex can be updated to use the new ServiceProviderInterface of Pimple so that ServiceProviders are interchangeable between Cilex and Silex
Cilex is currently bound to pimple ~1.0. When included in a complex composer.json dependency tree, cilex bounds pimple to the older version. This is causing problems with a variety of other packages, such as elasticsearch.
Could be great use cilex in order to create phar project with cilex as dependency.
As it is, is not so easy do it.
When I try to compile:
cilex/bin$ php ./compile
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'The git binary cannot be found.' in /media/disk2/darek/yii/cilex/src/Cilex/Compiler.php:43
Stack trace:
#0 /media/disk2/darek/yii/cilex/bin/compile(13): Cilex\Compiler->compile()
#1 {main}
thrown in /media/disk2/darek/yii/cilex/src/Cilex/Compiler.php on line 43
Fatal error: Uncaught exception 'RuntimeException' with message 'The git binary cannot be found.' in /media/disk2/darek/yii/cilex/src/Cilex/Compiler.php on line 43
RuntimeException: The git binary cannot be found. in /media/disk2/darek/yii/cilex/src/Cilex/Compiler.php on line 43
but git is of course available on system
cilex/bin$ whereis git
git: /usr/bin/git /usr/bin/X11/git /usr/share/man/man1/git.1.gz
cilex/bin$ git
usage: git [--version] [--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[-c name=value] [--help]
[]
The Yaml->parse method accepts only yaml strings, but you only pass the filename into that. File_get_contents() is necessary.
The error:
Warning: array_key_exists() expects parameter 2 to be array, null given in /vendor/pimple/pimple/lib/Pimple.php on line 95
Call Stack:
0.0007 627856 1. {main}() /some/path:0
0.0032 795288 2. Cilex\Application->__construct() /some/path:6
0.0037 804696 3. Cilex\Application->register() /vendor/cilex/cilex/src/Cilex/Application.php:43
0.0037 804696 4. Cilex\Provider\Console\ConsoleServiceProvider->register() /vendor/cilex/cilex/src/Cilex/Application.php:99
0.0041 820256 5. Cilex\Provider\Console\BaseConsoleServiceProvider->register() /vendor/cilex/console-service-provider/src/Cilex/Provider/Console/ConsoleServiceProvider.php:30
0.0041 820968 6. Pimple->offsetExists() /vendor/cilex/console-service-provider/src/Cilex/Provider/Console/ConsoleServiceProvider.php:27
0.0041 821016 7. array_key_exists() /vendor/pimple/pimple/lib/Pimple.php:95
The code:
#!/usr/bin/env php
<?php
require_once(__DIR__.'/../vendor/autoload.php');
$app = new \Cilex\Application('Chat');
$app->command(new \Cilex\Command\GreetCommand());
$app->run();
The usage:
/path/to/file demo:greet Mark
The fix:
Looks like Pimple isn't getting initialized correctly. So, parent::__construct();
should be called first thing in Cilex\Application::__construct()
This is similar to how Silex works when it extends Pimple.
... but Cilex does not have that handler because it uses a different mechanism.
Not enough time left to fix but wanted to record this to be fixed
Is this package still being maintained ? Or do the developers suggest to use something else ?
E.g. would it help to aid in development, testing, updating dependancies etc ?
The current download link for box is broken please update it with the correct link:
curl -LSs https://box-project.github.io/box2/installer.php | php
The link to the phar returns a 404
.
The register function of Cilex\Application supposedly allows you to register a Silex ServiceProvider (\vendor\cilex\cilex\src\Cilex\Application.php:97-99), but when actually trying to register the Silex ServiceProvider, you hit:
Catchable fatal error: Argument 1 passed to Igorw\Silex\ConfigServiceProvider::register() must be an instance of Silex\Application, instance of Cilex\Application given
If it is to be compatible with Silex service providers, the Interface definition typehint must be dropped or if it is not compatible, lines \vendor\cilex\cilex\src\Cilex\Application.php:97-103 should be removed.
This seems related to #3.
I have the latest stable version of pimple 1.1.1 as a dependency in one of my packages.
I'm getting the following error when running composer update
after adding "cilex/cilex": "1.0.*@dev"
to the list of required dependencies:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install cilex/cilex 1.0.1
- Conclusion: don't install pimple/pimple v1.0.2
- Conclusion: remove pimple/pimple v1.1.1
- Installation request for cilex/cilex ~1.0 -> satisfiable by cilex/cilex[1.0.0, 1.0.1].
- vendor/my-project v1.1.1 requires pimple/pimple 1.1.* -> satisfiable by pimple/pimple[v1.1.1, v1.1.0].
- vendor/my-project v1.0.1 requires pimple/pimple 1.1.* -> satisfiable by pimple/pimple[v1.1.1, v1.1.0].
- vendor/my-project v1.1.0 requires pimple/pimple 1.1.* -> satisfiable by pimple/pimple[v1.1.1, v1.1.0].
- vendor/my-project v1.1.0 requires pimple/pimple 1.1.* -> satisfiable by pimple/pimple[v1.1.1, v1.1.0].
- Can only install one of: pimple/pimple[v1.1.0, 1.0.0].
- Can only install one of: pimple/pimple[v1.1.1, 1.0.0].
- cilex/cilex 1.0.0 requires pimple/pimple 1.0.* -> satisfiable by pimple/pimple[1.0.0, v1.0.1, v1.0.2].
- Conclusion: don't install pimple/pimple v1.0.1
- Installation request for vendor/my-project ~1.0,>=1.0.1 -> satisfiable by vendor/my-project[v1.1.0, v1.1.1, v1.0.1].
so one of my visions was that Cilex and Silex could share extensions. right now @mvriel introduced a new ServiceProviderInterface
interface inside the Cilex namespace. i talked briefly with him on IRC today where @mvriel said he wants to switch the Silex one, which obviously would imply a dependency on Silex, which imho is fine, but i don't know how specifically he wants it to play out given the Application
type hint.
but it does raise the question of if we are not making things needlessly complex by not doing this all inside Silex. then again doing it all inside Silex would go against the entire "micro" idea. so maybe we do need to ask the Silex guys to make things a bit easier for us ..
;-)
I created this library for generating loads of commands dynamically from config files https://github.com/enxebre/CliGenerator. might be interesting interesting add an "addCommands" function for the applications class.
As a developer, frequent tooling is required for automation of simple tasks, so I want to be more effective in writing those and spend less lines on getting thing done::
$app = require 'cilex.phar';
$app->simpleCommand('greet', function($name) {
return "Hello, $name!\n";
})->run();
Problem 1
- silex/api 2.0.x-dev requires pimple/pimple ~2.1 -> satisfiable by pimple/pimple[v2.1.0, v2.1.1].
- Can only install one of: pimple/pimple[v3.0.0, v2.1.0].
- Can only install one of: pimple/pimple[v3.0.0, v2.1.1].
- cilex/cilex dev-develop requires pimple/pimple 3.0.0 as 2.1.0 -> satisfiable by pimple/pimple[v3.0.0].
- cilex/cilex dev-develop requires silex/api 2.0.x-dev -> satisfiable by silex/api[2.0.x-dev].
- Installation request for cilex/cilex dev-develop -> satisfiable by cilex/cilex[dev-develop].
It should be "Clilex".
I need new label for delete this error
Deprecated: The TableHelper class was deprecated in version 2.5 and will be removed in 3.0. Use Symfony\Component\Console\Helper\Table instead. in/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php on line 38
In order to always provide up to date documentation we should consider using readthedocs.org to auto compile our sphinx documentation.
as a follow up to #33 should Silex be checked how they solve this, if they do and implement this in Cilex.
I have something like this ... is this ok? Seems redundant because the command object is inside of the Application.
$app->register(new ConfigServiceProvider(), array('config.path' => __DIR__."/config.yml"));
$log->debug('Registered config service provider');
$app->command(new Command($app));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.