Professional Web Applications Themes

PEAR like, php-csl, code library - anyone doing this? - PHP Development

howdy, I am using this code library thing: http://sourceforge.net/projects/php-csl/ http://www.php-csl.com/snippets/ and had an idea. I was thinking about keeping a bunch of functions in the root dir of my server, so I can re-use my code from any of my websites without having to copy each func or code into the current site that im working on. So, Itd be kinda like PEAR, youd just go: Code: include "/home/library/thefunction.php; $var = thefunction(); That php-csl that i linked to would have to be modified, cuz it stores the snippets in *.s files. No biggie. Also, it would be cool to have ...

  1. #1

    Default PEAR like, php-csl, code library - anyone doing this?

    howdy, I am using this code library thing:
    http://sourceforge.net/projects/php-csl/

    http://www.php-csl.com/snippets/
    and had an idea. I was thinking about keeping a bunch of functions in
    the root dir of my server, so I can re-use my code from any of my
    websites without having to copy each func or code into the current
    site that im working on. So, Itd be kinda like PEAR, youd just go:

    Code:
    include "/home/library/thefunction.php;
    $var = thefunction();

    That php-csl that i linked to would have to be modified, cuz it stores
    the snippets in *.s files. No biggie. Also, it would be cool to have
    the code you need for including the func be in a text area that could
    have a copy to clipboard button.

    Anyone doing such a thing? Have any security concerns? Other
    thoughts?

    thanks,
    juglesh

    --
    Posted using the http://www.dbforumz.com interface, at author's request
    Articles individually checked for conformance to usenet standards
    Topic URL: http://www.dbforumz.com/PHP-PEAR-csl-code-library-ftopict241484.html
    Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=839478
    juglesh Guest

  2. #2

    Default Re: PEAR like, php-csl, code library - anyone doing this?

    juglesh wrote:
     

    Hmmm, interesting.
     

    This is a really bad place to put things.
     

    I'm guessing the '.s' files are some sort of composite of the PHP code, the
    doentation and meta-data? Wouldn't it be a lot simpler to just write
    your own wrapper for extracting the PHP code from the .s file? That way you
    don't have to maintain 2 seperate repositories. e.g.

    require_once "http://localhost/snippets_archive.php?snip=someref";

    (make sure you know about code injection, safe_mode and open_basedir before
    you try this at home kids).

    C.
    Colin Guest

  3. #3

    Default Re: PEAR like, php-csl, code library - anyone doing this?



    Colin McKinnon wrote: 
    >
    > Hmmm, interesting.

    >
    > This is a really bad place to put things.[/ref]

    How come? Actually, it wouldnt be the root of the server, but the root
    of all the 'users' (powerVPS hosting). So, there is a folder for
    THisWEbsite, ThatWebsite, TheOther, and there I would stick this
    library. Would that be ok? 
    >
    > I'm guessing the '.s' files are some sort of composite of the PHP code, the
    > doentation and meta-data? Wouldn't it be a lot simpler to just write
    > your own wrapper for extracting the PHP code from the .s file? That way you
    > don't have to maintain 2 seperate repositories. e.g.
    >
    > require_once "http://localhost/snippets_archive.php?snip=someref";[/ref]

    Yeah, the *.s files just have the code that you enter in the admin
    page. Description, etc goes in a similarly named, *.d file. I think
    I'm going to rewrite that library anyway, there's tons of junk I dont
    need, and silly ways of doing things. Easy just to do readirs to build
    the menus, etc.
     

    No, you wouldnt want to go including() $_get['snip'], would you? I
    think for the display part of the library, I'd just do a
    file_get_contents, and spit out a htmlentities-ized snippet.

    --
    juglesh

    juglesh Guest

  4. #4

    Default Re: PEAR like, php-csl, code library - anyone doing this?


    Colin McKinnon wrote: 
    >
    > Hmmm, interesting.

    >
    > This is a really bad place to put things.[/ref]

    how come? actually, I was going to put them in the same dir as my
    cpanel 'users'. In a sub domain. [/ref]

    got that clipboard part going, too. 

    Yeah, I just rewrote the thing, mine just reads php files.
     

    It doesnt include the snip, it just reads it and echos it.

    juglesh Guest

Similar Threads

  1. the confused-code in text-library !
    By emicky in forum Macromedia Director Basics
    Replies: 0
    Last Post: April 26th, 03:43 AM
  2. Replies: 0
    Last Post: November 18th, 10:11 AM
  3. Replies: 0
    Last Post: November 18th, 05:58 AM
  4. How to debug the library code?
    By Ganesh in forum UNIX Programming
    Replies: 6
    Last Post: October 10th, 03:33 PM
  5. Replies: 0
    Last Post: August 9th, 02:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139