# Are there any easy way to use PHP lib?

**URL:** https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857
**Category:** Haxe
**Tags:** haxe-php
**Created:** [July 2, 2019, 2:15am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857 "2019-07-02T02:15:46Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Zhan](https://community.haxe.org/user_avatar/community.haxe.org/zhan/32/468_2.png) [@Zhan](https://community.haxe.org/u/Zhan)
#### Post date: [July 2, 2019, 2:15am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/1 "2019-07-02T02:15:47Z")

</div>

Are there any easy way to use PHP lib?

or to rewrite everything (extern) by hand? it’s huge job.

---

<div class="post-metadata">

### Author: ![Zhan](https://community.haxe.org/user_avatar/community.haxe.org/zhan/32/468_2.png) [@Zhan](https://community.haxe.org/u/Zhan)
#### Post date: [July 2, 2019, 2:49am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/2 "2019-07-02T02:49:43Z")

</div>

although this URL can do what I want

[http://phptohaxe.haqteam.com/code.php](http://phptohaxe.haqteam.com/code.php)

but it’s not batch tool,I still need one by one to convert.

---

<div class="post-metadata">

### Author: ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)
#### Post date: [July 2, 2019, 6:52am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/3 "2019-07-02T06:52:14Z")

</div>

Here are the sources of that lib: [https://bitbucket.org/yar3333/phptohaxe/src/default/](https://bitbucket.org/yar3333/phptohaxe/src/default/)  
You can try and turn it into batch tool.

Currently there is not automatic extern generator for php target afaik. But I’m working on one and my plan is to finish it by the end of the summer.

---

<div class="post-metadata">

### Author: ![Zhan](https://community.haxe.org/user_avatar/community.haxe.org/zhan/32/468_2.png) [@Zhan](https://community.haxe.org/u/Zhan)
#### Post date: [July 2, 2019, 9:37am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/4 "2019-07-02T09:37:15Z")

</div>

> [@RealyUniqueName](#):
>
> 目前还没有针对php target afaik的自动外部生成器。但是我正在研究一

sound’s great!

---

<div class="post-metadata">

### Author: ![rivetweb](https://community.haxe.org/user_avatar/community.haxe.org/rivetweb/32/1338_2.png) [@rivetweb](https://community.haxe.org/u/rivetweb)
#### Post date: [July 8, 2019, 6:08am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/5 "2019-07-08T06:08:39Z")

</div>

you can try my tool (but its not finished)

> <https://github.com/xukku/6umpukc/blob/morbid_angel/bx#L662>

> bx haxe index.php

---

<div class="post-metadata">

### Author: ![Zhan](https://community.haxe.org/user_avatar/community.haxe.org/zhan/32/468_2.png) [@Zhan](https://community.haxe.org/u/Zhan)
#### Post date: [July 8, 2019, 4:29pm UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/6 "2019-07-08T16:29:58Z")

</div>

nice ,hope you can finish soon.

---

<div class="post-metadata">

### Author: ![Zhan](https://community.haxe.org/user_avatar/community.haxe.org/zhan/32/468_2.png) [@Zhan](https://community.haxe.org/u/Zhan)
#### Post date: [March 21, 2020, 3:29am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/7 "2020-03-21T03:29:08Z")

</div>

@rivetweb @RealyUniqueName any progress? batch convert php to haxe extern?

---

<div class="post-metadata">

### Author: ![diddledan](https://community.haxe.org/user_avatar/community.haxe.org/diddledan/32/1708_2.png) [@diddledan](https://community.haxe.org/u/diddledan)
#### Post date: [April 10, 2020, 11:58am UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/8 "2020-04-10T11:58:52Z")

</div>

I’m not certain of correctness - it’s likely the externs are very broken, but I’m sure it’s an improvement over nothing: I’ve pushed a PR to @RealyUniqueName’s peg repo that moves it towards creating some initial attempts at extern file generation for PHP code. [Add basic extern files generation instead of dumping to stdout by diddledan · Pull Request #5 · RealyUniqueName/peg · GitHub](https://github.com/RealyUniqueName/peg/pull/5)

---

<div class="post-metadata">

### Author: ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)
#### Post date: [April 10, 2020, 2:25pm UTC](https://community.haxe.org/t/are-there-any-easy-way-to-use-php-lib/1857/9 "2020-04-10T14:25:58Z")

</div>

I’ve merged the PR, thank you!

I’m working on PEG in a [branch](https://github.com/RealyUniqueName/peg/commits/feature/generation) to get it to the first release. As you can see by the commit history, I don’t have much time for it nowadays 🙂 But it’s not abandoned.
