Home Page
  • April 04, 2025, 06:54:24 am *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Official site launch very soon, hurrah!



Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Subject:
Message icon:

Bold Italicized Underline Strikethrough | Preformatted Text Left Align Centered Right Align
Insert Image Insert Hyperlink Insert Email Insert FTP Link | Glow Shadow Marquee | Superscript Subscript Teletype | Insert Table Insert Code Insert Quote | Insert Unordered List Insert Ordered List Horizontal Rule | Remove Formatting Toggle View
Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips sealed Undecided Kiss Cry
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Please stop spamming. Your spam posts are moderated and will never be displayed on the internet. What is eighty-eight minus eighty-six (spell out the answer):
Пожалуйста, прекратите спамить. Ваши спам-сообщения модерируются и никогда не будут отображаться в Интернете. What color is grass.:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: Dakusan
« on: October 03, 2015, 03:57:31 pm »

Original post for Missing phar wrapper can be found at https://www.castledragmire.com/Posts/Missing_phar_wrapper.
Originally posted on: 10/03/15

Phar files are PHP’s way of distributing an entire PHP solution in a single package file. I recently had a problem on my Cygwin PHP server that said “Unable to find the wrapper "phar" - did you forget to enable it when you configured PHP?”. I couldn’t find any solution for this online, so I played with it a bit.

The quick and dirty solution I came up with is to include the phar file like any normal PHP file, which sets your current working directory inside of the phar file. After that, you can include files inside the phar and then change your directory back to where you started. Here is the code I used:

if(preg_match('/^(?:win|cygwin)/i', PHP_OS))
{
   $CWD=getcwd();
   require_once('Scripts/PHPExcel.phar');
   require_once('PHPExcel/IOFactory.php');
   chdir($CWD);
}
else
   require_once('phar://Scripts/PHPExcel.phar/PHPExcel/IOFactory.php');