Index: ktaglib.cpp =================================================================== --- ktaglib.cpp (.../tags/RELEASE_0_2_0) +++ ktaglib.cpp (.../trunk) @@ -106,7 +106,9 @@ zend_object_value ktaglib_init_KTaglib_File_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { ze_ktaglib_file_object *intern; +#if PHP_VERSION_ID < 50399 zval *tmp; +#endif zend_object_value retval; intern = (ze_ktaglib_file_object*) emalloc(sizeof(ze_ktaglib_file_object)); @@ -116,18 +118,24 @@ intern->refcount = 1; zend_object_std_init(&intern->zo, class_type TSRMLS_CC); +#if PHP_VERSION_ID < 50399 zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - +#else + object_properties_init(&intern->zo, class_type); +#endif retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) ktaglib_init_KTaglib_File_free, NULL TSRMLS_CC); +/* Preventing object cloning is easier than creating the handlers for clone :) */ +#if PHP_VERSION_ID < 50399 retval.handlers = zend_get_std_object_handlers(); - - /* Preventing object cloning is easier than creating the handlers for clone :) */ retval.handlers->clone_obj = NULL; +#else + retval.handlers = &default_ktaglib_handlers; +#endif return retval; @@ -137,7 +145,9 @@ zend_object_value ktaglib_init_KTaglib_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { ze_ktaglib_object *intern; +#if PHP_VERSION_ID < 50399 zval *tmp; +#endif zend_object_value retval; intern = (ze_ktaglib_object*) emalloc(sizeof(ze_ktaglib_object)); @@ -148,8 +158,12 @@ intern->frame = NULL; zend_object_std_init(&intern->zo, class_type TSRMLS_CC); +#if PHP_VERSION_ID < 50399 zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); +#else + object_properties_init(&intern->zo, class_type); +#endif retval.handle = zend_objects_store_put(intern, NULL, @@ -156,8 +170,13 @@ (zend_objects_free_object_storage_t) ktaglib_init_KTaglib_free, NULL TSRMLS_CC); +#if PHP_VERSION_ID < 50399 retval.handlers = zend_get_std_object_handlers(); retval.handlers->clone_obj = NULL; +#else + retval.handlers = &default_ktaglib_handlers; +#endif + return retval; } @@ -176,6 +195,11 @@ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(ktaglib) { +#if PHP_VERSION_ID >= 50399 + memcpy(&default_ktaglib_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + default_ktaglib_handlers.clone_obj = NULL; +#endif + ktaglib_init_KTaglib_Exceptions(TSRMLS_C); ktaglib_init_KTaglib_MPEG_File(TSRMLS_C); ktaglib_init_KTaglib_Tag(TSRMLS_C); @@ -238,7 +262,7 @@ /* }}} */ /* {{{ ktaglib_functions[] */ -function_entry ktaglib_functions[] = { +zend_function_entry ktaglib_functions[] = { { NULL, NULL, NULL } }; /* }}} */ Index: tests/ogg/vorbis/audioproperties/getlength.phpt =================================================================== --- tests/ogg/vorbis/audioproperties/getlength.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/audioproperties/getlength.phpt (.../trunk) @@ -0,0 +1,13 @@ +--TEST-- +KTaglib_Ogg_Vorbis_AudioProperties::getLength() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getAudioProperties()->getLength()); +?> +--EXPECT-- +int(1) Property changes on: tests/ogg/vorbis/audioproperties/getlength.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/audioproperties/getbitrate.phpt =================================================================== --- tests/ogg/vorbis/audioproperties/getbitrate.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/audioproperties/getbitrate.phpt (.../trunk) @@ -0,0 +1,13 @@ +--TEST-- +KTaglib_Ogg_Vorbis_AudioProperties::getBitrate() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getAudioProperties()->getBitrate()); +?> +--EXPECT-- +int(29) Property changes on: tests/ogg/vorbis/audioproperties/getbitrate.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/audioproperties/getchannels.phpt =================================================================== --- tests/ogg/vorbis/audioproperties/getchannels.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/audioproperties/getchannels.phpt (.../trunk) @@ -0,0 +1,13 @@ +--TEST-- +KTaglib_Ogg_Vorbis_AudioProperties::getChannels() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getAudioProperties()->getChannels()); +?> +--EXPECT-- +int(1) Property changes on: tests/ogg/vorbis/audioproperties/getchannels.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/audioproperties/getsamplerate.phpt =================================================================== --- tests/ogg/vorbis/audioproperties/getsamplerate.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/audioproperties/getsamplerate.phpt (.../trunk) @@ -0,0 +1,13 @@ +--TEST-- +KTaglib_Ogg_Vorbis_AudioProperties::getSampleRate() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getAudioProperties()->getSampleRate()); +?> +--EXPECT-- +int(11025) Property changes on: tests/ogg/vorbis/audioproperties/getsamplerate.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/cow.ogg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/ogg Index: tests/ogg/vorbis/cow.ogg =================================================================== --- tests/ogg/vorbis/cow.ogg (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/cow.ogg (.../trunk) Property changes on: tests/ogg/vorbis/cow.ogg ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/ogg \ No newline at end of property Index: tests/ogg/vorbis/tag/artist.phpt =================================================================== --- tests/ogg/vorbis/tag/artist.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/artist.phpt (.../trunk) @@ -0,0 +1,18 @@ +--TEST-- +KTaglib_Ogg_Tag::setArtist() / KTaglib_Ogg_Tag::getArtist() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->setArtist(''); +$ktaglib->getTag()->setArtist('Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getArtist()); +?> +--EXPECT-- +string(6) "Cheese" Property changes on: tests/ogg/vorbis/tag/artist.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/gettaglist.phpt =================================================================== --- tests/ogg/vorbis/tag/gettaglist.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/gettaglist.phpt (.../trunk) @@ -0,0 +1,35 @@ +--TEST-- +KTaglib_Ogg_Tag::getFieldList() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->getTagList()); + +foreach($keys as $tagname) { + $ktaglib->getTag()->removeField($tagname); +} + +/** + * Add one field + */ +$ktaglib->getTag()-> +addField('hello', 'world'); + +var_dump($ktaglib->getTag()->getTagList()); +--EXPECT-- +array(1) { + ["HELLO"]=> + string(5) "world" +} Property changes on: tests/ogg/vorbis/tag/gettaglist.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/anyfield.phpt =================================================================== --- tests/ogg/vorbis/tag/anyfield.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/anyfield.phpt (.../trunk) @@ -0,0 +1,17 @@ +--TEST-- +KTaglib_Ogg_Tag::addField() / KTaglib_Ogg_Tag::getField() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->addField('whatever', 'Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getField('whatever')); +?> +--EXPECT-- +string(6) "Cheese" Property changes on: tests/ogg/vorbis/tag/anyfield.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/contains.phpt =================================================================== --- tests/ogg/vorbis/tag/contains.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/contains.phpt (.../trunk) @@ -0,0 +1,19 @@ +--TEST-- +KTaglib_Ogg_Tag::contains() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->addField('whatever2', 'Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->contains('whatever')); + +$ktaglib->getTag()->removeField('whatever2', 'Cheese'); +?> +--EXPECT-- +bool(true) Property changes on: tests/ogg/vorbis/tag/contains.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/empty.phpt =================================================================== --- tests/ogg/vorbis/tag/empty.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/empty.phpt (.../trunk) @@ -0,0 +1,14 @@ +--TEST-- +KTaglib_Ogg_Tag::isEmpty() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->isEmpty()); + +?> +--EXPECT-- +bool(false) Property changes on: tests/ogg/vorbis/tag/empty.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/album.phpt =================================================================== --- tests/ogg/vorbis/tag/album.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/album.phpt (.../trunk) @@ -0,0 +1,18 @@ +--TEST-- +KTaglib_Ogg_Tag::setAlbum() / KTaglib_Ogg_Tag::getAlbum() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->setAlbum(''); +$ktaglib->getTag()->setAlbum('Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getAlbum()); +?> +--EXPECT-- +string(6) "Cheese" Property changes on: tests/ogg/vorbis/tag/album.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/genre.phpt =================================================================== --- tests/ogg/vorbis/tag/genre.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/genre.phpt (.../trunk) @@ -0,0 +1,18 @@ +--TEST-- +KTaglib_Ogg_Tag::setGenre() / KTaglib_Ogg_Tag::getGenre() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->setGenre(''); +$ktaglib->getTag()->setGenre('Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getGenre()); +?> +--EXPECT-- +string(6) "Cheese" Property changes on: tests/ogg/vorbis/tag/genre.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/year.phpt =================================================================== --- tests/ogg/vorbis/tag/year.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/year.phpt (.../trunk) @@ -0,0 +1,17 @@ +--TEST-- +KTaglib_Ogg_Tag::setYear() / KTaglib_Ogg_Tag::getYear() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->setYear(2007); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getYear()); +?> +--EXPECT-- +int(2007) Property changes on: tests/ogg/vorbis/tag/year.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/removefield.phpt =================================================================== --- tests/ogg/vorbis/tag/removefield.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/removefield.phpt (.../trunk) @@ -0,0 +1,21 @@ +--TEST-- +KTaglib_Ogg_Tag::removeField() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->addField('whatever', 'Cheese'); + +$ktaglib->save(); + +$ktaglib->getTag()->removeField('whatever', 'Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getField('whatever')); +?> +--EXPECT-- +NULL Property changes on: tests/ogg/vorbis/tag/removefield.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/title.phpt =================================================================== --- tests/ogg/vorbis/tag/title.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/title.phpt (.../trunk) @@ -0,0 +1,18 @@ +--TEST-- +KTaglib_Ogg_Tag::setTitle() / KTaglib_Ogg_Tag::getTitle() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->setTitle(''); +$ktaglib->getTag()->setTitle('Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getTitle()); +?> +--EXPECT-- +string(6) "Cheese" Property changes on: tests/ogg/vorbis/tag/title.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/comment.phpt =================================================================== --- tests/ogg/vorbis/tag/comment.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/comment.phpt (.../trunk) @@ -0,0 +1,18 @@ +--TEST-- +KTaglib_Ogg_Tag::setComment() / KTaglib_Ogg_Tag::getComment() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->setComment(''); +$ktaglib->getTag()->setComment('Cheese'); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getComment()); +?> +--EXPECT-- +string(6) "Cheese" Property changes on: tests/ogg/vorbis/tag/comment.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/ogg/vorbis/tag/track.phpt =================================================================== --- tests/ogg/vorbis/tag/track.phpt (.../tags/RELEASE_0_2_0) +++ tests/ogg/vorbis/tag/track.phpt (.../trunk) @@ -0,0 +1,17 @@ +--TEST-- +KTaglib_Ogg_Tag::setTrack() / KTaglib_Ogg_Tag::getTrack() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getTag()->setTrack(17); + +$ktaglib->save(); + +var_dump($ktaglib->getTag()->getTrack()); +?> +--EXPECT-- +int(17) Property changes on: tests/ogg/vorbis/tag/track.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/getTitle.phpt =================================================================== --- tests/id3v1/getTitle.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/getTitle.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::getTitle() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->getTitle()); +--EXPECT-- +string(16) "Test ID3v1 Title" Property changes on: tests/id3v1/getTitle.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/getComment.phpt =================================================================== --- tests/id3v1/getComment.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/getComment.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::getComment() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->getComment()); +--EXPECT-- +string(18) "Test ID3v1 Comment" Property changes on: tests/id3v1/getComment.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/getTrack.phpt =================================================================== --- tests/id3v1/getTrack.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/getTrack.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::getTrack() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->getTrack()); +--EXPECT-- +int(1) Property changes on: tests/id3v1/getTrack.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/getArtist.phpt =================================================================== --- tests/id3v1/getArtist.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/getArtist.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::getArtist() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->getArtist()); +--EXPECT-- +string(17) "Test ID3v1 Artist" Property changes on: tests/id3v1/getArtist.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/id3v1.mp3 =================================================================== Cannot display: file marked as a binary type. svn:mime-type = audio/mpeg Index: tests/id3v1/id3v1.mp3 =================================================================== --- tests/id3v1/id3v1.mp3 (.../tags/RELEASE_0_2_0) +++ tests/id3v1/id3v1.mp3 (.../trunk) Property changes on: tests/id3v1/id3v1.mp3 ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +audio/mpeg \ No newline at end of property Index: tests/id3v1/isEmpty.phpt =================================================================== --- tests/id3v1/isEmpty.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/isEmpty.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::isEmpty() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->isEmpty()); +--EXPECT-- +bool(false) Property changes on: tests/id3v1/isEmpty.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/getAlbum.phpt =================================================================== --- tests/id3v1/getAlbum.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/getAlbum.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::getAlbum() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->getAlbum()); +--EXPECT-- +string(16) "Test ID3v1 Album" Property changes on: tests/id3v1/getAlbum.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/getGenre.phpt =================================================================== --- tests/id3v1/getGenre.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/getGenre.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::getGenre() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->getGenre()); +--EXPECT-- +string(9) "Classical" Property changes on: tests/id3v1/getGenre.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v1/getYear.phpt =================================================================== --- tests/id3v1/getYear.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v1/getYear.phpt (.../trunk) @@ -0,0 +1,12 @@ +--TEST-- +KTaglib_Tag::getYear() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getID3v1Tag()->getYear()); +--EXPECT-- +int(2000) Property changes on: tests/id3v1/getYear.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v2/addFrame.phpt =================================================================== --- tests/id3v2/addFrame.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v2/addFrame.phpt (.../trunk) @@ -0,0 +1,36 @@ +--TEST-- +KTaglib_ID3v2_Tag::addFrame() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getId3v2Tag()->getFrameList(); + +if (!array_key_exists("TSSE", $frameList)) { + echo "FAIL frame does not exist"; + exit; +} + +$ktaglib->getID3v2Tag()->removeFrame($frameList["TSSE"]); +/* +$ktaglib->save(); + +$ktaglib = new KTaglib_MPEG_File(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'removeFrame.mp3'); +*/ +$frameList = $ktaglib->getId3v2Tag()->getFrameList(); + +if (array_key_exists("TSSE", $frameList)) { + echo "FAIL frame not deleted"; + exit; +} + +unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'removeFrame.mp3'); + +echo "SUCCESS"; +--EXPECT-- +SUCCESS Property changes on: tests/id3v2/addFrame.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v2/getFrameList.phpt =================================================================== --- tests/id3v2/getFrameList.phpt (.../tags/RELEASE_0_2_0) +++ tests/id3v2/getFrameList.phpt (.../trunk) @@ -0,0 +1,46 @@ +--TEST-- +KTaglib_ID3v2_Tag::getFrameList() +--SKIPIF-- +if (!extension_loaded('ktaglib')) echo 'skip'; +--FILE-- +getId3v2Tag()->getFrameList()); +--EXPECT-- +array(11) { + ["COMM"]=> + object(KTaglib_ID3v2_CommentsFrame)#3 (0) { + } + ["TALB"]=> + object(KTaglib_ID3v2_Frame)#4 (0) { + } + ["TBPM"]=> + object(KTaglib_ID3v2_Frame)#5 (0) { + } + ["TCOM"]=> + object(KTaglib_ID3v2_Frame)#6 (0) { + } + ["TCON"]=> + object(KTaglib_ID3v2_Frame)#7 (0) { + } + ["TDRC"]=> + object(KTaglib_ID3v2_Frame)#8 (0) { + } + ["TIT2"]=> + object(KTaglib_ID3v2_Frame)#9 (0) { + } + ["TPE1"]=> + object(KTaglib_ID3v2_Frame)#10 (0) { + } + ["TPOS"]=> + object(KTaglib_ID3v2_Frame)#11 (0) { + } + ["TRCK"]=> + object(KTaglib_ID3v2_Frame)#12 (0) { + } + ["TSSE"]=> + object(KTaglib_ID3v2_Frame)#13 (0) { + } +} Property changes on: tests/id3v2/getFrameList.phpt ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: tests/id3v2/id3v2.mp3 =================================================================== Cannot display: file marked as a binary type. svn:mime-type = audio/mpeg Index: tests/id3v2/id3v2.mp3 =================================================================== --- tests/id3v2/id3v2.mp3 (.../tags/RELEASE_0_2_0) +++ tests/id3v2/id3v2.mp3 (.../trunk) Property changes on: tests/id3v2/id3v2.mp3 ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +audio/mpeg \ No newline at end of property Index: ktaglib_mpeg_audioproperties.cpp =================================================================== --- ktaglib_mpeg_audioproperties.cpp (.../tags/RELEASE_0_2_0) +++ ktaglib_mpeg_audioproperties.cpp (.../trunk) @@ -22,7 +22,7 @@ | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | - | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | + | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | POSSIBILITY OF SUCH DAMAGE. | +----------------------------------------------------------------------+ @@ -68,7 +68,7 @@ ze_ktaglib_object *intern = NULL; intern = (ze_ktaglib_object*) zend_object_store_get_object(getThis() TSRMLS_CC); - + RETURN_LONG(intern->properties->channels()); } @@ -151,6 +151,7 @@ PHP_ME(KTaglib_MPEG_AudioProperties, isProtectionEnabled, NULL, ZEND_ACC_PUBLIC) PHP_ME(KTaglib_MPEG_AudioProperties, isOriginal, NULL, ZEND_ACC_PUBLIC) PHP_ME(KTaglib_MPEG_AudioProperties, getVersion, NULL, ZEND_ACC_PUBLIC) + PHP_ME(KTaglib_MPEG_AudioProperties, isCopyrighted, NULL, ZEND_ACC_PUBLIC) { NULL, NULL, NULL } }; Property changes on: ktaglib_mpeg_audioproperties.cpp ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.3 \ No newline at end of property +1.4 \ No newline at end of property Index: ktaglib_mpeg.cpp =================================================================== --- ktaglib_mpeg.cpp (.../tags/RELEASE_0_2_0) +++ ktaglib_mpeg.cpp (.../trunk) @@ -54,7 +54,11 @@ RETURN_FALSE; } +#if PHP_API_VERSION < 20100412 if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { +#else + if (php_check_open_basedir(filename TSRMLS_CC)) { +#endif RETURN_FALSE; } Index: php_ktaglib.h =================================================================== --- php_ktaglib.h (.../tags/RELEASE_0_2_0) +++ php_ktaglib.h (.../trunk) @@ -35,7 +35,7 @@ #ifndef PHP_KTAGLIB_H #define PHP_KTAGLIB_H -#define PHP_KTAGLIB_VERSION "0.0.1-dev" +#define PHP_KTAGLIB_VERSION "0.3.0" #ifdef __cplusplus extern "C" { @@ -90,6 +90,9 @@ } // extern "C" #endif +#if PHP_VERSION_ID >= 50399 +static zend_object_handlers default_ktaglib_handlers; +#endif /* internal functions */ void ktaglib_init_class(zend_class_entry **, zend_class_entry *, const char *, zend_function_entry *); Property changes on: php_ktaglib.h ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.7 \ No newline at end of property +1.8 \ No newline at end of property Index: ktaglib_ogg_vorbis.cpp =================================================================== --- ktaglib_ogg_vorbis.cpp (.../tags/RELEASE_0_2_0) +++ ktaglib_ogg_vorbis.cpp (.../trunk) @@ -53,7 +53,11 @@ RETURN_FALSE; } +#if PHP_API_VERSION < 20100412 if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { +#else + if (php_check_open_basedir(filename TSRMLS_CC)) { +#endif RETURN_FALSE; } @@ -71,7 +75,7 @@ */ try { intern->file = new TagLib::Ogg::Vorbis::File(filename); - } catch(bad_alloc xa) { + } catch(std::bad_alloc xa) { zend_throw_exception(ktaglib_ce_BadAllocException, "Cannot allocate memory", 0 TSRMLS_CC); return; } Index: config.w32 =================================================================== --- config.w32 (.../tags/RELEASE_0_2_0) +++ config.w32 (.../trunk) @@ -4,7 +4,10 @@ ARG_WITH("ktaglib", "KTaglib support", "no"); if (PHP_KTAGLIB != "no") { - ADD_FLAG("CFLAGS", "/EHsc"); + + ADD_FLAG("CFLAGS_KTAGLIB", "/EHsc"); + ADD_FLAG("CFLAGS_KTAGLIB", "/D _ALLOW_KEYWORD_MACROS"); + if (CHECK_LIB("tag_a.lib;tag.lib", "ktaglib", PHP_KTAGLIB) && CHECK_HEADER_ADD_INCLUDE("taglib/taglib.h", "CFLAGS_KTAGLIB", null, null, "taglib")) { EXTENSION('ktaglib', 'ktaglib.cpp ktaglib_mpeg.cpp ktaglib_tag.cpp \ Index: ChangeLog =================================================================== --- ChangeLog (.../tags/RELEASE_0_2_0) +++ ChangeLog (.../trunk) @@ -0,0 +1,4 @@ +2008-08-01 David Soria Parra + + * package.xml, php_ktaglib.h: KTaglib Version 0.0.1a1. + Property changes on: ChangeLog ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: package.xml =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/xml Index: package.xml =================================================================== --- package.xml (.../tags/RELEASE_0_2_0) +++ package.xml (.../trunk) Property changes on: package.xml ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.1.1.1 \ No newline at end of property +1.3 \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -application/xml \ No newline at end of property Index: CREDITS =================================================================== --- CREDITS (.../tags/RELEASE_0_2_0) +++ CREDITS (.../trunk) @@ -0,0 +1,2 @@ +ktaglib +David Soria Parra, Anatol Belski Property changes on: CREDITS ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: EXPERIMENTAL =================================================================== --- EXPERIMENTAL (.../tags/RELEASE_0_2_0) +++ EXPERIMENTAL (.../trunk) @@ -0,0 +1,5 @@ +this extension is experimental, +its functions may change their names +or move to extension all together +so do not rely to much on them +you have been warned! Property changes on: EXPERIMENTAL ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1.1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property