This question already has answers here:
Unzip a file with php
(12 answers)
Closed 5 years ago.
Is there a php function or class that does not require special libraries to be compiled with php in order to unzip a file.
I'm looking for something that processes the unzip and decompression entirely with php. It seems like all of them require some external extensions compiled with php. Correct me if I'm wrong.
This is something I've never seen before to be honest. Most hosts will actually install libraries such as zlib for you if you ask (if they're not already) so you can use the functionality
Related
This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
What are namespaces?
(12 answers)
How does the keyword "use" work in PHP and can I import classes with it?
(10 answers)
Closed 1 year ago.
I'm trying to use the LupeCode\phpTraderNative at https://github.com/LupeCode/phpTraderNative
I'm an "old school BASIC GOTO 10 procedural coding" kinda guy, though I've often used other libraries that use namespaces, objects, classes, and whatnot but there's usually an example included on how to use them. This one hasn't.
The documentation states:
If you had
trader_adosc($high, $low, $close, $volume, $fastPeriod, $slowPeriod)
You can swap that with
Trader::adosc($high, $low, $close, $volume, $fastPeriod, $slowPeriod)
You only need to change trader_ to Trader::. That's it!
So after installing it with composer and requiring the vendor/autoload.php i'm having a hard time figuring out how to use Trader:: in my code.
Fatal error: Uncaught Error: Class "Trader" not found in
I tried several things like:
use Lupecode\phpTraderNative;
or
$var = new Trader();
And variations, even tried including files from the source. But nothing seems to enable me to use it.
Can someone point me in the right direction here?
This package is handled by PECL. To install it you can use:
apt-get install php-pear php-dev libcurl3-openssl-dev
pecl install trader
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Does PHP allow *.properties file as in Java?
How to read/parse .properties file using PHP?
.properties files are usually used in Java platform. Its counterpart in PHP is .ini files. .ini files can be parsed natively by PHP using parse_ini_file(). See this stackoverflow question: Does PHP allow *.properties file as in Java?.
Still, if you would like to read and parse .properties files, you have to do that manually. A quick search on Google take me to the following result:
reading java-style properties file in PHP - Github repository
Hope this helps :)
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Build Tar file from directory in PHP without exec/passthru
Does PHP have a tar like function? So that I can create a tar file containing some dirs just created?
Archive_Tar will do this for you. You should know that this only makes a file that contains a lot of files; they aren't compressed at all. Consider compressing with gzip for text data or bzip for binary data.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can you “compile” PHP code?
After I write an application in PHP, why can't I compile it into machine language? I know that it's possible to make a byte-code version of the file, which (as I understand it) is basically a file that has already been parsed into tokens.
But that's not what I want. Clearly it can't work in a general sense, since compiled code will be platform-specific, but let's say I have chosen a given platform. Why can't I create a binary file that would be the same code that PHP would run when given my .php file?
You can, facebook released a project which is currently being updated for php 5.3 (supports everything lower iirc) called HipHop, you can find it here: https://github.com/facebook/hiphop-php
There are a few compilers out there like facebook's, mentioned by #Howard, or http://www.roadsend.com/home/index.php?pageID=compiler. I've never tried them though.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How do I add exif data to an image?
I want to modify some information in exif data with PHP. I've googled around but no hope. There's function in PHP, exif_read_data. But it only reads not writes. Anybody knows how or walkaround?
Looks fairly old but may be something for you: http://pel.sourceforge.net/
This gets also mentioned in the linked article from Calvin L.
http://pel.sourceforge.net/
A php extension that can write exif data, with installation instructions using PEAR. It requires that you can control which extensions are being installed on the machine that runs your PHP, which is not the case in many virtual hosting environments.