Class sfDoctrineRouteCollection not found - php

I'm starting a new project using SF 1.4.18 and sfDoctrine & sfDoctrineGuard plugins. I had both active at config/ProjectConfiguration.class.php as follow:
public function setup() {
$this->enablePlugins(
array(
'sfDoctrinePlugin',
'sfDoctrineGuardPlugin'
)
);
}
All is good so far but when I try to reach the URL http://inventario.devserver/backend_dev.php/sfGuardUser this error come up:
Fatal error: Class 'sfDoctrineRouteCollection' not found in /var/www/html/inventario
/plugins/sfDoctrineGuardPlugin/lib/routing/sfGuardRouting.class.php on line 59
I don't know what's causing the error because I follow every step at plugins docs. Any help or advice?

Symfony 1.4 is shipped with sfDoctrinePlugin. You shouldn't add the plugin on your own.
Remove the folder sfDoctrinePlugin from your /plugins folder, clear your cache and it will solve your issue.
It's exactly the same problem from this guy, on the official Symfony forum, in 2009.

Related

CakePHP 3.0 not running on other machines

I've developed a small project on a machine, using CakePHP 3.0, and I need it to run on another machine. I've tried to install it on several other machines.
If I run the composer to install the CakePHP 3.0, then I copy my stuff to overwrite it, the project works. I've tried this on two machines and had no problem so far. If I don't run the composer, and just copy the stuff to the target machine, it gives me the following error. I've tried this on 3 machines, and every machine gives me this:
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
I've copied the whole project to this server to test.
I told you this because I thought it has something to do with my problem. The point is that I have to run this on a machine that is not mine, and I can't install composer on it. The /public_html/vendor/cakephp/cakephp/src/I18n/ has files related to internationalization and localization, but my project will never be translated, so a workaround to make the project ignore those files would be enough to solve my problem.
The following code is an excerpt from the (...)/I18n/I18n.php that might be relevant:
<?php
namespace Cake\I18n;
use Aura\Intl\FormatterLocator;
use Aura\Intl\PackageLocator;
use Aura\Intl\TranslatorFactory;
use Cake\I18n\Formatter\IcuFormatter;
use Cake\I18n\Formatter\SprintfFormatter;
use Locale;
class I18n {
// lots of code here
public static function defaultLocale() {
if (static::$_defaultLocale === null) {
static::$_defaultLocale = Locale::getDefault() ?: 'en_US';
// the line above is the Line 229
}
return static::$_defaultLocale;
}
// many code here too
}
I've checked that another file also tries to access this Locale class, but I don't know if there are other files trying to access it as well. Many files from everywhere inside the project tries to access methods from I18n.php. I need it running but I can't figure out how to make it run.
Any help will be greatly appreciated.
As I just found out, prior to CakePHP 3.0, the installation must be done by composer, as stated in the 3.0 migration guide:
CakePHP should be installed with Composer
Since CakePHP can no longer easily be installed via PEAR, or in a shared
directory, those options are no longer supported. Instead you should use
Composer to install CakePHP into your application.
So it won't run on regular free web hosting services.

Symfony2 + psliwa PHPPdf

I have installed pdliwa PHPPdf in my Symfony2, I was testing the examples in the route \vendor\psliwa\php-pdf\examples and all worked fine except one.
The one that isnt working is barcode.xml. When I try to test it this error msg appear:
FatalErrorException: Error: Class 'Zend\Barcode\Object\Code128' not found in
C:\xampp\htdocs\Symfony\vendor\psliwa\php-pdf\lib\PHPPdf\Core\Node\Barcode.php line 175
I have zendframework in my vendor folder.
Anyone knows whats the problem?
You have to update your composer.json file, adding zend-barcode and zend-validator (which is required by zend-barcode). Then it works.

removing reference to googlesitemaps in silverstripe

I've recently moved a silverstripe site to a new server. Since then it's bringing up the error:
Fatal error: Class 'SiteTreeDecorator' not found in /home/priorysc/public_html/googlesitemaps/code/GoogleSitemapDecorator.php on line 9
I try removing the googlesitemaps folder, but then it just brings up the error that it can't find the googlesitemaps _config file. Is there any way I can remove the reference to googlesitemaps, or failing that just get the thing to work?
I'm a fairly verse php coder but I don't know that much about silverstripe as it's just been dumped on me.
Anyone know? I'm tearing my hair out over this!
-James
SiteTreeDecorator was a class that existed in v2.4 of SilverStripe, the fact that the error is saying it doesn't exist tells me you're running v3.0 or higher. Double check which version of SilverStripe you're running, then update the 'googlesitemaps' module to the appropriate version:
SilverStripe v3.0: https://github.com/silverstripe-labs/silverstripe-googlesitemaps/tree/1.1
SilverStripe v3.1: https://github.com/silverstripe-labs/silverstripe-googlesitemaps/tree/master

How to load plugin files in cakephp 2.0

I am using linkedin plugin for my app. It was working fine for cakephp 1.3. I migrated to cakephp 2.x. I understand you need to load plugins like this
CakePlugin::load('Linkedin');
It worked. But in my plugin folder I have vendor folder. It is loaded using
App::import('Vendor', 'Linkedin.oauth', array('file' => 'OAuth' . DS . 'oauth_consumer.php'));
But it says cannot find oauth_consumer.
I appreciate any help.
*UPDATED *
I have added linkedin plugin to my app. I have loaded my plugin using CakePlugin::load('Linkedin');. Now I get error
Fatal error: Call to a member function get() on a non-object in ....\Controller\Component\LinkedinComponent.php on line 95
On line 95 of Linkedin component this is what is there
$consumer = $this->_createConsumer();
$result = $this->Consumer->get($key, $secret, $this->apiPath . $path);
It says the get method is not found on linkedincomponent. But the get method is in oauth_consumer.php.
I appreciate all your help
The plugin is not 2.x ready.
You will have to upgrade it yourself.
You could have easily figured that out looking at the folders and files.
In 2.x it would be
/Linkedin/Controller/Component/LinkedinComponent.php
etc (also note the casing which is important in 2.x)
Most likely you can use the above upgrade shells to do that and make the plugin 2.x compatible.

admin generator doesn't generate a class

Hi
I'm using symfony 1.2.7 with Doctrine.
Tryng to port a plugin originally written with Propel, but running into problems.
In one of the plugins modules the generator.yml starts like:
generator:
class: sfDoctrineGenerator
param:
model_class: Page
theme: admin
I always get "Fatal error: Class 'cmsPageGeneratorConfiguration' not found in .../cache/backend/dev/modules/autoCmsPage/actions/actions.class.php on line 18" I googled on it, but unlike my case anybody else seems like to missing the Base*GeneratorConfiguration class which is in it's place for me.
If i write something else to the theme directive the error goes away but the config is ignored, and the default forms and lists are shown, can't set even a title...
Why isn't the missing class auto-generated as it's supposed? I'm really stuck here, thanks in advance for any help.
I'm not familiar with this SF version, but did you try to clear the cache?
php symfony cc
This worked for me with similar error messages.

Categories