GithubHelp home page GithubHelp logo

api_generator's Introduction

CakePHP

Software License Coverage Status PHPStan Code Consistency Total Downloads Latest Stable Version

CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Associative Data Mapping, Front Controller, and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.

Installing CakePHP via Composer

You can install CakePHP into your project using Composer. If you're starting a new project, we recommend using the app skeleton as a starting point. For existing applications you can run the following:

composer require cakephp/cakephp

For details on the (minimum/maximum) PHP version see version map.

Running Tests

Assuming you have PHPUnit installed system wide using one of the methods stated here, you can run the tests for CakePHP by doing the following:

  1. Copy phpunit.xml.dist to phpunit.xml.
  2. Add the relevant database credentials to your phpunit.xml if you want to run tests against a non-SQLite datasource.
  3. Run phpunit.

Some Handy Links

  • CakePHP - The rapid development PHP framework.
  • CookBook - The CakePHP user documentation; start learning here!
  • API - A reference to CakePHP's classes.
  • Awesome CakePHP - A list of featured resources around the framework.
  • Plugins - A repository of extensions to the framework.
  • The Bakery - Tips, tutorials and articles.
  • Community Center - A source for everything community related.
  • Training - Join a live session and get skilled with the framework.
  • CakeFest - Don't miss our annual CakePHP conference.
  • Cake Software Foundation - Promoting development related to CakePHP.

Get Support!

  • Slack - Join us on Slack.
  • Discord - Join us on Discord.
  • #cakephp on irc.freenode.net - Come chat with us, we have cake.
  • Forum - Official CakePHP forum.
  • GitHub Issues - Got issues? Please tell us!
  • Roadmaps - Want to contribute? Get involved!

Contributing

Security

If you’ve found a security issue in CakePHP, please use the procedure described in SECURITY.md.

api_generator's People

Contributors

josegonzalez avatar jrbasso avatar lorenzo avatar luku avatar markstory avatar predominant avatar renan avatar simoneast avatar thatcode avatar yandod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api_generator's Issues

ApiGeneratorController could not be found - CakePHP 1.3

Created by David Suna, 30th Aug 2012. (originally Lighthouse ticket #91):


I installed the api generator and ran the initdb, configuration and build index. However, when I try to go to see the output via /api_generator/api_classes I get an error that the ApiGeneratorController could not be found. What do I have to do to see the output?

<em> instead of italic in sub-branches

Created by Konrad Stobiecki, 30th Nov 2011. (originally Lighthouse ticket #55):


Hi!
In unordered lists:

- level 1 - _ comment _ : displays _comment_ (in italics)
  - level 2 - _ comment _ : displays < em > comment < /em > (instead italics)
    - level 3,4 and so on - _ comment _ : displays something like ..lt..amp..em> comment ...lt ..amp ../em>

Regards,
Konrad

Can't initialize database

Created by Morten Flydahl, 16th Jan 2013. (originally Lighthouse ticket #109):


Hi,
Maybe I've stared myself blind on this, but I just can't seem to get it to work. I'm fairly new to CakePHP.

I've put the plugin in the right directory; "app/Plugin/ApiGenerator", with sub-dirs Config, Console, Controller etc.

Now, when trying to run "Console\cake ApiGenerator.ApiIndex initdb" from my app directory, the only thing that happens is that it lists the html- and php-code from a view-file in my project. Nothing else.

When I run just "cake" from my app/Console directory, it list the available shells. ApiIndex is not one of them.

I've put this in bootstrap.php:
"CakePlugin::load('ApiGenerator');"

Any help would be appreciated.

Edit: Figured it out. As always with Linux :p , it was the file permissions. This was a CIFS-mount with wrong permissions in /etc/fstab.

paths on windows

Created by dogmatic69, 27th Jan 2010. (originally Lighthouse ticket #11):


been trying to generate some api for a while and thought there was a problem with the paths...

after some debugging, it seems the problem is in the set up script. Its creating a path like c:my\path and it should be c:\my\path after i added the \ it seems to be working as expexted

ApiDocHelper::fileLink returns wrong url on Operating Systems that use "\" as DS

Created by Frank Förster, 25th Aug 2012. (originally Lighthouse ticket #88):


What to expect

On an OS that uses the backslash "" as directory separator, the fileLink helper function of the ApiDoc Helper should return a link like this:

http://path_to_cake_app/file/Controller/AppController.php

What happened

Instead it returns the links like this:

http://path_to_cake_app/file/Controller\AppController.php

What I did

Replace the backslash with forward slash after line 122

$trimmedFile = preg_replace('/\\\/', '/', $trimmedFile);

mysql syntax error running update via shell

Created by luke83, 8th Jan 2013. (originally Lighthouse ticket #108):


I'm using ApiGenerator plugin with cakephp 2.2.3.

When i do:

[server]$ cake ApiGenerator.api_index initdb

all things are ok, i checked in db the tables drop and creation are ok, so db config should be ok..

showfiles also work great

then, when i try to update i got this:

[server]$ cake ApiGenerator.api_index update
Clearing index and regenerating class index...
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fantaclick_v2`.`fc_api_classes``' at line 1
#0 ***/cake/lib/Cake/Model/Datasource/DboSource.php(459): PDOStatement->execute(Array)
#1 ***/cake/lib/Cake/Model/Datasource/DboSource.php(425): DboSource->_execute('TRUNCATE TABLE ...', Array)
#2 ***/cake/lib/Cake/Model/Datasource/DboSource.php(2041): DboSource->execute('TRUNCATE TABLE ...')
#3 ***/dev/plugins/api_generator/Model/ApiGeneratorAppModel.php(47): DboSource->truncate('`fantaclick_v2`...')
#4 ***/dev/plugins/api_generator/Console/Command/ApiIndexShell.php(131): ApiGeneratorAppModel->clearIndex()
#5 ***/cake/lib/Cake/Console/Shell.php(390): ApiIndexShell->update()
#6 ***/cake/lib/Cake/Console/ShellDispatcher.php(201): Shell->runCommand('update', Array)
#7 ***/cake/lib/Cake/Console/ShellDispatcher.php(69): ShellDispatcher->dispatch()
#8 ***/cake/lib/Cake/Console/cake.php(43): ShellDispatcher::run(Array)
#9 {main}

what's wrong? any suggestions?

thanks for time!!!

Plugin ApiGenerator could not be found.

Created by Kim Escobar, 20th May 2013. (originally Lighthouse ticket #131):


Below is the error I'm getting...
The directory of api generator (api_generator) is the plugins that is in the same directory as the lib...and I have another copy in the directory Plugin inside the app directory.
I already read many tickets and try every thing...I just don't know what else to do.
If some one could help I would be very pleased.

C:\wamp\www\pesquisaVibe\app>cake api_generator.api_index initdb
Error: Plugin ApiGenerator could not be found.
#0 C:\wamp\www\cake\lib\Cake\Core\App.php(365): CakePlugin::path('ApiGenerator')

#1 C:\wamp\www\cake\lib\Cake\Core\App.php(226): App::pluginPath('ApiGenerator')
#2 C:\wamp\www\cake\lib\Cake\Core\App.php(543): App::path('Console/Command', 'Ap
iGenerator')
#3 [internal function]: App::load('ApiIndexShell')
#4 [internal function]: spl_autoload_call('ApiIndexShell')
#5 C:\wamp\www\cake\lib\Cake\Console\ShellDispatcher.php(240): class_exists('Api
IndexShell')
#6 C:\wamp\www\cake\lib\Cake\Console\ShellDispatcher.php(190): ShellDispatcher->
_getShell('api_generator.a...')
#7 C:\wamp\www\cake\lib\Cake\Console\ShellDispatcher.php(68): ShellDispatcher->d
ispatch()
#8 C:\wamp\www\cake\app\Console\cake.php(37): ShellDispatcher::run(Array)
#9 {main} 

Rebuild how classes are indexed

Created by Mark Story, 11th Dec 2010. (originally Lighthouse ticket #34):


Right now classes are indexed using some mildly hacky regular expressions. It would be a big improvement to use token_get_all() and parse the token stream for class, interface, global function definitions and build the index that way. This would also allow for dependencies to be mapped as well. By looking for extends or implements a full dependency graph could be constructed.

This would have two main benefits. It would allow for ApiGenerator to work on non-cake apps more effectively. Currently its kind of a kludge to get it to work on non-cake apps. It would also allow for neat things like visual graphs to be created with tools like graphviz or canvas.

The indexing process could look something like.

  • Get a list of files to scan.
  • Iterate the list of files and do the following.
    • Scan for class, interface and global functions. Store these in a list of files -> objects
    • Get the extends and implements for any classes. Store these in parent -> children arrays.
    • Create a tree of class dependencies.
    • Traverse the tree and persist values to the database.
  • Having a more complete index, would also make doing things like creating a word index of the doc blocks / methods easier.

Plugin layout overrides app layout : difficult to integrate properly the plugin in an existant application

Created by Predominant, 12th Dec 2009. (originally Lighthouse ticket #2):


(Reported by: scharrier)

As there's a default.ctp file in the plugin layout's directory, it's not actually possible to integrate properly (= with same design) the api_generator as a module in an existant application, without modifying his layout.
I think it would be better to include the .js, .css and menus directly in the views (not inline), in order to delete default.ctp. Integration with existing dev environnement would be better ! For an example, we actually have a dev environment, with functionnals tests, user documentation wiki, unit tests reports, and API doc, in the same app (so with the same menu in every pages, same design, etc ...). We just want all our plugins to use the same design and navigation schema !
Thanks a lot for your answer :-) Sébastien Charrier

initdb making wrong schema call?

Created by Kevin van Zonneveld, 22nd Sep 2010. (originally Lighthouse ticket #30):


Hi guys.

Just tried out api_generator but couldn't get it to work.
When running:

[kevin`@dev` /app/cakephp/cake/console (master +)]$ ./cake api_index initdb

I get:

Welcome to CakePHP v1.2.6 Console
---------------------------------------------------------------
App : app
Path: /app/cakephp/app
---------------------------------------------------------------
Cake Schema Shell
---------------------------------------------------------------
The Schema Shell generates a schema object from
the database and updates the database from the schema.
---------------------------------------------------------------
Usage: cake schema <command> <arg1> <arg2>...
---------------------------------------------------------------
Params:

    -connection <config>
        set db config <config>. uses 'default' if none is specified

    -path <dir>
        path <dir> to read and write schema.php.
        default path: /app/cakephp/app/config/sql

    -name <name>
        classname to use.

    -file <name>
        file <name> to read and write.
        default file: api_generator.php

    -s <number>
        snapshot <number> to use for run.

    -dry
        Perform a dry run on 'run' commands.
        Queries will be output to window instead of executed.

    -f
        force 'generate' to create a new schema.
Commands:

    schema help
        shows this help message.

    schema view
        read and output contents of schema file

    schema generate
        reads from 'connection' writes to 'path'
        To force generation of all tables into the schema, use the -f param.
        Use 'schema generate snapshot <number>' to generate snapshots
        which you can use with the -s parameter in the other operations.

    schema dump <filename>
        Dump database sql based on schema file to <filename>. 
        If <filename> is write, schema dump will be written to a file
        that has the same name as the app directory.

    schema run create <schema> <table>
        Drop and create tables based on schema file
        optional <schema> arg for selecting schema name
        optional <table> arg for creating only one table
        pass the -s param with a number to use a snapshot
        To see the changes, perform a dry run with the -dry param

    schema run update <schema> <table>
        alter tables based on schema file
        optional <schema> arg for selecting schema name.
        optional <table> arg for altering only one table.
        To use a snapshot, pass the -s param with the snapshot number
        To see the changes, perform a dry run with the -dry param

Looks like it's making an invalid call to schema?
I'm using Cake 1.2.6 and checked out master of http://github.com/cakephp/api_generator in app/plugins/(api_generator)

When I run:

./cake api_index

I do get a valid shell:

Api Generator Class Index Generation
---------------------------------------------------------------
Available commands:
  initdb
    Create the schema used for the Api Generator Plugin
  showfiles
    Show the list of files that will be parsed for classes based on your configuration.
    Use to check if your config is going to parse the files you want.
  update
    Clear the existing class index and regenerate it.
  set_routes
    Add routes for Api generator to your routes file.
  users
    View list of users, and create new ones.

Broken links at /api_generator/api_files/files

Created by Bancer, 13th Sep 2012. (originally Lighthouse ticket #94):


The method produces broken links on Windows
public function fileLink($filename, $url = array(), $attributes = array()) {
$url = array_merge($this->_defaultUrl['file'], $url);
$trimmedFile = $this->trimFileName($filename);
if (!empty($trimmedFile) && $trimmedFile != $filename) {
$url = array_merge($url, explode('/', $trimmedFile));
return $this->Html->link($trimmedFile, $url, $attributes);
}
return $filename;
}

Therefore it must to be corrected:

public function fileLink($filename, $url = array(), $attributes = array()) {
    $url = array_merge($this->_defaultUrl['file'], $url);
    $trimmedFile = $this->trimFileName($filename);
    if (!empty($trimmedFile) && $trimmedFile != $filename) {
        $url = array_merge($url, explode(DIRECTORY_SEPARATOR, $trimmedFile));
        return $this->Html->link($trimmedFile, $url, $attributes);
    }
    return $filename;
}

Empty API pages

Created by Marc Würth, 2nd Feb 2013. (originally Lighthouse ticket #112):


Files like /Cake/Console/Templates/skel/Config/core.php contain quite some amount of useful comments about possible configurations.
I know there is a cookbook page about these config settings at http://book.cakephp.org/2.0/en/development/configuration.html#cakephp-core-configuration, which is more (or rather less) a duplication of the comments in core.php.
But why are files like these (http://api.cakephp.org/file/Cake/Console/Templates/skel/Config/core.php) in the API docs totally blank? I know these files aren't really part of the API as they aren't classes.
I'd love to be able to search for those comments in the API docs nonetheless. But if tthey aren't meant to be shown in the online api docs then I think being able to navigate through them is kind of obsolete...

As it seems you currently aren't really happy about the state of the docs (http://cakephp.lighthouseapp.com/projects/42879/tickets/111-some-api-pages-return-404). So I guess this is more like an improvement for the future than something that has to be fixed...

Database config not found with task DbConfig

Created by primeminister, 5th Jun 2010. (originally Lighthouse ticket #24):


I have a separate database.local.php file which is included in the app/config/database.php
When I run api_index initdb it is generating the databse tables real fine, but when I call 'update' then it gives me a db table not found error:
Clearing index and regenerating class index...
Error: Missing database table 'api_classes' for model 'ApiClass'

Cache prevents setup / update.

Created by Greg Morgan, 9th May 2011. (originally Lighthouse ticket #46):


On setup, calling "cake api_index update" resulted in "Missing database table 'api_classes' for model 'ApiClass'" until I deleted the files in .../cache/model.

Add footer information detailing revision of generated docs (if applicable)

Created by Predominant, 12th Dec 2009. (originally Lighthouse ticket #3):


It would be super neat if the api generator included (somewhere out of the way like down in the footer) some meta information about the code that was used to generate the docs including versioning information.
For example, if there is a .svn directory or a .git directory hanging around that can be investigated (or any other versioning mechanism that you want to support), it will use that. Fall back on a configurable version number that would need to be manually edited to include a version number if desired. If no versioning information is supplied, adn the version information is not specifically provided, show nothing.

This will be handy when you are dealing with various versions of code that provide differing implementation.

api_index update errors when using table prefix

Created by Bernard Bondos, 28th Nov 2010. (originally Lighthouse ticket #33):


When running api_index update in a app that's using db table prefix, truncate errors shows up:

PHP Warning: SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ion_api_classes``' at line 1 in /home/dire.pl/www/api.dire.pl/htdocs/ion/cake/libs/model/datasources/dbo_source.php on line 684

Warning: SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ion_api_classes``' at line 1 in /home/dire.pl/www/api.dire.pl/htdocs/ion/cake/libs/model/datasources/dbo_source.php on line 684

Query: TRUNCATE TABLE `ion_`ion_api_classes``

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.