supervisorphp / configuration Goto Github PK
View Code? Open in Web Editor NEWManage Supervisor configuration from PHP
Home Page: http://supervisorphp.com
License: MIT License
Manage Supervisor configuration from PHP
Home Page: http://supervisorphp.com
License: MIT License
The ini file loader IniFileLoader, failes to parse the following file.
[program:FOOBAR2]
command = /vagrant/app/console rabbitmq:dynamic-consumer something customer#FOOBAR2 --env=prod
numprocs = 1
autostart = 0
autorestart = 0
Used code:
$filesystem = new Filesystem(new Adapter\Local(dirname($this->confFile)));
$loader = new IniFileLoader($filesystem, basename($this->confFile));
$configuration = $loader->load(); // throws: The option "autostart" with value 0 is expected to be of type "bool", but is of type "integer".
$this->confFile is the path to the file.
Am I wrong or the ini file parser cannot handle the program sections?
I updated my composer dependencies, and am since getting this error:
The option "logfile_maxbytes" with value "50MB" is expected to be of type "byte", but is of type "string"
,
in /vendor/symfony/options-resolver/OptionsResolver.php:1030
. My symfony/options-resolver
version is v5.2.1.
Removing logfile_maxbytes
from my supervisord.conf obviously solves this problem for now.
It seems that since symfony/options-resolver@cba9d94, the logfile_maxbytes
option can no longer be parsed because is_<type>
, or in this case is_byte
, is not called anymore.
When I attempt to write an empty config to a file (say, I removed the last remaining section) using Supervisor\Configuration\Writer\File
it will throw a [Supervisor\Exception\WrittingFailed] Cannot write configuration into file /path/to/file.conf
exception.
Storing an empty string to a file $this->writeFile($fileContents))
will return 0, this in turen gets evaluates as false, and an exception will be thrown:
if (!$result = $this->writeFile($fileContents)) {
throw new WrittingFailed(sprintf('Cannot write configuration into file %s', $this->file));
}
Even though the write operation was successful.
Non boolean value go evaluated to false, a check for boolean false fixes this issue:
if (false === $result = $this->writeFile($fileContents)) {
throw new WrittingFailed(sprintf('Cannot write configuration into file %s', $this->file));
}
More details: http://php.net/manual/en/function.file-put-contents.php
I cannot understand the practical usage.
I can write a .conf, ok. I can read a .conf ok.
But, how to restart suspervisor itself or ask to reread or reload?
And... can we use this as normal user?
https://packagist.org/packages/supervisorphp/configuration
v0.1.02015-01-13 23:00 UTC
Requires
php: >=5.4.0
symfony/options-resolver: ~2.6.0
We are currently locked to Symfony 2.6.* because of the requirement.
Need to be able to upgrade to Symfony 2.7.* as this is the LTS version. 2.6.* will reach end of maintentance in 07/2015 and end of life in 01/2016.
See http://symfony.com/doc/current/contributing/community/releases.html
Could you give me some suggestion about how to handle configuration file permissions?
actually my specific conf file on the server is owned by root:root and has 644 permission
so obviously my php script cannot write it because it's launched from a normal shell user.
What could we do?
When converting a a string to integer, the octal value is converted to decimal
Affected sections: Supervisord, Program, FcgiProgram
Hi,
please can you update dependencies of this package?
It is hard to use these days and I don't see any replacement for this package.
Thank you.
https://github.com/supervisorphp/configuration/blob/master/src/Writer/HasIniRenderer.php#LN25
new Renderer(Renderer::ARRAY_MODE_CONCAT , Renderer::BOOLEAN_MODE_BOOL_STRING)
should be
new Renderer(Renderer::ARRAY_MODE_CONCAT | Renderer::BOOLEAN_MODE_BOOL_STRING)
Otherwise the second option will be ignored.
Cheers,
Tibor
Under the SupervisorPHP namespace, most of the configuration package could be split to a generic INI package.
The readme says that the File parser is still available, but the source says it has been removed in v0.2.0.
What is the 'official' status?
Maybe there is a small example as well that can be used to update the readme.
Cheers (Üdv),
Tibor
Should be use Indigo\Ini\Renderer;
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.