cyjoelchen / php-sweph Goto Github PK
View Code? Open in Web Editor NEWPHP Extension for Swiss Ephemeris
License: Other
PHP Extension for Swiss Ephemeris
License: Other
With the patch for sweodef.h I can build with cygwin (x86) on a 32-bit Windows7.
It does not build a dll, but a statically linked file ./modules/swephp.a
Output of 'make test' is
*** Warning: linker path does not have real file for library -lswe.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libswe but no candidates were found. (...for file magic test)
*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module swephp. Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.
libtool: link: ar cru .libs/swephp.a .libs/swephp.o
libtool: link: ranlib .libs/swephp.a
libtool: link: ( cd ".libs" && rm -f "swephp.la" && ln -s "../swephp.la" "swephp.la" )
/bin/sh /home/alois/php-sweph/libtool --mode=install cp ./swephp.la /home/alois/php-sweph/modules
libtool: install: cp ./.libs/swephp.lai /home/alois/php-sweph/modules/swephp.la
libtool: install: cp ./.libs/swephp.a /home/alois/php-sweph/modules/swephp.a
libtool: install: chmod 644 /home/alois/php-sweph/modules/swephp.a
libtool: install: ranlib /home/alois/php-sweph/modules/swephp.a
The tests all get skipped, because (!extension_loaded('swephp') fails.
I do not know whether and how a static library swephp.a can be loaded, or how a dynamic library swephp.dll could be built.
I tried your wonderful extension and found that usage of SE_BIT_HINDU_RISING and SE_BIT_GEOCTR_NO_ECL_LAT is not possible. Either the first or second are necessary to calculate all sunrise methods. (7.12.1. Sunrise in Astronomy and in Hindu Astrology)
Cheers
Werner
Receiving Fatal error: Directive 'track_errors' is no longer available in PHP in Unknown on line 0
when running tests on PHP 7.0. Additionally, many tests are failing.
The GH workflow is providing a false positive because make test
always returns status 0
, regardless of individual test results.
make test TESTS=-q
).REPORT_EXIT_STATUS=1
).Refs:
Tests are passing correctly on other versions of PHP.
Hi Joel, I'm hoping you can offer some guidance on this issue I discovered.
I have found that the swe_nod_aps()
and swe_nod_aps_ut()
methods are not properly parsing the first parameter (tjd_et
and tjd_ut
respectively).
These time values are not being treated as doubles but are somehow getting "truncated" to a lower integer value. Specifically, a tjd_ut
input value of 2458625.2916628
is transforming into 2458624.000000
(examples below).
Note that I've added 6 fprintf()
debug statements to my branch. For testing purposes, you may want to check out my branch or add these statements into your local copy:
I added these so I could look at the input parameters before and after the zend_parse_parameters()
function call. Here are the results:
swe_nod_aps_ut()
doesn't work, but why?php > print_r(swe_nod_aps_ut(2458625.2916628, 2, 258, 1));
swe_nod_aps_ut: tj=0.000000, ipl=0, iflag=2447376448, mthod=32563
swe_nod_aps_ut: tj=2458624.000000, ipl=2, iflag=258, mthod=1
Array
(
[retflag] => 0
[xnasc] => Array
(
[0] => 56.680931574465
[1] => 3.0145592131883E-5
[2] => 1.3220195603371
[3] => 0.73612419649685
[4] => -3.2429090376862E-5
[5] => -0.00054243469771424
)
[xndsc] => Array
(
[0] => 67.564235606566
[1] => 6.9195727311078E-5
[2] => 0.57389584851169
[3] => 1.675423329765
[4] => -6.6127512121871E-5
[5] => 0.002672750087396
)
[xnperi] => Array
(
[0] => 63.443414304512
[1] => 0.80212500326375
[2] => 1.3068768959424
[3] => 0.73070414588612
[4] => 0.80076160231545
[5] => 0.00066077827187061
)
[xnaphe] => Array
(
[0] => 44.750484768039
[1] => -2.7020123645768
[2] => 0.58896673969793
[3] => 1.694600935081
[4] => -2.7071279397373
[5] => -0.0013432826167913
)
)
swe_deltat()
works, but why?php > print_r(swe_deltat(2458625.2916628));
swe_deltat: tj=0.000000
swe_deltat: tj=2458625.291663
0.00080465229758673
Lastly, if you run swetest
to query the same data, you can see how the values differ (swetest
is correct, FYI):
swetest -bj2458625.2916628 -pe2 -fPfn -ut
date (dmy) 21.5.2019 greg. 18:59:59.666 UT version 2.07.01
UT: 2458625.291662800 delta t: 69.521959 sec
TT: 2458625.292467453
Epsilon (true) 23°26' 8.8486
Nutation -0° 0'17.2589 -0° 0' 3.4782
name peri apo nodAsc nodDesc
Mercury 64.4017370 46.8392201 57.3279454 57.6318570 69.7186353
Mismatch between parameter description (tjd_et) and parameters (tjd_ut) in function call
function swe_calc(tjd_ut, ipl, iflag)
Parameters
double tjd_et Julian day in Ephemeris Time.
start pod and test for swe_sol_eclipse
It throws a lot of errors during make cmd because of stray instances of TSRMLS_CC macro. This macro was defined empty in PhP 7.x and removed in PhP 8.x
Cheers
Werner
I am using this solution successfully within the functionality demonstrated in the code samples. However, whenever I am trying to use a different function, e.g. swe_rise_trans
or swe_revjul
, I am unable to figure out the signature. Whatever I try, I get a 'Wrong parameter count' error message. Could you please provide some information or sample code regarding the use of different other functions? Swiss Ephemeris documentation doesn't seem to be helpful as PHP function signatures are substantially different.
Describe the bug
The PHP 8.1 depcrecation warnings of Passing null to non-nullable internal function parameter
is breaking the two tests swe_get_library_path
and swe_set_ephe_path
. The reason for this is that the deprecation warnings are treated as strings when calling the functions and thus are part of the test assertions.
To Reproduce
Steps to reproduce the behavior:
make test
Expected behavior
Passing tests and not treating PHP deprecation warnings as part of input/output in assertions.
Environment:
hello,
first, thank you for this php translation of sweph.c !
I would like to test the swephp library but I havent been able to use it because I cant find swephp.so and link it to my php server via the php.ini file.
Do I need to compile through gcc? I am running the example.php on windows 10 via a xampp local stack.
Kind regards
I have used a few simple functions print_date, print_array, print_array_t in some of the test scripts,
swe_azalt_refrac.phpt
swe_cotrans.phpt
swe_cotrans_sp.phpt
swe_lun_eclipse.phpt
swe_lun_occult.phpt
swe_nod_aps.phpt
swe_pheno.phpt
swe_rise_trans_etc.phpt
swe_sol_eclipse.phpt
These functions could be moved to utility/Format.php
This should be done by someone who is fitter in php than I am.
Alois:
In C function swe_cotrans we allow for a 3-dimensional position vector which includes distance. That is fir the prigrammer's convenience. Distance is never changed in a rotational coordination transfirmation.
in the php implementation there are no vectors, but separate parameters lng, lat, dist in input and return.
I suggest to drop dist from the parameter list, and from the return array.
Don't forget to update the inline documentation.
/home/user/php-sweph/sweph.c: In function ‘zif_swe_jdut1_to_utc’:
/home/user/php-sweph/sweph.c:1559:5: error: ‘tjd_et’ undeclared (first use in this function); did you mean ‘tjd_ut’?
&tjd_et, &gregflag) == FAILURE) {
^~~~~~
tjd_ut
/home/ubu/php-sweph/sweph.c:1559:5: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:191: sweph.lo] Error 1
Describe the bug
When using the jpl de431.eph some values are not set.
I am using the example in Readme.md
Use SEFLG_JPLEPH || SEFLG_SPEED;
In the return array of planetary data the dimensions 3, 4, 5 are not valued;
To Reproduce
Steps to reproduce the behavior:
Expected behavior
With SEFLG_SPEED:
"julday": 2459520.2083333335,
"0": {
"0": 219.48769346485267,
"1": 6.167648920321542e-5,
"2": 0.9924469626090567,
"3": 1.0008847453654508,
"4": -1.9935282494445833e-5,
"5": -0.0002532148272806739,
"serr": "",
"rc": 258
},
"1": {
"0": 176.38730256037078,
"1": 4.781276302406268,
"2": 0.0024963818084878624,
"3": 13.964784159645811,
"4": -0.528824526366118,
"5": -3.9819746948354696e-5,
"serr": "",
"rc": 258
},
"2": {
"0": 203.44184090562658,
"1": 2.0442185461269946,
"2": 1.1682872169599843,
"3": 1.4979756689684907,
"4": -0.04530736989453414,
"5": 0.021981241196193605,
"serr": "",
"rc": 258
},
.................
With JPL DE431.eph (SEFLG_JPLEPH || SEFLG_SPEED)
"julday": 2459520.2083333335,
"0": {
"0": 219.4876933828836,
"1": 6.165079464200357e-5,
"2": 0.9924469597778867,
"3": 0,
"4": 0,
"5": 0,
"serr": "",
"rc": 1
},
"1": {
"0": 176.38730252640642,
"1": 4.781276296811643,
"2": 0.0024963818121133997,
"3": 0,
"4": 0,
"5": 0,
"serr": "",
"rc": 1
},
"2": {
"0": 203.4418408023076,
"1": 2.044218528194945,
"2": 1.1682872149149703,
"3": 0,
"4": 0,
"5": 0,
"serr": "",
"rc": 1
},
.................
Thanks a lot,
Blu
I fixed swe_rise_trans() so that it handles fixed star case correctly and returns the amended starname in the return hash
I fixed a bug in swe_deltat_ex, the return variable is dt and not tjd_et.
This function was only added on 16 July 21, it is unlikely that it is used in production anywhere.
This justifies immediate release to the master branch, even when it potentially breaks API usage.
I also fixed to related test cases.
While swe_deltat and swe_deltat_ex retung deltat in units of days, the tests should reflect the fact that deltat is usually give in units of time seconds.
This file showed up in master
but I don't understand its purpose:
Kevin, is it possible for you to create and register a stub file for swephp, so that the functions of swephp are recognized by phpstorm? See phpstorm-stubs on github.
Please, help me to use Swiss Ephemeries in PHP
Two functions throwing errors during make test on MacOS BigSur & PHP8
2 functions are showing FAIL executing make test. These are:
FAIL Basic test [tests/swe_azalt_refrac.phpt]
FAIL Basic test [tests/swe_fixstar.phpt]
all other functions are showing PASS, executing make test
I will open a PR after I document and test swe_deltat()
and then push commits to it as I/we go along.
Looking at the test files for functions swe_get_ayanamsa_ex
and swe_get_ayanamsa_ex_ut
, we can see that the returned flags (rc
value) is 66, meaning: SEFLG_SWIEPH | SEFLG_NONUT
,
however SEFLG_NONUT
was not given in iflag
.
Passing SEFLG_SWIEPH | SEFLG_NONUT
yields a different daya value, and correctly returns 66 as rc
value.
(Same goes in Python.)
Is it correct to assume that rc
value indicates what kind of computation was done, or not ?
I fixed 4 bugs in swe_fixstar
declaration int star_len must be size_t star_len.
Program can crash randomly if this is not corrected.
In branch documentation, ./sweph/doc
I am experimenting with .md files created via pandoc -f docx -t markdown from the original Swisseph docx files.
The results need manual work, for tabular data elements
It is an experiment, into which I can only invest minimal time.
I want to find out whether we should move from Word to markdown as fundamental maintenance firmat.
Now that we're using tagged releases, the general public should be aware not to use master
in their production environments as it could contain bugs or other untested features.
Also add a note regarding the "gitflow" development process.
as astorigin pointed out, there is a string overflow situation in swephp.c swe_fixstar* functions.
His proposed solution has its own problems.
It copies data which do not exist and can lead to memory access errors.
The SE functions allow for star names up to 40 characters, plus a null terminator.
The constant SE_MAX_STNAME = 256 as defined in swephexp.h is far to large and misleading.
There exists an internal constant SWI_STAR_LENGTH = 40 which should be used.
I will create a branch issues/69 with a fix.
Running the command line samples in perl-sweph (see Swiss Ephemeris mailing list) I noticed that perl-sweph::swe_revjul() also separates the double dhou into
ihou
imin
isec
dsec
that comes handy, as the caller will often want to get minutes and seconds.
Could be added in php-sweph::swe_revjul as well.
perl swe_revjul() and swe_julday() also tolerate missing parameter gregflag, and default to Gregorian.
php-sweph might do that as well, in swe_julday and swe_revjul.
I think branch se2.10.02 is complete, also with simple tests or the new swe_solcross function group.
I have compiled library swephp.so with debug on, and need to run a test script in gdb debugger.
How can I do this?
I have a problem with function swe_lun_occult_when_glob
In gdb debugger, it lookks as if
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dldddl",
&tjd_ut, &ifl, &geopos[0], &geopos[1], &geopos[2], &backward, &arg_len) == FAILURE) {
return;
}
delivers an integer value tjd_start=2454466 when my program calls
swe_lun_eclipse_when(2454466.5, SEFLG_SWIEPH, 0, 0);
I fail to understand why the test for swe_lat_to_lmt
does not result in tjd_lmt = 2452275.5000
like in C and Python.
(Its counterpart swe_lmt_to_lat
seems ok...)
#include <stdlib.h>
#include "swephexp.h"
int main(void)
{
double tjd_lat = 2452275.4978254;
double tjd_lmt;
int i;
char serr[256];
double geolon = 121.34;
swe_set_ephe_path(NULL);
i = swe_lat_to_lmt(tjd_lat, geolon, &tjd_lmt, serr);
if (i != 0)
exit(1);
printf("tjd_lmt = %f\n", tjd_lmt);
return 0;
}
Now that we have inline documentation which is used to generate the /doc/doc.html
file, it would be nice if this file was available for viewing publicly in the browser.
We should setup a Github pages site that loads this file as its homepage. The file will probably need to be renamed to index.html
.
swe_rise_trans() return value is always that of sun, regardless which parameter you use as planet number.
Are there any hints with example on how to get moon rise value returned?
sudo make install - installs swephp.so into folder /usr/lib/php/20190902/ instead of folder /usr/lib/php/20200930/
ubu@ubu:~$ php -m
PHP Warning: PHP Startup: Unable to load dynamic library 'swephp' (tried: /usr/lib/php/20200930/swephp (/usr/lib/php/20200930/swephp: cannot open shared object file: No such file or directory), /usr/lib/php/20200930/swephp.so (/usr/lib/php/20200930/swephp.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: swephp: Unable to initialize module
Module compiled with module API=20190902
PHP compiled with module API=20200930
These options need to match
Work on php-sweph inspired me to look deeper into the existing SwissEph perl module.
I have taken over the concept of compiling SE library directly into the perl module, instead of relying on the installed
libswe.so (or DLL). This has pro- and contras.
Something else cam to my attention:
functions like
swe_lun_occult_when_loc($tjd_ut, $ipl, $star, $iflag, $ifltype, $backw, $geopos);
have more eplicit return hashes in perl.
Instead of arrays with numbered indices like in C, the perl function in addition to the arrays tret and attr also
named hash fields with the data unpacked in a meaningful way:
-> ecl_maximum time of maximum occultation (UT)
-> t1st_contact
-> t2nd_contact
-> t3rd_contact
-> t4th_contact
-> disc_ratio size ratio of the two discs
-> fraction_diameter percentage of diameter occulted
-> fraction_disc percentage of disc occulted
-> core_shadow_km diameter of core shadow (km, negative
with total, positive with annular ecl.)
-> body_azimuth
-> body_alt_true
-> separation_angle
This might also be done for php-sweph.
It will not break the existing API, because extra named array fields will not hurt.
The same field names as in Perl should be used.
Thank you for granting me collaborator access, Joel. Before I start merging any changes, I would like to discuss a few things.
The important consideration is that the author of the PR merges the work, but only once it's been approved.
At the moment, the README contains a version and revision number (currently @2.0, rev 28).
Looking forward to your feedback.
at the end of make test I always get this meaningless email question
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to [email protected] later.
Do you want to send this report now? [Yns]: n
how can I suppress it?
Refs:
https://github.com/cyjoelchen/php-sweph/blob/master/sweph.c#L1820
Docs:
https://www.astro.com/swisseph/swephprg.htm#_Toc505244849
According to the official docs, the swe_nod_aps_ut()
method only accepts 4 parameters. The PHP function, however, enforces 10 (see L1829).
To reproduce, call the method in the following 2 ways and notice the difference in output:
> swe_nod_aps_ut(2444342.6375, 2, SEFLG_SWIEPH, SE_NODBIT_MEAN)
Warning: Wrong parameter count for swe_nod_aps_ut() in php shell code on line 1
> swe_nod_aps_ut(2444342.6375, 2, SEFLG_SWIEPH, SE_NODBIT_MEAN, 1, 1, 1, 1, 1, 1)
Warning: swe_nod_aps_ut() expects exactly 4 parameters, 10 given in php shell code on line 1
I'm happy to make the change myself, but am not 100% sure how to do so. Other than changing L1829, what else is there to do?
These two constants, which are used for jyotish calculations are still missing in sweph.c. It would be nice to have it in per default.
// ## Please Add these lines to the /* for swe_rise_transit() */ section into sweph.c
REGISTER_LONG_CONSTANT("SE_BIT_GEOCTR_NO_ECL_LAT", SE_BIT_GEOCTR_NO_ECL_LAT , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_BIT_HINDU_RISING", SE_BIT_HINDU_RISING , CONST_CS | CONST_PERSISTENT);
On my mac, phpize is not working
$phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
/usr/local/bin/autoconf: /usr/local/bin/autom4te: /Applications/XAMPP/xamppfiles/bin/perl: bad interpreter: No such file or directory
/usr/local/bin/autoconf: line 505: /usr/local/bin/autom4te: Undefined error: 0
php -v
PHP 7.1.33 (cli) (built: Jan 6 2020 22:21:01) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
Instructions:
swephp.c
file.@aloistr wrote:
we should have test cases, so that we could run 'make test' in a meaningful way.
License information was missing from the top level of this repo.
I have edited to Readme file and added a pointer to the license conditions, which are defined in the LICENSE file in the source directory sweph/src.
I pushed this to the master branch.
It should be noted that the GPL license as part of the dual licensing model has been replaced by Affero GPL (AGPL) since release 2.10.01 of Swiss Ephemeris.
The GPL license did not impose conditions on users, as long as they did not distribute software containing code or data from Swiss Ephemeris. Use on the server side did not impose any obligation to make source code accessible to others.
This has changed with AGPL. Now use on server side is subject to the conditions of AGPL. Alternatively, a user can purchase Astrodienst's professional license, under the dual licensing system for Swiss Ephemeris.
Now that this extension has tests, we can configure Github to automatically run them for us after each commit. It's still the programmer's responsibility to run them locally, but it's even better to do it here to show proof that they all pass. Furthermore, we can eventually configure the repository to disallow merging a branch into master
if the tests don't pass.
It also allows us to configure multiple environments/architectures to test the extension in an automated fashion.
Refs:
Was this excluded for any particular reason? I'm happy to add it in if you're accepting PRs, but I admit I've never worked on PHP extensions before.
Why not just convert the doc.html to doc.md (markdown) then it would be easy to read on github.
I suggest we move the se*18.se1 and sefstars.txt into ./sweph/ephe and update all tests to include
swe_set_ephe_path('./sweph/ephe')
I also suggest to not use SEFLG_MOSEPH in any test, but use SEFLG_SWIEPH.
Where appropriate, the flag should also contain SEFLG_SPEED for all functions which have speed in the
result vector.
please add these constants to sweph.c, thank you in advance
/* for ayanamsa calculation relative to ecliptic of date new in 2.09*/
REGISTER_LONG_CONSTANT("SE_SIDBIT_ECL_DATE", SE_SIDBIT_ECL_T0, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_TRUE_PUSHYA", SE_SIDM_TRUE_PUSHYA , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALCENT_RGILBRAND", SE_SIDM_GALCENT_RGILBRAND , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALEQU_IAU1958", SE_SIDM_GALEQU_IAU1958 , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALEQU_TRUE", SE_SIDM_GALEQU_TRUE , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALEQU_MULA", SE_SIDM_GALEQU_MULA , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALALIGN_MARDYKS", SE_SIDM_GALALIGN_MARDYKS , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_TRUE_MULA", SE_SIDM_TRUE_MULA , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALCENT_MULA_WILHELM", SE_SIDM_GALCENT_MULA_WILHELM , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_ARYABHATA_522", SE_SIDM_ARYABHATA_522 , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_BABYL_BRITTON", SE_SIDM_BABYL_BRITTON , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_TRUE_SHEORAN", SE_SIDM_TRUE_SHEORAN , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALCENT_COCHRANE", SE_SIDM_GALCENT_COCHRANE , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_GALEQU_FIORENZA", SE_SIDM_GALEQU_FIORENZA , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_VALENS_MOON", SE_SIDM_VALENS_MOON , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_KRISHNAMURTI_VP291", SE_SIDM_KRISHNAMURTI_VP291, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_LAHIRI_1940", SE_SIDM_LAHIRI_1940, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_LAHIRI_VP285", SE_SIDM_LAHIRI_VP285, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_SIDM_LAHIRI_ICRC ", SE_SIDM_LAHIRI_ICRC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_BIT_GEOCTR_NO_ECL_LAT", SE_BIT_GEOCTR_NO_ECL_LAT , CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SE_BIT_HINDU_RISING", SE_BIT_HINDU_RISING , CONST_CS | CONST_PERSISTENT);
The implemented missing functions:
...are untested.
A test should compare C output and php output, for the same input parameters.
Hi,
please, how can I compile in Windows 10 and Visual Studio 2019 (or other compiler)?
I have installed php and php-devel but the instructions for php don't work in Windows.
Thanks a lot,
Blu
We've tried v2.0.29
We are getting the following error on installing with PHP 5.4
"/bin/sh /root/php-sweph/libtool --mode=compile cc -I. -I/root/php-sweph -DPHP_ATOM_INC -I/root/php-sweph/include -I/root/php-sweph/main -I/root/php-sweph -I/opt/cpanel/ea-php54/root/usr/include/php -I/opt/cpanel/ea-php54/root/usr/include/php/main -I/opt/cpanel/ea-php54/root/usr/include/php/TSRM -I/opt/cpanel/ea-php54/root/usr/include/php/Zend -I/opt/cpanel/ea-php54/root/usr/include/php/ext -I/opt/cpanel/ea-php54/root/usr/include/php/ext/date/lib -I/root/php-sweph/sweph/src -DHAVE_CONFIG_H -g -O2 -c /root/php-sweph/sweph.c -o sweph.lo
libtool: compile: cc -I. -I/root/php-sweph -DPHP_ATOM_INC -I/root/php-sweph/include -I/root/php-sweph/main -I/root/php-sweph -I/opt/cpanel/ea-php54/root/usr/include/php -I/opt/cpanel/ea-php54/root/usr/include/php/main -I/opt/cpanel/ea-php54/root/usr/include/php/TSRM -I/opt/cpanel/ea-php54/root/usr/include/php/Zend -I/opt/cpanel/ea-php54/root/usr/include/php/ext -I/opt/cpanel/ea-php54/root/usr/include/php/ext/date/lib -I/root/php-sweph/sweph/src -DHAVE_CONFIG_H -g -O2 -c /root/php-sweph/sweph.c -fPIC -DPIC -o.libs/sweph.o
/root/php-sweph/sweph.c: In function 'zif_swe_calc':
/root/php-sweph/sweph.c:571:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:571:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:571:2: note: each undeclared identifier is reported only once for each function it appears in
/root/php-sweph/sweph.c: In function 'zif_swe_calc_ut':
/root/php-sweph/sweph.c:622:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:622:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_calc_pctr':
/root/php-sweph/sweph.c:674:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:674:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_fixstar':
/root/php-sweph/sweph.c:731:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "star", star);
^
/root/php-sweph/sweph.c:731:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "star", star);
^
/root/php-sweph/sweph.c:732:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_fixstar_ut':
/root/php-sweph/sweph.c:786:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "star", star);
^
/root/php-sweph/sweph.c:786:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "star", star);
^
/root/php-sweph/sweph.c:787:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_get_planet_name':
/root/php-sweph/sweph.c:920:20: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(name);
^
/root/php-sweph/sweph.c:920:2: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(name);
^
/root/php-sweph/sweph.c: In function 'zif_swe_get_ayanamsa_ex':
/root/php-sweph/sweph.c:1076:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:1076:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_get_ayanamsa_ex_ut':
/root/php-sweph/sweph.c:1163:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:1163:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_get_ayanamsa_name':
/root/php-sweph/sweph.c:1196:52: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(swe_get_ayanamsa_name((int)isidmode));
^
/root/php-sweph/sweph.c:1196:2: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(swe_get_ayanamsa_name((int)isidmode));
^
/root/php-sweph/sweph.c: In function 'zif_swe_version':
/root/php-sweph/sweph.c:1225:33: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(swe_version(name));
^
/root/php-sweph/sweph.c:1225:2: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(swe_version(name));
^
/root/php-sweph/sweph.c: In function 'zif_swe_get_library_path':
/root/php-sweph/sweph.c:1253:45: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(swe_get_library_path(path));
^
/root/php-sweph/sweph.c:1253:5: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(swe_get_library_path(path));
^
/root/php-sweph/sweph.c: In function 'zif_swe_get_current_file_data':
/root/php-sweph/sweph.c:1311:43: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "path", a);
^
/root/php-sweph/sweph.c:1311:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "path", a);
^
/root/php-sweph/sweph.c: In function 'zif_swe_utc_to_jd':
/root/php-sweph/sweph.c:1633:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:1633:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_houses_ex2':
/root/php-sweph/sweph.c:1932:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:1932:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_houses_armc_ex2':
/root/php-sweph/sweph.c:2085:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2085:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_house_pos':
/root/php-sweph/sweph.c:2147:21: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(serr);
^
/root/php-sweph/sweph.c:2147:3: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_house_name':
/root/php-sweph/sweph.c:2190:20: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(name);
^
/root/php-sweph/sweph.c:2190:2: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(name);
^
/root/php-sweph/sweph.c: In function 'zif_swe_gauquelin_sector':
/root/php-sweph/sweph.c:2220:21: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(serr);
^
/root/php-sweph/sweph.c:2220:3: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_sol_eclipse_where':
/root/php-sweph/sweph.c:2251:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2251:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lun_occult_where':
/root/php-sweph/sweph.c:2293:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2293:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_sol_eclipse_how':
/root/php-sweph/sweph.c:2334:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2334:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_sol_eclipse_when_loc':
/root/php-sweph/sweph.c:2370:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2370:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lun_occult_when_loc':
/root/php-sweph/sweph.c:2414:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2414:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_sol_eclipse_when_glob':
/root/php-sweph/sweph.c:2454:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2454:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lun_occult_when_glob':
/root/php-sweph/sweph.c:2493:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2493:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lun_eclipse_how':
/root/php-sweph/sweph.c:2529:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2529:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lun_eclipse_when':
/root/php-sweph/sweph.c:2565:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2565:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lun_eclipse_when_loc':
/root/php-sweph/sweph.c:2601:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2601:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_pheno':
/root/php-sweph/sweph.c:2642:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2642:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_pheno_ut':
/root/php-sweph/sweph.c:2678:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2678:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_rise_trans':
/root/php-sweph/sweph.c:2826:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2826:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2835:47: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "star", star);
^
/root/php-sweph/sweph.c: In function 'zif_swe_rise_trans_true_hor':
/root/php-sweph/sweph.c:2871:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2871:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2880:47: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "star", star);
^
/root/php-sweph/sweph.c: In function 'zif_swe_nod_aps':
/root/php-sweph/sweph.c:2909:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2909:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_nod_aps_ut':
/root/php-sweph/sweph.c:2961:46: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:2961:3: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_deltat_ex':
/root/php-sweph/sweph.c:3025:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:3025:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_time_equ':
/root/php-sweph/sweph.c:3047:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:3047:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lmt_to_lat':
/root/php-sweph/sweph.c:3070:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:3070:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_lat_to_lmt':
/root/php-sweph/sweph.c:3092:45: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c:3092:2: error: 'add_assoc_string' undeclared (first use in this function)
add_assoc_string(return_value, "serr", serr);
^
/root/php-sweph/sweph.c: In function 'zif_swe_cs2timestr':
/root/php-sweph/sweph.c:3389:70: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(swe_cs2timestr((int)t, (int)sep, (int)suppressZero, a));
^
/root/php-sweph/sweph.c:3389:2: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(swe_cs2timestr((int)t, (int)sep, (int)suppressZero, a));
^
/root/php-sweph/sweph.c: In function 'zif_swe_cs2lonlatstr':
/root/php-sweph/sweph.c:3407:63: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(swe_cs2lonlatstr((int)t, pchar[0], mchar[0], s));
^
/root/php-sweph/sweph.c:3407:2: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(swe_cs2lonlatstr((int)t, pchar[0], mchar[0], s));
^
/root/php-sweph/sweph.c: In function 'zif_swe_cs2degstr':
/root/php-sweph/sweph.c:3422:40: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
RETURN_STRING(swe_cs2degstr((int)t, a));
^
/root/php-sweph/sweph.c:3422:2: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(swe_cs2degstr((int)t, a));
^
make: * [sweph.lo] Error 1"
The config file in v2.0.29 is incompatible with PHP 5.4. I can configure v2.0.29 with PHP 7.4 but not 5.4. But since our website is in 5.4, we are stuck.
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.