What are the best practices for NoSQL Databases, OODBs or whatever other acronyms may exist for them?
For example, I've often seen a field "type" being used for deciding how the DB document (in couchDB/mongoDB terms) should be interpreted by the client, the application.
Where applicable, use PHP as a reference language. Read: I'm also ...
Some of the new PHP 5.3 features, including namespaces and anonymous functions, are not compatible with PHPDocumentor, even with the latest release. For example, it just raises an error when it encounters "a function with no name", i.e. a closure. So, are there any other open-source tools that generate API documentation (preferably in HT...
I always strive to increase my productivity when developing applications and in the span of the last few years, I can say that I have made good steps towards increasing that productivity, but I still find I need more tools or methods. I need to edit faster and learn touch typing (currently in the process) and therefore I find a need to m...
Hi all,
I'm having problems with the glob:// stream wrapper included in the PHP 5.3.0 version. I'm using the following PHP version:
PHP 5.3.1-0.dotdeb.1 with
Suhosin-Patch (cli) (built: Dec 5
2009 20:08:29) Copyright (c)
1997-2009 The PHP Group Zend Engine
v2.3.0, Copyright (c) 1998-2009 Zend
Technologies
When I try to...
Assuming I have the following classes in different files:
<?php
namespace MyNS;
class superclass {
public function getNamespace(){
return __NAMESPACE__;
}
}
?>
<?php
namespace MyNS\SubNS;
class childclass extends superclass { }
?>
If I instantiate "childclass" and call getNamespace()...
Autocompleter has a required option - url. Problem is, it is used in Form.class where neither url_for() nor $this->getController()->genUrl() works. All the examples I saw use url as literal string, i.e.
$options = array('Model' => 'Model', 'url' => '/path');
Maybe I'm getting something wrong, but I believe writing urls as string is no...
Is there a way in PHP 5.3 to get crypt() blowfish (salt starting with $2a$) results identical to those generated by PHP 5.2? In 5.3, Zend implements all encryption algorithms internally, thus producing different results. Also, in 5.3, blowfish needs a cost parameter.
Basically, is there a way to call whatever system mechanisms were used...
php -v gives this
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP compiled wi...
I'm wondering if this kind of thing will ever be possible in PHP (and whether it already is and I'm just missing something...)
<?php
function test() {
return array(
'id'=>10,
'name'=>'John'
);
}
echo 'Your name is: '.test()['name'];
?>
I'd really like to be able to use returned arrays directly instead of first assigning them ...
Hi All
I just installed php 5.3.1 in my linux server and now my old work which i used to write with tags is not working at all..
Please help me out..
How can i resolve this??
...
I've tried integrating sfPHPOpenIdPlugin but that hit a dead-end since it's built for Symfony 1.2 and relies on deprecated PHP functionality; I also had a go with sfGoogleLoginPlugin which did authenticate correctly but lacks extended capability to retrieve user details (+ would restrict me to Google; obviously).
I'm thinking the most v...
I have a library that I have been using successfully with PHP 5.1.6 with the help of some wrapper code generated by SWIG (v1.3.40).
I have just upgraded to PHP 5.3.2 and I am seeing the following error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/myLib_php.so' - /usr/lib/php/modules/myLib_php.so: und...
I'm attempting to throw an exception using php 5.3.2 and it is giving me the following error:
Parse error: syntax error, unexpected T_THROW
I am attempting to throw an exception the following way:
throw new Exception('Property ' . $name . ' doesn\'t exist in class Index', '');
Edit: I also tried
throw new Exception('Property ' . $n...
Hi
I've been testing nuSoap with codeIgniter (PHP Framework) but seems nuSoap isn't prepared to work with latest php 5.3, even if I download a patched nusoap version for php 5.3
I have the following code:
require_once(APPPATH.'libraries/NuSOAP/lib/nusoap'.EXT); //includes nusoap
$n_params = array('CityName' => 'San Juan', 'CountryName'...
If I iterate through an array twice, once by reference and then by value, PHP will overwrite the last value in the array if I use the same variable name for each loop. This is best illustrated through an example:
$array = range(1,5);
foreach($array as &$element)
{
$element *= 2;
}
print_r($array);
foreach($array as $element) { }
print...
In PHP 5.2.3, "fdopen" was used to read/write to a file descriptor that's opened by another application.
fdopen(<fileDescriptorId>,"rw"); //It worked fine with PHP 5.2.3
After upgrading PHP to 5.3.2, it's throwing "undefined reference to 'fdopen' function".
Please suggest whats the replacement for this in PHP 5.3.2 or any workaround...
I'm no stranger to __get(), and have used it to make some very convenient libraries in the past. However, I'm faced with a new challenge (PHP 5.3, abbreviated and simplified my code for this question):
<?php
namespace test;
class View {
function __construct($filename, $varArray) {
$this->filename = $filename;
$this...
I'm looking for the get_called_class() equivalent for __FILE__ ... Maybe something like get_included_file()?
I have a set of classes which would like to know what directory they exist in. Something like this:
<?php
class A {
protected $baseDir;
public function __construct() {
$this->baseDir = dirname(__FILE__);
}...
Hi! How can I set up routing in symfony to be like that(if one rule won't work, next should be grabbed):
/controller/action/param/param/param/...
/admin/controller/action/param/param/param/... ("admin" is constant here - name of the bundle)
I tried that:
homepage:
pattern: /
defaults: { _bundle: HelloBundle, _contr...
Hi, I'm having the same problem as this guy with the application I'm writing right now. The problem is that static properties are not being inherited in subclasses, and so if I use the static:: keyword in my main class, it sets the variable in my main class as well.
It works if I redeclare the static variables in my subclass, but I expe...