PHP - Phpdoc Does Not Create @usesby Tag
+ tree src src └── classes.php + cat src/classes.php <?php class Class1 { /** * @uses Class2::method2() */ function method1(){} } class Class2 { function method2(){} } + phpdoc -d src -t /tmp/docs + grep method1 /tmp/docs/classes/Class2.html || echo 'REFERENCE NOT FOUND' REFERENCE NOT FOUND
On the page /tmp/docs/classes/Class2.html, there should be no reference (@usesby) to Class1::method1()? Also, this is what the page /tmp/docs/classes/Class2.html looks like if it is opened in a browser https://i.snipboard.io/cl6gSs.jpg As already mentioned, Class1::method1() is not mentioned anywhere Similar TutorialsWhen using the phpDoc PHAR to parse the following file, it returns Parse Error: Syntax error, unexpected '(' on line 16 No summary was found for this file, and doesn't include the file. The specific script which triggers the error is ($this->prototype)(). I am using the PHAR listed on https://www.phpdoc.org/ which appears to be the same as https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar, and am running PHP 7.1.26. Any guess why I am getting this error? Recommended workarounds? As a hack, I am thinking of adding an ignored function or class who's only missing is to invoke the anonymous function. I've also tried using the PHAR at https://github.com/phpDocumentor/phpDocumentor2/releases/tag/v3.0.0-alpha.3, and while I don't get this error, I don't get any output. I first tried it without downloading the public key but got ssl errors. Is there more to in than just locating the two files in the same directory? Thanks <?php /** * My Summary. * * My Description. */ class Foo { private $prototype; public function __construct() { $this->prototype=function(){ return 'prototype';}; } public function getPrototype() { $prototype=($this->prototype)(); return $prototype; } } [michael@devserver test]$ php /usr/share/phar/phpDocumentor.phar -d ./phpDocDir -t ./phpDocTarget Collecting files .. OK Initializing parser .. OK Parsing files Parsing /var/www/public/test/phpDocDir/testphpdocs.php Parse Error: Syntax error, unexpected '(' on line 16 No summary was found for this file Storing cache in "/var/www/public/test/phpDocTarget" .. OK Load cache .. 0.001s Preparing template "clean" .. 0.011s Preparing 17 transformations .. 0.000s Build "elements" index .. 0.000s Replace textual FQCNs with object aliases .. 0.000s Resolve @link and @see tags in descriptions .. 0.000s Enriches inline example tags with their sources .. 0.000s Build "packages" index .. 0.000s Build "namespaces" index and add namespaces to "elements" .. 0.000s Collect all markers embedded in tags .. 0.000s Transform analyzed project into artifacts .. Applying 17 transformations Initialize writer "phpDocumentor\Plugin\Core\Transformer\Writer\FileIo" Initialize writer "phpDocumentor\Plugin\Twig\Writer\Twig" Initialize writer "phpDocumentor\Plugin\Graphs\Writer\Graph" Execute transformation using writer "FileIo" Execute transformation using writer "FileIo" Execute transformation using writer "FileIo" Execute transformation using writer "FileIo" Execute transformation using writer "FileIo" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "twig" Execute transformation using writer "Graph" 0.073s Analyze results and write report to log .. 0.000s [michael@devserver test]$
Hello everyone, I am working on a form that is similar to a shopping cart system and I am thinking of creating a button that submits the checked value and saves them to a $_SESSION variable. And also a link that links to a cart.html that takes the values of a $_SESSION variable. I am have trouble figuring what tag/attribute should I use in order to achieve that.
Right now my code attached below submits the checked values to cart.html directly. However I want my submit button to save the checked box to a $_SESSION variable and STAY on the same page. And then I will implement a <a> to link to the cart.php.
I researched a little bit about this subject and I know it's somewhat related to ajax/jquery. I just wanted to know more about it from you guys. I appreciate your attention for reading the post and Thanks!
Below is the form that I currently have:
<form name= "finalForm" method="POST" action="cart.php"> <input type="Submit" name="finalSelected"/> <?php foreach($FinalName as $key => $item) {?> <tr> <td><input type="checkbox" name="fSelected[]" value="<?php echo htmlspecialchars($FinalID[$key])?>" /> <?php echo "$FinalID[$key] & $item";?> </td> </tr> <?php } ;?>Below is the code for cart.php <?php require ('connect_db.php'); if(isset($_POST['finalSelected'])) { if(!empty($_POST['fSelected'])) { $chosen = $_POST['fSelected']; foreach ($chosen as $item) echo "aID selected: $item </br>"; $delimit = implode(", ", $chosen); print_r($delimit); } } if(isset($delimit)) { $cartSQL = "SELECT * from article where aID in ($delimit)"; $cartQuery = mysqli_query($dbc, $cartSQL) or die (mysqli_error($dbc)); while($row = mysqli_fetch_array($cartQuery, MYSQLI_BOTH)) { $aTitle[] = $row[ 'name' ]; } } ?> <table> <?php if(isset($delimit)) { $c=0; foreach($aTitle as $item) {?> <tr> <td> <?php echo $aTitle[$c]; $c++;?> </td> </tr> <?php }}?> </table> Hii i want to create an api of the short url site ( http://torrentz.0fees.net ). In the api page it is says that Code: [Select] API Our API allows you to provide short url functionality to any of your existing websites. Url Only To generate a url via the API, send a POST or GET request to the site in the following format: - http://torrentz.0fees.net/index.php?api=1&return_url_text=1&longUrl={URL} This site will then generate the short url and return it as plain text. i.e: - http://torrentz.0fees.net/a1 I have created an form but not able to use it. The form script is shown below. Code: [Select] <form name="input" action="html_form_action.asp" method="get"> Username: <input type="text" name="user" /> <input type="submit" value="Submit" /> </form> Whenever i'm putting the ( http://torrentz.0fees.net/index.php?api=1&return_url_text=1&longUrl={URL} ) it shows an error. I know that the input url must be used in the ( {URL} ) section but how can i do that using php Can anyone help me with code... hi, I'm currently trying to resize and create pictures and .jpg/jpeg & .gif works perfectly but .png just creates an empty 0bit image, why?! Code: [Select] $ = imagecreatefrompng(); imagecopyresampled(); imagepng(); I'm doing something like that and it - as said - works great with .jpg and gif but at png it just fucks up. :/ HOw to create this header?
I give +. thx
http://i.snag.gy/15Ep4.jpg
Hey Everyone, I need to have the ability to create PDF/X1A documents. My initial thoughts are it would be easy as i have created PDFs in the past with no hassle. I have been trawling the google and various blogs but with no joy. Does anyone have any experience creating PDF/X1A documents in PHP ? Is it possible ? Regards, -Ben Hi, How could I make a php script that creates a new folder (with the name as the date) every day automatically? Cheers, George Hello all That forum is my last desperate attemp to do what i want to do. Ok here is the story I want to create a simple rss feed in conjuction with php and mysql. I dont want admin areas ect , i just want when i insert a new listing to my database to be able shown up to my (future) rss subscribers. To be more technically specific i want to show to my surfers updates about 2 tables in my database not all the tables. The example i found so far were about only 1 table, plus i was encounting errors to my script. I would like some ideas, directions if someone is kind enough to help a sad developer Thanks in advance! Hi, Here is simple question. I have this array: array([0]=>name [1]=>Tony); How can i change into array(name=>Tony); ? Thank you, ayok Hi all I'm trying to create an XML file to be used within Excel. The data is drawn dynamically from my database depending on the information supplied by the user. However when I run it, I get a complain from Excel about some missing whitespace. any ideas? Code: [Select] <?php $output='<?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Author>Europcar</Author> <LastAuthor>Europcar</LastAuthor> <Created>2011-10-28T10:48:37Z</Created> <Company>Europcar</Company> <Version>11.9999</Version> </DocumentProperties> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>11760</WindowHeight> <WindowWidth>15195</WindowWidth> <WindowTopX>480</WindowTopX> <WindowTopY>75</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> <Font/> <Interior/> <NumberFormat/> <Protection/> </Style> </Styles> <Worksheet ss:Name="Sheet1"> <Table ss:ExpandedColumnCount="'.$columns.'" ss:ExpandedRowCount="'.($count+5).'" x:FullColumns="1"x:FullRows="1">'; //$output.='<Column ss:AutoFitWidth="0" ss:Width="50"/>/n'; $output.='<Row>'; foreach ($titles as $value){ if(is_numeric(substr($value,0,1))){ $value=substr($value,1); } $output.='<Cell><Data ss:Type="String">'.$value.'</Data></Cell>'."LF"; } /*$output.='</Row>'; foreach ($dataOut as $value){ $output.='<Row>'; foreach($value as $values){ if(strlen($values)<1){ $values=" "; } $output.= '<Cell><Data ss:Type="String">'.$values.'</Data></Cell>'; } $output.='</Row>'; }*/ $output.=' </Table> <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> <Selected/> <Panes> <Pane> <Number>3</Number> <ActiveRow>'.($count+5).'</ActiveRow> <ActiveCol>'.$columns.'</ActiveCol> </Pane> </Panes> <ProtectObjects>False</ProtectObjects> <ProtectScenarios>False</ProtectScenarios> </WorksheetOptions> </Worksheet> </Workbook>'; HI all, I am building a php application and i am wanting to use notifications. At the moment i am just wanting to understand the methodology behind this. I dont necessarily have a use case for these notifications yet but i am going to base it off of the following: A user submits something to the database, another user gets a notifications that this has happened. I see the notifications being something appearing in the header bar (saying "you have a notification"...) I know that i will need to use ajax for this and JS/JQ but i am not really sure where to start with this. I have done some research and have come up a little blank. My main question at the moment is how does the submission of data to the database trigger the notification? As always and help here is appreciated. Kind Regards Adam I have a table in my database for users. On the registration page I want to create another table with the id of the user as the table name. $sql = "CREATE TABLE IF NOT EXISTS `id_prod` ( ) how do i modify this line so that it takes the id from the user table and creates a new table with id as name followed by prod. I have a simple form and I run my script without any errors. I click my btn and I would like to see my echo errors but no errors show up when I have no value in textboxes. I have tried if(isset($_Post["submit"])) and if($_SERVER["REQUEST_METHOD"] == "post") What I think is nether of there ifs are becoming valid on my btn click. <?php $nameerror = $twoerror = $errormsg = ""; // PHP Procedural MYSQLi // connect to mysql database with phpmyadmin $servername = "localhost"; $username = "root"; $password = "password"; $dbname = "test"; $connection = new mysqli($servername, $username, $password, $dbname); //if(isset($_Post["submit"])) if($_SERVER["REQUEST_METHOD"] == "post") { if(empty(trim($_Post["name"]))) { $nameerror = "Name is required"; } else { $namesafe = mysqli_real_escape_string($connection, $_Post["name"]); } if(empty(trim($_Post["two"]))) { $twoerror = "Two is required"; } else { $twosafe = mysqli_real_escape_string($connection, $_Post["two"]); } if($namesafe != "" && $twosafe != "") { $sqlInsert = "INSERT INTO tester(name, two) " . "VALUES('". $namesafe ."','". $twosafe ."')"; if(mysqli_query($connection, $sqlInsert)) { echo "Successfully entered."; } else { echo "NOT successful error: " . $sqlInsert . "<br>" . mysqli_error($connection); } } } mysqli_close($connection); ?> <?php if(!$connection) { die("Connection Failed! " . mysqli_connect_error()); } echo "Connected Successfully@!"; ?> <section class="text-align" id="section-content"> <div id="alertMessages" class="container rounded"></div> <div id="contentdiv" class="container rounded"> <form id="formtest" class="rounded" method="post" > <!-- action="" --> <h3>PHP Create</h3> <?php if(isset($errormsg)) { // echo "<div><span>"; echo $errormsg; // echo "</span></div>"; } ?> <div> <div class="form-group"> <input type="text" class="form-control" id="txtName" name="name" /> <label for="txtName">Name </label> <?php if(isset($nameerror)) { echo '<span class="error">' . $nameerror . '</span>'; } ?> <!-- ? php//if(isset($_Post["name"])) echo htmlspecialchars($_Post["name"]); ? >" /> ---> <!-- <span class="error"><?php //echo $nameerror; ?></span> --> </div> <div> <input type="text" class="form-control" id="txttwo" name="two" /> <label for="txttwo">Text Two </label> <?php if(isset($twoerror)) { echo '<span class="error">' . $twoerror . '</span>'; } ?> </div> </div> <button type="submit" class="btn btn-lg btn-primary btn-block" name="submit">Click</button> </form> </div> </section>
For the life of me I can not figure out why this is not creating the table in the database. Second set of eyes would be great.
function install_kudos() { global $wpdb; $table_name = $wpdb->prefix . 'acikudosnew'; if ($wpdb->get_var('SHOW TABLES LIKE ' .$table_name) != $table_name) { $sql = "CREATE TABLE $table_name ( kudoid int(9) NOT NULL AUTO_INCREMENT, kudomsg text NOT NULL, kudoagent text NON NULL, kudocust text NOT NULL, kudoacct int(16) NOT NULL, kudoclient varchar(100) NOT NULL, kudoloc text NOT NULL, kudoentry TIMESTAMP DEFAULT CURRENT_TIMESTAMP, kudoadmin text NOT NULL, kudopic varchar(55) DEFAULT '' NOT NULL, PRIMARY KEY (kudoid) )"; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); dbDelta( $sql ); } } register_activation_hook(__FILE__, 'install_kudos');
I would like to create something like foursquare badges. When ppl upload files, the most downloaded files will have a new badge, how do i create that? I'm using a php $_POST variable as the name of a file that I want to create. fopen() , according to my understanding open the file if it exists or creates it if it doesn't. $Ref = $_POST['Ref']; I using each reference element of $Ref as the name of a file in a certain directory. So if $Ref[$i] exists as a file name in a certain directory, append to the file, if it doesn't create the file in that directory and write to it. Do I use the file path of the file within fopen()? fopen(./References/$Ref,a) or fopen(./References/$Ref,w)? Hello, I am creating zip file of multiple files using PHP and downloading it. Problem is that: zip file is getting extracted by only WinRAR, its not getti ng extracted by default windows extracter or other software. Here is code which I have written -
$file_folder = 'referral-resume/'; I am using the following code: Code: [Select] <?php $target = "images/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } ?> I am using this to upload photos to the directory called 'images'. How could I change this code so that I can choose an existing directory to upload it to and also create a new directory to upload it to if I wanted? When creating a PHP document we use echo ''; to wrap HTML into PHP, so why does it seem to me that people always say to create a form using PHP you must break it up by using HTML to show the form itself? Is there a way to create the form, and do all that is required using PHP and wrapping PHP around HTML to make it work? I can't imagine its impossible. Please i have questions on how to create a file system server. were you clients could upload files and download their files in the future. Is this professional to store the files in database |