Related Links : Search Engine Optimization | | Search Engine Marketing | Online Marketing | Freelance Programmer| SEO Thailand | SEO Expert | SEO services | PHP Programmer Thailand | SEO Tutorial | What is SEO |

  Home Our SEO Services SEO Expert Consultant Php Programmer Scripts| Email : sachin {at} jainsachin {dot} com

PHP | instructs phar to intercept fopen, file_get_contents, opendir, and all of the stat-related functions | Manual | Tutorial | Help

SEO Services



Website Programming in PHP / MYSQL



Friends


    instructs phar to intercept fopen, file_get_contents, opendir, and all of the stat-related functions

    Phar::interceptFileFuncs

    (No version information available, might be only in CVS)

    Phar::interceptFileFuncs — instructs phar to intercept fopen, file_get_contents, opendir, and all of the stat-related functions

    Description

    void Phar::interceptFileFuncs ( void )

    instructs phar to intercept fopen(), readfile(), file_get_contents(), opendir(), and all of the stat-related functions. If any of these functions is called from within a phar archive with a relative path, the call is modified to access a file within the phar archive. Absolute paths are assumed to be attempts to load external files from the filesystem.

    This function makes it possible to run PHP applications designed to run off of a hard disk as a phar application.

    Parameters

    No parameters.

    Return Values

    Examples

    Example #1 A Phar::interceptFileFuncs() example

    <?php
    Phar
    ::interceptFileFuncs();
    include 
    'phar://' __FILE__ '/file.php';
    ?>

    Assuming that this phar is at /path/to/myphar.phar and it contains file.php and file2.txt, if file.php contains this code:

    Example #2 A Phar::interceptFileFuncs() example

    <?php
    echo file_get_contents('file2.txt');
    ?>

    Normally PHP would search the current directory for file2.txt, which would translate as the directory of file.php, or the current directory of a command-line user. Phar::interceptFileFuncs() instructs PHP to consider the current directory to be phar:///path/to/myphar.phar/ and so opens phar:///path/to/myphar.phar/file2.txt in the above example code.


    SEO Tutorial / Articles





    Php / Mysql Tutorial



    Articles



      Portfolio


      SEO by Jainsachin