Skip to content

Instantly share code, notes, and snippets.

@paulbarbu
paulbarbu / gist:923151
Created April 16, 2011 14:34
Afisarea unei structuri de date recursive
<?php
function get_directory_structure($dirpath){
$ar = array();
$dh = opendir($dirpath);
while($entry = readdir($dh)){
if($entry != "." && $entry != ".."){
if(is_dir($dirpath.DIRECTORY_SEPARATOR.$entry)) {
@paulbarbu
paulbarbu / gist:950527
Created May 1, 2011 14:14
an exercise from #yap book
<?php
/**
* void render(string $template, array $vars = NULL)
*
*/
function render($template, $vars = NULL){
if($vars != NULL){
foreach($vars as $name => $val){
$$name = $val;
}
@paulbarbu
paulbarbu / .gitignore
Created May 7, 2011 17:47
soluţiile mele pentru yap-phpro-book (paullik)
*.swp
*~
RewriteEngine on
RewriteRule guestbook/(.*)/(.*) /github/solutiile%20mele%20yap/guestbook/index.php?$1=$2
http://localhost:88/github/solutiile%20mele%20yap/guestbook/index.php?show=text
[paullik@localhost peej-phpdoctor-67c1af0]$ php -f phpdoc.php yacms.ini
Reading file "/media/PauLLiK/localhost/github/yaCMS/src/global_const.php"
Parsing tokensPHP Fatal error: Call to undefined method RootDoc::packageName() in /home/paullik/Downloads/peej-phpdoctor-67c1af0/classes/phpDoctor.php on line 902
Fatal error: Call to undefined method RootDoc::packageName() in /home/paullik/Downloads/peej-phpdoctor-67c1af0/classes/phpDoctor.php on line 902
; Default configuration file for PHPDoctor
; This config file will cause PHPDoctor to generate API documentation of
; itself.
; PHPDoctor settings
; -----------------------------------------------------------------------------
; Names of files to parse. This can be a single filename, or a comma separated
@paulbarbu
paulbarbu / gist:1069859
Created July 7, 2011 16:08
phpDoctor error
[paullik@localhost phpdoctor]$ php phpdoc.php yacms.ini
Reading file "/media/PauLLiK/localhost/github/yaCMS/src/functions.php"
Parsing tokensPHP Fatal error: Call to undefined method RootDoc::packageName() in /media/PauLLiK/localhost/github/phpdoctor/classes/phpDoctor.php on line 902
Fatal error: Call to undefined method RootDoc::packageName() in /media/PauLLiK/localhost/github/phpdoctor/classes/phpDoctor.php on line 902
@paulbarbu
paulbarbu / yacms.ini
Created July 7, 2011 16:14
yacms.ini
; Default configuration file for PHPDoctor
; This config file will cause PHPDoctor to generate API documentation of
; itself.
; PHPDoctor settings
; -----------------------------------------------------------------------------
; Names of files to parse. This can be a single filename, or a comma separated
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "./kitty_actions.c"
void main(void){
kitty jerry;
jerry = bornCat("jerry");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "./kitty_actions.c"
void main(void){
kitty jerry;
jerry = bornCat("jerry");