Questions tagged [xhp]

XHP is a PHP extension which augments the syntax of the language such that XML document fragments become valid PHP expressions. This allows you to use PHP as a stricter templating engine and offers much more straightforward implementation of reusable components.

XHP automatically escapes all input data making it near-fool proof to XSS vulnerabilities. Because XHP augments the syntax of the language you don't need to manually sanitize any input which passes through XHP.

XHP is also dynamic and contains reusable objects. This means that we don't have to constantly define the same HTML code (Think defining a variable in PHP).

Lastly, XHP forces valid HTML markup at compile time (and will fail completely if it's invalid). Invalid markup is a thing of the past with XHP.

Source: https://coderwall.com/p/3leegq

13 questions
3
votes
1 answer

XHP with Regex for link Replacement

I am trying to implement a simple function that given a text input, returns the text modified with xhp_a when a link is detected, within a paragraph xhp_p. Consider this class class Urlifier { protected static $reg_exUrl =…
Themis Beris
  • 980
  • 1
  • 11
  • 25
2
votes
2 answers

XHP with PHP 5.4 not affecting the parser when script is called via Apache

I recently built XHP 1.5 from source, and installed it on an existing web server. The web server is running PHP 5.4.32, Apache 2.2.15 calling PHP using mod_php (not fastcgi), CentOS 6.5. All our existing PHP code (that doesn't rely on the new XHP…
Jeremy Wadhams
  • 1,744
  • 18
  • 26
1
vote
0 answers

Error installing XHP with composer

I'm trying to install XHP on OSX using composer. I have a directory with composer.phar and composer.json. My composer.json file looks like this: { "require": { "facebook/xhp-lib": "~2.2" } } I also installed the latest version…
1
vote
2 answers

How to successfully blend XHP and ReactJS implementation of a component

Suppose we have the following situation: we have a blog with a posts feed. When the page loads, there should already be like 3 s loaded, created on the server-side; the user will scroll down or press a Load more button and some new post…
Victor
  • 13,914
  • 19
  • 78
  • 147
1
vote
1 answer

Passing children from XHP to ReactJS

I have an XHP component: final class :common:message-stripe extends :ui:base { use XHPReact; protected function compose() { $this->constructReactInstance( "MessageStripe", Map {} ); return
getID()} />; } } that should…
Victor
  • 13,914
  • 19
  • 78
  • 147
1
vote
1 answer

How to get XHP working in hack/hhvm on Ubuntu

I've installed hack-nightly and set up fastcgi using nginx by following the instructions on the website, however I'm getting an error when trying to create a simple file that uses xhp: hello; echo…
Paul Johnson
  • 1,329
  • 1
  • 12
  • 25
1
vote
1 answer

XHP fails with random Segmentation Fault 11 on OSX

I'm trying to install XHP on my OSX Lion and I'm getting random segmentation faults. The same program sometimes fails and sometimes runs. Even a program that imports init.php only.
bakerstreet221b
  • 141
  • 1
  • 4
0
votes
2 answers

How to pass null argument to function that accept :xhp as parameter?

I have function like this : private static function myfun( string $param1, :xhp $param2, ): :xhp { return //somethinf } I don't want to pass any thing as param2. How can I do that ? When I try doing like : myfun("Hi",null),…
danish sodhi
  • 1,793
  • 4
  • 21
  • 31
0
votes
1 answer

using hhvm and composer on openshift

I am building a test application on Openshift using the Nginx HHVM 3.13.1, MySQL 5.5 and phpMyAdmin 4.0 cartridges. This is a working application that I have running locally in a vagrant box that uses Composer and has a dependency on Facebook's…
Kenneth Rapp
  • 159
  • 1
  • 9
0
votes
1 answer

composer install xhp-lib timeout

I'm just stuck trying to get Composer to work. I'm using Debian Jessie, I'm very new to linux and all of this stuff. So, I have downloaded and installed HHVM and everything works fine. I have created a json file that looks like this: { …
Victor Tello
  • 161
  • 13
0
votes
3 answers

Get children of an XHPChild

I am trying to move my website to Hack and XHP, of course. Below is a structure of what code structure I want to achieve: stories
Victor
  • 13,914
  • 19
  • 78
  • 147
0
votes
0 answers

How come XHP can alter PHP syntax and yet be wholly implemented as an extension?

I think what I'm asking is this: To make PHP understand $a=
{$stuff}
one must alter the PHP parser The above can not be done in a PHP extension or even a Zend extension. To introduce new syntax one has to modify the Zend Engine. XHP does…
Ashkan Kh. Nazary
  • 21,844
  • 13
  • 44
  • 68
0
votes
1 answer

Building XHP php extension on mac os x with xampp

I'm trying to install xhp on my local machine, a Macbook pro running os x 10.8.2, aka Mountain Lion (64 bit). I've xampp with the development package installed. I've already spent many hours trying to get it to work, and I think I'm pretty close.…
Frederik Wordenskjold
  • 10,031
  • 6
  • 38
  • 57