Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit - short README, test project, LICENSE, .gitignore.

  • Loading branch information...
commit ab2e948cab8fc82dc1ab54e8060b7555b2151025 0 parents
@weaverryan authored
Showing with 381 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +7 −0 LICENSE
  3. +20 −0 README
  4. +63 −0 package.xml.tmpl
  5. +8 −0 test/bin/prove.php
  6. +21 −0 test/bootstrap/functional.php
  7. +30 −0 test/bootstrap/unit.php
  8. +5 −0 test/fixtures/project/apps/frontend/config/app.yml
  9. +7 −0 test/fixtures/project/apps/frontend/config/cache.yml
  10. +42 −0 test/fixtures/project/apps/frontend/config/factories.yml
  11. +10 −0 test/fixtures/project/apps/frontend/config/filters.yml
  12. +8 −0 test/fixtures/project/apps/frontend/config/frontendConfiguration.class.php
  13. +16 −0 test/fixtures/project/apps/frontend/config/routing.yml
  14. +5 −0 test/fixtures/project/apps/frontend/config/security.yml
  15. +35 −0 test/fixtures/project/apps/frontend/config/settings.yml
  16. +20 −0 test/fixtures/project/apps/frontend/config/view.yml
  17. +5 −0 test/fixtures/project/apps/frontend/lib/myUser.class.php
  18. +14 −0 test/fixtures/project/apps/frontend/templates/layout.php
  19. +18 −0 test/fixtures/project/config/ProjectConfiguration.class.php
  20. +4 −0 test/fixtures/project/config/properties.ini
  21. +15 −0 test/fixtures/project/config/rsync_exclude.txt
  22. +13 −0 test/fixtures/project/lib/form/BaseForm.class.php
  23. +14 −0 test/fixtures/project/symfony
1  .gitignore
@@ -0,0 +1 @@
+test/fixtures/project/cache
7 LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2010 Ryan Weaver
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 README
@@ -0,0 +1,20 @@
+ioDoctrineMenuPlugin
+====================
+
+Adds a Doctrine menu model with admin area. The menu model, ioDoctrineMenuItem,
+is used as a datasource for ioMenuItem objects from the ioMenuPlugin.
+
+Easily retrieve menu trees that are stored in the database:
+
+ $menu = Doctrine_Core::getTable('ioDoctrineMenuItem')->retrieveMenu('root-slug');
+
+Or create menu items and persist them to the database.
+
+ $menu = new ioMenuItem('root', '@homepage');
+ $menu->addChild('Sympal', 'http://www.sympalphp.org');
+ $menu->addChild('Account', '@account')
+ ->requiresAuth(true)
+ ->setCredentials('ManageAccount');
+
+ // persist the menu to the database
+ Doctrine_Core::getTable('ioDoctrineMenuItem')->persistMenu($menu);
63 package.xml.tmpl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.4.1" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+ <name>ioDoctrineMenuPlugin</name>
+ <channel>pear.symfony-project.com</channel>
+ <summary>Powerful Doctrine menu model that uses ioMenuPlugin to generate powerful, customizable menu items.</summary>
+ <description>Powerful Doctrine menu model that uses ioMenuPlugin to generate powerful, customizable menu items.</description>
+ <lead>
+ <name>Ryan Weaver</name>
+ <user>weaverryan</user>
+ <email>ryan@thatsquality.com</email>
+ <active>yes</active>
+ </lead>
+ <date>##CURRENT_DATE##</date>
+ <version>
+ <release>##PLUGIN_VERSION##</release>
+ <api>##API_VERSION##</api>
+ </version>
+ <stability>
+ <release>##STABILITY##</release>
+ <api>##STABILITY##</api>
+ </stability>
+ <license uri="http://www.symfony-project.org/license">MIT license</license>
+ <notes>-</notes>
+ <contents>
+ ##CONTENTS##
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.2.4</min>
+ </php>
+ <pearinstaller>
+ <min>1.4.1</min>
+ </pearinstaller>
+ <package>
+ <name>symfony</name>
+ <channel>pear.symfony-project.com</channel>
+ <min>1.3.0</min>
+ <max>1.5.0</max>
+ <exclude>1.5.0</exclude>
+ </package>
+ </required>
+ </dependencies>
+ <phprelease></phprelease>
+ <changelog>
+ <release>
+ <version>
+ <release>0.8.0</release>
+ <api>0.8.0</api>
+ </version>
+ <stability>
+ <release>beta</release>
+ <api>beta</api>
+ </stability>
+ <license uri="http://www.symfony-project.com/license">MIT license</license>
+ <date>2010-05-29</date>
+ <license>MIT</license>
+ <notes>
+ Initial release of the plugin - young, but well-tested and simple.
+ </notes>
+ </release>
+ </changelog>
+</package>
8 test/bin/prove.php
@@ -0,0 +1,8 @@
+<?php
+
+include dirname(__FILE__).'/../bootstrap/unit.php';
+
+$h = new lime_harness(new lime_output_color());
+$h->register(sfFinder::type('file')->name('*Test.php')->in(dirname(__FILE__).'/..'));
+
+exit($h->run() ? 0 : 1);
21 test/bootstrap/functional.php
@@ -0,0 +1,21 @@
+<?php
+
+if (!isset($app))
+{
+ $app = 'frontend';
+}
+
+require_once $_SERVER['SYMFONY'].'/autoload/sfCoreAutoload.class.php';
+sfCoreAutoload::register();
+
+function ioDoctrineMenuPlugin_cleanup()
+{
+ sfToolkit::clearDirectory(dirname(__FILE__).'/../fixtures/project/cache');
+ sfToolkit::clearDirectory(dirname(__FILE__).'/../fixtures/project/log');
+}
+ioDoctrineMenuPlugin_cleanup();
+register_shutdown_function('ioDoctrineMenuPlugin_cleanup');
+
+require_once dirname(__FILE__).'/../fixtures/project/config/ProjectConfiguration.class.php';
+$configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true);
+sfContext::createInstance($configuration);
30 test/bootstrap/unit.php
@@ -0,0 +1,30 @@
+<?php
+
+if (!isset($_SERVER['SYMFONY']))
+{
+ throw new RuntimeException('Could not find symfony core libraries.');
+}
+
+require_once $_SERVER['SYMFONY'].'/autoload/sfCoreAutoload.class.php';
+sfCoreAutoload::register();
+
+$configuration = new sfProjectConfiguration(dirname(__FILE__).'/../fixtures/project');
+require_once $configuration->getSymfonyLibDir().'/vendor/lime/lime.php';
+
+function ioDoctrineMenuPlugin_autoload_again($class)
+{
+ $autoload = sfSimpleAutoload::getInstance();
+ $autoload->reload();
+ return $autoload->autoload($class);
+}
+spl_autoload_register('ioDoctrineMenuPlugin_autoload_again');
+
+if (file_exists($config = dirname(__FILE__).'/../../config/ioDoctrineMenuPluginConfiguration.class.php'))
+{
+ require_once $config;
+ $plugin_configuration = new ioDoctrineMenuPluginConfiguration($configuration, dirname(__FILE__).'/../..', 'ioDoctrineMenuPlugin');
+}
+else
+{
+ $plugin_configuration = new sfPluginConfigurationGeneric($configuration, dirname(__FILE__).'/../..', 'ioDoctrineMenuPlugin');
+}
5 test/fixtures/project/apps/frontend/config/app.yml
@@ -0,0 +1,5 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/11-App
+
+# default values
+#all:
7 test/fixtures/project/apps/frontend/config/cache.yml
@@ -0,0 +1,7 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/09-Cache
+
+default:
+ enabled: false
+ with_layout: false
+ lifetime: 86400
42 test/fixtures/project/apps/frontend/config/factories.yml
@@ -0,0 +1,42 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/05-Factories
+
+prod:
+ logger:
+ class: sfNoLogger
+ param:
+ level: err
+ loggers: ~
+
+test:
+ storage:
+ class: sfSessionTestStorage
+ param:
+ session_path: %SF_TEST_CACHE_DIR%/sessions
+
+ response:
+ class: sfWebResponse
+ param:
+ send_http_headers: false
+
+ mailer:
+ param:
+ delivery_strategy: none
+
+dev:
+ mailer:
+ param:
+ delivery_strategy: none
+
+all:
+ routing:
+ class: sfPatternRouting
+ param:
+ generate_shortest_url: true
+ extra_parameters_as_query_string: true
+
+ view_cache_manager:
+ class: sfViewCacheManager
+ param:
+ cache_key_use_vary_headers: true
+ cache_key_use_host_name: true
10 test/fixtures/project/apps/frontend/config/filters.yml
@@ -0,0 +1,10 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/12-Filters
+
+rendering: ~
+security: ~
+
+# insert your own filters here
+
+cache: ~
+execution: ~
8 test/fixtures/project/apps/frontend/config/frontendConfiguration.class.php
@@ -0,0 +1,8 @@
+<?php
+
+class frontendConfiguration extends sfApplicationConfiguration
+{
+ public function configure()
+ {
+ }
+}
16 test/fixtures/project/apps/frontend/config/routing.yml
@@ -0,0 +1,16 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/10-Routing
+
+# default rules
+homepage:
+ url: /
+ param: { module: default, action: index }
+
+# generic rules
+# please, remove them by adding more specific rules
+default_index:
+ url: /:module
+ param: { action: index }
+
+default:
+ url: /:module/:action/*
5 test/fixtures/project/apps/frontend/config/security.yml
@@ -0,0 +1,5 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/08-Security
+
+default:
+ is_secure: false
35 test/fixtures/project/apps/frontend/config/settings.yml
@@ -0,0 +1,35 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/04-Settings
+
+prod:
+ .settings:
+ no_script_name: off
+ logging_enabled: false
+
+dev:
+ .settings:
+ error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
+ web_debug: true
+ cache: false
+ no_script_name: false
+ etag: false
+
+test:
+ .settings:
+ error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE)."\n" ?>
+ cache: false
+ web_debug: false
+ no_script_name: false
+ etag: false
+
+all:
+ .settings:
+ # Form security secret (CSRF protection)
+ csrf_secret: ioDoctrineMenuPlugin
+
+ # Output escaping settings
+ escaping_strategy: on
+ escaping_method: ESC_SPECIALCHARS
+
+ # Enable the database manager
+ use_database: ##USE_DATABASE##
20 test/fixtures/project/apps/frontend/config/view.yml
@@ -0,0 +1,20 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/13-View
+
+default:
+ http_metas:
+ content-type: text/html
+
+ metas:
+ #title: symfony project
+ #description: symfony project
+ #keywords: symfony, project
+ #language: en
+ #robots: index, follow
+
+ stylesheets: [main.css]
+
+ javascripts: []
+
+ has_layout: true
+ layout: layout
5 test/fixtures/project/apps/frontend/lib/myUser.class.php
@@ -0,0 +1,5 @@
+<?php
+
+class myUser extends sfBasicSecurityUser
+{
+}
14 test/fixtures/project/apps/frontend/templates/layout.php
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <?php include_http_metas() ?>
+ <?php include_metas() ?>
+ <?php include_title() ?>
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <?php include_stylesheets() ?>
+ <?php include_javascripts() ?>
+ </head>
+ <body>
+ <?php echo $sf_content ?>
+ </body>
+</html>
18 test/fixtures/project/config/ProjectConfiguration.class.php
@@ -0,0 +1,18 @@
+<?php
+
+if (!isset($_SERVER['SYMFONY']))
+{
+ throw new RuntimeException('Could not find symfony core libraries.');
+}
+
+require_once $_SERVER['SYMFONY'].'/autoload/sfCoreAutoload.class.php';
+sfCoreAutoload::register();
+
+class ProjectConfiguration extends sfProjectConfiguration
+{
+ public function setup()
+ {
+ $this->setPlugins(array('ioDoctrineMenuPlugin'));
+ $this->setPluginPath('ioDoctrineMenuPlugin', dirname(__FILE__).'/../../../..');
+ }
+}
4 test/fixtures/project/config/properties.ini
@@ -0,0 +1,4 @@
+[symfony]
+ name=##PROJECT_NAME##
+ author=##AUTHOR_NAME##
+ orm=##ORM##
15 test/fixtures/project/config/rsync_exclude.txt
@@ -0,0 +1,15 @@
+# Project files
+/cache/*
+/log/*
+/web/*_dev.php
+/web/uploads/*
+
+# SCM files
+.arch-params
+.bzr
+_darcs
+.git
+.hg
+.monotone
+.svn
+CVS
13 test/fixtures/project/lib/form/BaseForm.class.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * Base project form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ * @version SVN: $Id: BaseForm.class.php 20147 2009-07-13 11:46:57Z FabianLange $
+ */
+class BaseForm extends sfFormSymfony
+{
+}
14 test/fixtures/project/symfony
@@ -0,0 +1,14 @@
+#!/usr/bin/env php
+<?php
+
+/*
+ * This file is part of the symfony package.
+ * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+chdir(dirname(__FILE__));
+require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php');
+include(sfCoreAutoload::getInstance()->getBaseDir().'/command/cli.php');
Please sign in to comment.
Something went wrong with that request. Please try again.